Hey, we used Metabase for the last year and we love it.
last night we had to restart the machine that hosts our Metabase instance, and after rebooting the container didn't want to run, with the error: Database connection error, with TimeoutException of 5.0 seconds. We didn't know we used an h2 database and that it is not recommended.
Things we tried:
- Restored a snapshot of two weeks back, but it still didn't boot.
- Migrating to postgres, the migration fails with the exception: org.h2.jdbc.JdbcSQLException: IO Exception: null [90028-197]. We then figured the database was corrupted..
- Using h2 Recover tool, we got the following exception: java.lang.IllegalStateException: Reading from ... failed; file length 234222080 read length 1207808 at 234222080 [1.4.197/1]
We are currently kind of hopeless and would like to know if there's something you can offer us to do..
the H2 database is so big that the connection cannot be established in 5 seconds. Use
MB_DB_CONNECTION_TIMEOUT_MS to increase the timeout or use faster disks in the server you're hosting Metabase.
Once you're able to connect, migrate ASAP to postgres or mysql
Thank you so much for the answer,
about an hour after I posted, I've managed to solve the issue.
it is indeed was the problem, it just needed some time, I was having difficult time to add the correct env var because it was running inside a container, and I couldn't create a new container with the old db file, so I had to quickly add the env var to the running container before it shuts down.
The thing I still don't understand is what it gave me those error while trying to migrate to postgres, we were absolutely sure that the db file was corrupted...
do you guys have a tutorial on how to migrate to postgres when Metabase is running inside a container?
because I copied the db file outside but I guess it wasn't enough..