DevPortal does not work well

book

Article ID: 225421

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

Not all containers are started, specifically portal_analytics-server

[email protected] ~]# docker service ls
ID                  NAME                        MODE                REPLICAS            IMAGE                                    PORTS
oo2lly47btex        portal_analytics-server     global              0/1                 caapim/analytics-server:5.0              *:9045->9045/tcp
w742nm39y496        portal_apim                 global              1/1                 caapim/ingress:5.0
vd7ieisj6rem        portal_authenticator        global              1/1                 caapim/authenticator:5.0

 

Cause

DevPortal was using 100% CPU, attempt to restart the portal using script "portal.sh".  Issues with locks to portal_db occurred 

Log from the portal_analytics-server container

 

[email protected]    | [QueryServer.log] [2021-10-04 16:12:07,332] [INFO ] [l.e.j.JdbcExecutor] [main] [|] [|||] SELECT ID,LOCKED,LOCKGRANTED,LOCKEDBY FROM public.databasechangeloglock WHERE ID=1 

.

.

[email protected]    | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'analyticsLiquibase' defined in class path resource [com/ca/apim/portal/analytics/configuration/AnalyticsLiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by 172.18.0.7 (172.18.0.7) since 9/2/21 7:56 PM

 

To solve need to clear the lock in the analytice DB

 

 

 

Environment

Release : 5.0

Component : API PORTAL

Resolution

The  analytics DB is locked - most likely is shut down unexpectedly 

We will need to access the exec of the  portal_db container, then access postGres, analytics database to change the lock to false

# docker ps | grep postgres ls 

Get the container ID 

# docker exec -it <containerID-prmiary>  /bin/sh

psql -U admin

7layer

List databases:

\l

Connect to analytics

\c analytics

To view:

select * from databasechangeloglock;

Set to false

update  databasechangeloglock set locked = false

EXIT

The analytics container should start on next attempt

This will fix the start problem, but it the login still fails it maybe a user password issue