{"id":6489,"date":"2017-11-03T08:12:48","date_gmt":"2017-11-03T13:12:48","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=6489"},"modified":"2017-11-03T08:12:48","modified_gmt":"2017-11-03T13:12:48","slug":"releasing-h2-lock-that-prevents-startup","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2017\/11\/03\/releasing-h2-lock-that-prevents-startup\/","title":{"rendered":"Releasing H2 lock that prevents startup"},"content":{"rendered":"<p>We have a  small keycloak instance in development that would not start after a VM failure.  We ended up restoring the filesystem on which it lives, which resolved the issue.  After that fact, I drilled in to determine how to resolve this without a restore and wanted to provide my findings.  These are shown below.<\/p>\n<p>The exception on startup&#8230;<\/p>\n<pre>\r\nCaused by: liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by cmhlqauthapi01.expdev.local (172.26.209.73) since 10\/31\/17 11:19 AM\r\n<\/pre>\n<p>&#8230;and a query using the H2 shell against the problematic install&#8230;<\/p>\n<pre>\r\n-bash-4.1$ java -cp \/media\/nfs\/keycloak\/keycloak-1.9.1.Final\/modules\/system\/layers\/base\/com\/h2database\/h2\/main\/h2-1.3.173.jar org.h2.tools.Shell -url \"jdbc:h2:file:\/media\/nfs\/keycloak\/keycloak-1.9.1.Final\/standalone\/data\/keycloak\" -driver \"org.h2.Driver\" -user \"sa\" -password \"sa\"\r\n\r\nWelcome to H2 Shell 1.3.173 (2013-07-28)\r\nExit with Ctrl+C\r\nCommands are case insensitive; SQL statements end with ';'\r\nhelp or ?      Display this help\r\nlist           Toggle result list \/ stack trace mode\r\nmaxwidth       Set maximum column width (default is 100)\r\nautocommit     Enable or disable autocommit\r\nhistory        Show the last 20 statements\r\nquit or exit   Close the connection and exit\r\n\r\nsql> select * from public.DATABASECHANGELOGLOCK;\r\nID | LOCKED | LOCKGRANTED             | LOCKEDBY\r\n1  | TRUE   | 2017-10-31 11:19:36.775 | cmhlqauthapi01.expdev.local (172.26.209.73)\r\n(1 row, 3 ms)\r\nsql>\r\n<\/pre>\n<p>We could have simply deleted this row, and the problem would have been resolved.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have a small keycloak instance in development that would not start after a VM failure. We ended up restoring the filesystem on which it lives, which resolved the issue. After that fact, I drilled in to determine how to&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2017\/11\/03\/releasing-h2-lock-that-prevents-startup\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[13],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6489"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=6489"}],"version-history":[{"count":3,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6489\/revisions"}],"predecessor-version":[{"id":6492,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6489\/revisions\/6492"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=6489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=6489"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=6489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}