Failed to connect to database: org.h2.jdbc.JdbcSQLException

Server crashed unexpectedly. Now when I restart using the JAVA -jar metabase.jar i get

03-01 11:17:46 INFO metabase.db :: Verifying h2 Database Connection …
03-01 11:17:47 ERROR metabase.driver :: Failed to connect to database: org.h2.jdbc.JdbcSQLException: General error: “java.lang.NullPointerException” [50000-193]
java.lang.AssertionError: Assert failed: Unable to connect to Metabase h2 DB.
(binding [allow-potentailly-unsafe-connections true] (require (quote metabase.driver)) ((resolve (quote metabase.driver/can-connect-with-details?)) engine details))
at metabase.db$verify_db_connection.invokeStatic(db.clj:341)
at metabase.db$verify_db_connection.invoke(db.clj:334)
at metabase.db$verify_db_connection.invokeStatic(db.clj:337)
at metabase.db$verify_db_connection.invoke(db.clj:334)
at metabase.db$setup_db_BANG_.invokeStatic(db.clj:390)
at metabase.db$setup_db_BANG_.doInvoke(db.clj:383)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at metabase.core$init_BANG_.invokeStatic(core.clj:113)
at metabase.core$init_BANG_.invoke(core.clj:93)
at metabase.core$start_normally.invokeStatic(core.clj:196)
at metabase.core$start_normally.invoke(core.clj:190)
at metabase.core$_main.invokeStatic(core.clj:288)
at metabase.core$_main.doInvoke(core.clj:283)
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)
03-01 11:17:47 ERROR metabase.core :: Metabase Initialization FAILED: Assert failed: Unable to connect to Metabase h2 DB.
(binding [allow-potentailly-unsafe-connections true] (require (quote metabase.driver)) ((resolve (quote metabase.driver/can-connect-with-details?)) engine details))

I have tried deleting the lock file too. Still no result. I dont have a back up. Is there a way I can get my queries back or have it up and running

Here’s a process I would try to follow (apologies up front for the slightly :smiling_imp: sarcastic tone):

  1. :scream: Unless you’re Chuck Norris (see #7)
  2. Make a backup copy … no make that two … one in a separate folder to experiment on … and another one tucked away in a safe place …of your presumably broken Metabase H2 database. (It’s probably named metabase.db.mv.db) - perform all following steps on that first experiment copy of the file.
  3. “Install H2” - meaning place a copy of h2-<something>.jar - from http://www.h2database.com in your experiment folder.
  4. Try to see if e.g. other experiences already shared in this forum works -
    e.g. a quick search turned up: Unable to connect to Metabase h2 DB
  5. If the previous step didn’t work, try your luck with the H2 recover tool
  6. depending on the outcome of the previous step (which I haven’t tried myself, because I don’t currently own a broken H2 database) try gently salvaging - either by starting a copy of metabase.jar in your experiment folder on the repaired H2 database or otherwise manually … extract/dump whatever can be extracted.
  7. Now go and revise and follow your procedures regarding backup - including making sure that you can actually work with data you restore.
  8. Share your experiences here in http://discourse.metabase.com