Follow

Unable to Start Reporting - Changelog Lock

Symptom:

 

The reporting server won’t restart. It appears to hang when running the “db migrate” step.

 

The reporting.log contains lines like this:

 

INFO  [2016-08-24 13:36:53,331] liquibase: Waiting for changelog lock....

INFO  [2016-08-24 13:37:03,333] liquibase: Waiting for changelog lock....

INFO  [2016-08-24 13:37:13,334] liquibase: Waiting for changelog lock....

INFO  [2016-08-24 13:37:23,335] liquibase: Waiting for changelog lock....

ERROR [2016-08-24 13:37:26,612] org.apache.tomcat.jdbc.pool.ConnectionPool: Unable to create initial connections of pool.

! java.lang.IllegalStateException: The file is locked: nio:/opt/interset/reporting/investigator-db.mv.db [1.4.178/7]

! at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:757) ~[reporting-interset~g772ebb80289a5a5d017d8044b721bc1a59f2202e~42.jar:na]

! at org.h2.mvstore.FileStore.open(FileStore.java:168) ~[reporting-interset~g772ebb80289a5a5d017d8044b721bc1a59f2202e~42.jar:na]

! ... 29 common frames omitted

! Causing: org.h2.jdbc.JdbcSQLException: Database may be already in use: "/opt/interset/reporting/investigator-db.mv.db". Possible solutions: close all other connection(s); use the server mode [90020-178]

! at org.h2.message.DbException.getJdbcSQLException(DbException.java:344) ~[reporting-interset~g772ebb80289a5a5d017d8044b721bc1a59f2202e~42.jar:na]

! at org.h2.message.DbException.get(DbException.java:167) ~[reporting-interset~g772ebb80289a5a5d017d8044b721bc1a59f2202e~42.jar:na]

 

Cause:

 

This will happen if the database is locked. The database might be legitimately locked (e.g. if another reporting server process is already running and using it), or it might be a stale lock left over from a previous run which was killed part-way through.

 

Resolution:

 

Check whether other reporting service instances are running. If you want to force the removal of the lock then follow these steps:

 

java -cp /opt/interset/lib/investigator.jar org.h2.tools.Shell

 

It will ask a series of questions.

 

  URL: jdbc:h2:/opt/interset/reporting/investigator-db

  Driver: (hit ENTER)

  User: sa

  Password: sa

 

In the shell issue this command:

 

  drop table databasechangeloglock;

 

Exit with ‘exit’. You should now be able to successfully start the reporting server.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk