Portal upgrade fails with liquibase.exception.DatabaseException
search cancel

Portal upgrade fails with liquibase.exception.DatabaseException

book

Article ID: 268735

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

Portal upgrade fails from 5.0.2 to 5.1.2 release.

Error found in the db-upgrade container log.

Jun 19 10:50:29 hostname eab22d62199e[3779]: Unexpected error running Liquibase: Migration failed for change set doesntmatter::portaldb-28.2-DML-Adding-EmailTemplate-AppDeleteApprovalNotification-To-EMAIL_TEMPLATE-Table.xml::mr654504:
Jun 19 10:50:29 hostname eab22d62199e[3779]:      Reason: liquibase.exception.DatabaseException: FUNCTION portal.generate_uuid does not exist 

Environment

Release : 5.0.2

Cause

The db-upgrade Liquibase scripts removed the FUNCTIONS during upgrade but failed to create new ones.

mysql> SHOW FUNCTION  STATUS WHERE db = 'portal';

Empty set (0.02 sec)

Resolution

Manually created the below FUNCTIONS.

CREATE DEFINER=`msqladmin`@`%` FUNCTION `generate_uuid`() RETURNS varchar(36) CHARSET utf8mb4 DETERMINISTIC RETURN UUID();

CREATE DEFINER=`msqladmin`@`%` FUNCTION `AES_DECRYPT_PORTAL`() RETURNS varchar(36) CHARSET utf8mb4 DETERMINISTIC RETURN UUID();

CREATE DEFINER=`msqladmin`@`%` FUNCTION `AES_ENCRYPT_PORTAL`() RETURNS varchar(36) CHARSET utf8mb4 DETERMINISTIC RETURN UUID();

CREATE DEFINER=`msqladmin`@`%` FUNCTION `current_ms`() RETURNS varchar(36) CHARSET utf8mb4 DETERMINISTIC RETURN UUID();

-----------------------

Run portal.sh script to start portal upgrade.