Portal 5.3 upgrade database upgrade failure
search cancel

Portal 5.3 upgrade database upgrade failure

book

Article ID: 377423

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

Unable to start portal when upgrading to 5.3 ,Error  on database upgrade job.

Using  Maria DB, version 10.6.9

The error is encountered when the JOB DB Upgrade is launched:

at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:66)
... 26 more
Caused by: liquibase.exception.DatabaseException: Column 'CREATE_TS' cannot be null [Failed SQL: (1048) INSERT INTO KEY_STORE (
UUID, NAME, KEY_STORE_TYPE, DEPLOYMENT_TYPE, CREATE_TS, MODIFY_TS, CREATED_BY, MODIFIED_BY, TENANT_ID
)
....
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:393)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:82)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:150)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1278)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1260)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
... 46 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: Column 'CREATE_TS' cannot be null
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:389)
... 51 more
ERROR: Running the portal-data liquibase scripts failed, see above for details; exiting
09:20:47, Stopping simple server on :8080... done

Resolution

This will  be fixed in Portal 5.3.1. For now the  below workaround to upgrade to 5.3 when using Mariadb can be used .

1. In the failure environment, stop the Portal Stack

2. Login to portal DB and execute the below commands

ALTER table KEY_STORE MODIFY CREATE_TS BIGINT null;
ALTER table KEY_STORE MODIFY MODIFY_TS BIGINT null;

3. Continue the upgrade (start the portal stack again)

4. Login to portal DB and execute the below commands

UPDATE KEY_STORE SET CREATE_TS=UNIX_TIMESTAMP() * 1000, MODIFY_TS=UNIX_TIMESTAMP() * 1000;
ALTER table KEY_STORE MODIFY CREATE_TS BIGINT not null;
ALTER table KEY_STORE MODIFY MODIFY_TS BIGINT not null;

5. restart the portal stack ones more .