API Portal 4.2 does not come up after a power outage and restart.
We are using MYSQL database.
We see the following error messages in the portal logs :
| 2018-08-20 15:56:13.854 WARN [tenant-provisioning-service,,,] 9 --- [ main] c.c.a.p.tenant.config.LiquibaseConfig : Failed to get DB connection on attempt 0 of 5 [An attempt by a client to checkout a Connection has timed out.], retrying in 5s
| 2018-08-20 15:56:20.318 INFO [tenant-provisioning-service,,,] 9 --- [ main] liquibase : Waiting for changelog lock....
So the portal tenant is waiting for changelog lock :
API Portal 4.2
With MYSQL database
But full resolution means checking ALL the mysql databases to see if any of them have DATABASECHANGELOGLOCK entries locking access to the database.
In this particular case we find the tenant provisioning database has an entry in DATABASECHANGELOGLOCK locking access to the database.
The below steps solved the issue:
mysql> use TENANT_PROVISIONING ;
mysql> SELECT * FROM DATABASECHANGELOGLOCK; UPDATE DATABASECHANGELOGLOCK SET locked=0, lockgranted=null, lockedby=null WHERE id=1;
But all databases should be checked for LOGLOCK entries.