Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupt h2 database - switch to SQLite! #3080

Closed
marktheunissen opened this issue Jul 30, 2016 · 1 comment
Closed

Corrupt h2 database - switch to SQLite! #3080

marktheunissen opened this issue Jul 30, 2016 · 1 comment

Comments

@marktheunissen
Copy link

  • I am using the Chrome browser.
  • My computer's OS is MacOSX.
  • I'm running Metabase in Docker and it is using the h2 database
  • My data is in a Postgres database.
  • My Metabase version is 0.18.1.

My metabase h2 db gave up on me. It cannot connect to the database anymore:

liquibase.exception.DatabaseException: liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by 1ef446d26f20 (172.18.0.3) since 7/29/16 10:17 AM
    at metabase.db$migrate.invokeStatic(db.clj:118)
    at metabase.db$migrate.invoke(db.clj:106)
    at metabase.db$setup_db.invokeStatic(db.clj:178)
    at metabase.db$setup_db.doInvoke(db.clj:166)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at metabase.core$init_BANG_.invokeStatic(core.clj:130)
    at metabase.core$init_BANG_.invoke(core.clj:114)
    at metabase.core$start_normally.invokeStatic(core.clj:214)
    at metabase.core$start_normally.invoke(core.clj:208)
    at metabase.core$_main.invokeStatic(core.clj:248)
    at metabase.core$_main.doInvoke(core.clj:243)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at metabase.core.main(Unknown Source)

I searched the issues and tried all the tips, including renaming the file, deleting the lock, "recovering" it, I even installed Windows and Java to try connect to the database file after copying it off my Linux server. Nothing works, it appears empty and Metabase cannot recover.

I now have to start all over again with making dashboards, adding questions and users, etc.

After researching the h2 database, my opinion is that it is a very poor choice for storing application critical data. Have you all looked at the homepage for H2? It still recommends and shows screenshots of Windows XP! http://www.h2database.com/html/quickstart.html

This project should switch to using SQLite or alternatively put a giant red warning in bold letters across the front of the README:

WARNING! DO NOT PUT ANYTHING CRITICAL IN THE EMBEDDED H2 DATABASE, IT IS FOR EVALUATION PURPOSES ONLY!

I'm going to now rebuild everything in Postgres.

The frontend is super slick and awesome, but H2.... 😱

@camsaul
Copy link
Member

camsaul commented Aug 2, 2016

Hi @marktheunissen, our guide to Troubleshooting Common Problems explains how to fix the issue you're seeing.

We have no plans to switch the default database from H2 to SQLite, and no immediate-term plans to add giant red warnings in bold letters anywhere. As you've noted, you can use Postgres or MySQL instead; you may find our guide to Migrating to Postgres or MySQL handy.

@camsaul camsaul closed this as completed Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants