Portal Fails To Start Up After Upgrading To 5.4 Version
search cancel

Portal Fails To Start Up After Upgrading To 5.4 Version

book

Article ID: 426697

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

After upgrading to Portal 5.4 and attempting to start things we see that the portal fails to start up successfully.

 

# ./portal.sh
Creating network portal_db
Creating service portal_db-upgrade
Creating service portal_db-upgrade-rbac
Checking to see if DB schema update is needed........................................

 

Looking at the portal_db-upgrade container logs we see the following exceptions taking place:

Unexpected error running Liquibase: Migration failed for change set doesntmatter::portaldb-42.1-remove-deleted-gwp-apis::tg892580:
Reason: liquibase.exception.DatabaseException: Cannot delete or update a parent row: a foreign key constraint fails (`portal`.`APPLICATION_API_API_GROUP_XREF`, CONSTRAINT `FK_AAAG_XREF_API_UUID` FOREIGN KEY (`TENANT_ID`, `API_UUID`) REFERENCES `API` (`TENANT_ID`, `UUID`)) [Failed SQL: (1451) DELETE FROM API WHERE PORTAL_STATUS = 'DELETED'
AND PUBLISHED_BY_PORTAL = b'0']

Environment

CA API Developer Portal 5.4

Cause

In the 5.4 db-upgrade-portal image, we have delete statements to delete gateway published api whose status is DELETED to free up disk space, but if those apis have foreign key restrictions on either the APPLICATION_API_API_GROUP_XREF table or the API_GROUP_API_XREF table, then the delete statements will fail.

Resolution

Execute the following query on the mysql portal db:


SELECT * FROM portal.APPLICATION_API_API_GROUP_XREF where api_uuid in
(SELECT uuid FROM API WHERE PORTAL_STATUS = 'DELETED' AND PUBLISHED_BY_PORTAL = b'0');

This should indicate entries in the db which are causing the problem.

To fix this situation you will need to manually delete those returned entries from the portal database.

 

Once that is done, please try to restart the portal stack and things should start up successfully.

Additional Information

A fix for this situation will be included in a future portal 5.4.x release