Developer portal upgrade failure from Pre 4.5 portal to 5.2.1
search cancel

Developer portal upgrade failure from Pre 4.5 portal to 5.2.1

book

Article ID: 270816

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

Portal fails to start after update to 5.2.1 and db-upgrade-portal container is crashing with liquibase error that indicates failure to apply changeset "add-request-read-permissions-for-orgusers"
 
Cannot add or update a child row: a foreign key constraint fails (`rbac`.`role_permission`, CONSTRAINT `fk_perm_uuid_from_permission` FOREIGN KEY (`perm_uuid`) REFERENCES `permission` (`uuid`) ON DELETE CASCADE ON UPDATE NO ACTION)

Environment

Developer Portal pre 4.5 

Developer Portal 5.2.1

Cause

Permission uuid is NOT 10a672a3-6333-11e7-aca9-0242ac130002 using following mysql query: 
select UUID from permission where entity='REQUEST' and operation='READ'

Resolution

Confirm the permission uuid is NOT 10a672a3-6333-11e7-aca9-0242ac130002 using following mysql query: 
select UUID from permission where entity='REQUEST' and operation='READ'
Run mysql query to manually apply changeset: 
USE rbac;

INSERT INTO `role_permission` (`uuid`, `role_uuid`, `perm_uuid`, `create_ts`, `modify_ts`, `created_by`)
VALUES ('a7f1c6b1-21df-11ea-a197-0242ac198567', '00000005-0005-0005-0005-000000000005', (select UUID from permission where entity='REQUEST' and operation='READ'), '1688533232', '0', 'SYSTEM');

INSERT INTO `role_permission` (`uuid`, `role_uuid`, `perm_uuid`, `create_ts`, `modify_ts`, `created_by`)
VALUES ('a7f1c6b1-21df-11ea-a197-0242ac198568', '00000006-0006-0006-0006-000000000006', (select UUID from permission where entity='REQUEST' and operation='READ'), '1688533232', '0', 'SYSTEM');


INSERT INTO `DATABASECHANGELOG`
(`ID`,
`AUTHOR`,
`FILENAME`,
`DATEEXECUTED`,
`ORDEREXECUTED`,
`EXECTYPE`,
`MD5SUM`,
`DESCRIPTION`,
`COMMENTS`,
`TAG`,
`LIQUIBASE`,
`CONTEXTS`,
`LABELS`,
`DEPLOYMENT_ID`)
VALUES
('add-request-read-permissions-for-orgusers',
'rk667895',
'doesntmatter',
'2023-07-05 07:05:15',
71,
'EXECUTED',
NULL,
NULL,
NULL,
NULL,
'4.3.5',
NULL,
NULL,
'7928891464');

Additional Information