This article will address the issue of duplicate entries for the tenant UUID, which is known by seeing the following logs in the portal_portal-enterprise container:
portal_apim.0.obgkrdiykwya@hostname | ingress: Updating existing TENANT_GATEWAY record: 000
portal_apim.0.obgkrdiykwya@hostname | ingress: Error adding new record to TENANT_GATEWAY
portal_apim.0.obgkrdiykwya@hostname | ERROR - Failed executing the script: /opt/docker/rc.d/zzz_init-tenant-enrollment.sh
This article applies to all supported versions of the API Developer Portal.
This issue is caused by duplicate entries for apim from TENANT_GATEWAY table.
To resolve this issue, you must remove the duplicate entries for apim from tenant_gateway table, cleared docker portal stack and restart the appliance to fix. The commands below should be run in order (be sure to substitute the variables as needed):
docker exec -it <portaldbContainerID> psql -U admin portal --command "delete from tenant_gateway where uuid='<UUID>';"
docker stack rm portal
docker rm -f $(docker ps -qa)
reboot
If unsure how to find the portaldb container ID, run the following command:
docker container ls