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

Migrating from using the H2 database to Postgres error: Database "/data/metabase/metabase.db.h2.db" not found [90013-194] #7221

Closed
pobear opened this issue Mar 28, 2018 · 7 comments
Assignees
Milestone

Comments

@pobear
Copy link

pobear commented Mar 28, 2018

Running env

System CentOS 7
Metabase v0.28.1
java version "1.8.0_72"
Java(TM) SE Runtime Environment (build 1.8.0_72-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode)

Migration error logs

[root@jzb-fabric metabase]# java -jar metabase.jar load-from-h2 /data/metabase/metabase.db.h2.db
03-28 11:37:00 INFO metabase.util :: Loading Metabase...
03-28 11:37:05 INFO util.encryption :: DB details encryption is DISABLED for this Metabase instance. 🔓 
See http://www.metabase.com/docs/latest/operations-guide/start.html#encrypting-your-database-connection-details-at-rest for more information.
03-28 11:37:20 INFO metabase.db :: Verifying postgres Database Connection ...
03-28 11:37:20 INFO metabase.db :: Verify Database Connection ...  ✅
03-28 11:37:20 INFO metabase.db :: Running Database Migrations...
03-28 11:37:20 INFO metabase.db :: Setting up Liquibase...
03-28 11:37:20 INFO metabase.db :: Liquibase is ready.
03-28 11:37:20 INFO metabase.db :: Checking if Database has unrun migrations...
03-28 11:37:23 INFO metabase.db :: Database Migrations Current ...  ✅
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier 'hocon:/reference,/application,/c3p0,/' could not be found. Skipping.", exception -> null]
Temporarily disabling DB constraints...
[OK]
org.h2.jdbc.JdbcSQLException: Database "/data/metabase/metabase.db.h2.db" not found [90013-194]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
	at org.h2.message.DbException.get(DbException.java:179)
	at org.h2.message.DbException.get(DbException.java:155)
	at org.h2.engine.Engine.openSession(Engine.java:62)
	at org.h2.engine.Engine.openSession(Engine.java:176)
	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154)
	at org.h2.engine.Engine.createSession(Engine.java:137)
	at org.h2.engine.Engine.createSession(Engine.java:27)
	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:354)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:116)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:100)
	at org.h2.Driver.connect(Driver.java:69)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:208)
	at clojure.java.jdbc$get_connection.invokeStatic(jdbc.clj:364)
	at clojure.java.jdbc$get_connection.invoke(jdbc.clj:226)
	at metabase.cmd.load_from_h2$load_data_BANG_.invokeStatic(load_from_h2.clj:145)
	at metabase.cmd.load_from_h2$load_data_BANG_.invoke(load_from_h2.clj:144)
	at metabase.cmd.load_from_h2$load_from_h2_BANG_$fn__46638.invoke(load_from_h2.clj:225)
	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:741)
	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:776)
	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:724)
	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
	at metabase.cmd.load_from_h2$load_from_h2_BANG_.invokeStatic(load_from_h2.clj:222)
	at metabase.cmd.load_from_h2$load_from_h2_BANG_.invoke(load_from_h2.clj:215)
	at clojure.lang.Var.invoke(Var.java:379)
	at metabase.cmd$load_from_h2.invokeStatic(cmd.clj:36)
	at metabase.cmd$load_from_h2.invoke(cmd.clj:29)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:646)
	at clojure.core$apply.invoke(core.clj:641)
	at metabase.cmd$run_cmd$fn__46694.invoke(cmd.clj:126)
	at metabase.cmd$run_cmd.invokeStatic(cmd.clj:126)
	at metabase.cmd$run_cmd.invoke(cmd.clj:122)
	at clojure.lang.Var.invoke(Var.java:383)
	at metabase.core$run_cmd.invokeStatic(core.clj:259)
	at metabase.core$run_cmd.invoke(core.clj:257)
	at metabase.core$_main.invokeStatic(core.clj:268)
	at metabase.core$_main.doInvoke(core.clj:264)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at metabase.core.main(Unknown Source)
Command failed with exception: Database "/data/metabase/metabase.db.h2.db" not found [90013-194]
@camsaul
Copy link
Member

camsaul commented Mar 29, 2018

I don't know why we haven't put this in the docs. I'll go ahead and do that The DB file part of the command should just be metabase.db instead of metabase.db.h2.db. Don't include the .h2.db part, H2 adds that in automatically

@camsaul
Copy link
Member

camsaul commented Mar 29, 2018

Dox fixed in #7233

@camsaul camsaul closed this as completed Mar 29, 2018
@salsakran
Copy link
Contributor

@pobear this is fixed in 0.28.4 which just went out

@pajachiet
Copy link

This would be great if this was indicated in H2 connection string also. This was not obvious at all when I tried to connect from metabase to the local H2 database, and got this error
org.h2.jdbc.JdbcSQLException: Database "/metabase.db/metabase.db.mv.db" not found

@sowmya-mani
Copy link

I discovered this facing the same error during migration and sharing what I found:

My H2 DB files are in a folder metabase.db which has 2 files metabase.db.mv.db and metabase.db.trace.db inside.

When running the migration command, remember to use the metabase.db.mv.db file within the metabase.db folder in your command, so your command will be
java -jar metabase.jar load-from-h2 /path/to/metabase.db/metabase.db

Or instead copy your metabase.jar into the metabase.db folder and run the migration command directly from there with java -jar metabase.jar load-from-h2

@scottrobertson
Copy link

@sowmya-mani omg thank you so much. Having a folder named metabase.db makes the docs soooo confusing ha.

@oivoodoo
Copy link

java -jar metabase.jar load-from-h2

copy metabase.jar to the same folder did the trick in 2021 :) thank you!

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

7 participants