Metabase stuck at startup (File corrupted in chunk)

#1

Hello,
Last night IT guys took the image of the server and now it runs in an virtualized environment. Every software runs as expected on the new server (SQL Server, ERP, MES Service, etc) but Metabase stuck at server with the error
Failed to connect to database: org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalStateException: File corrupted in chunk 3115901, expected page length 4..96, got 1768846370 [1.4.197/6]" [50000-197]

Should I try to find the backups or do you have any other suggestion?

Regards,
Turker TUNALI

#2

Hi @turker.tunali
It sounds like Metabase wasn’t closed correctly, which might cause corruption of the H2 database.
You either have to figure out the corruption in the H2 database or restore from backup (probably the easiest).
And then you need to migrate away from H2, since this is the exact reason why it’s not recommended for production:
https://www.metabase.com/docs/latest/operations-guide/start.html#migrating-from-using-the-h2-database-to-mysql-or-postgres

#3

OK, thank you @flamber. Most of my clients only use SQL Server. So migrating to MySQL doesn’t suit me well.
Are there any chance to use SQL Server as Metabase application database instead of H2, MySQL, Postgresql?

#4

@turker.tunali
If your clients run Docker, then you could run Postgres or MariaDB in a container.
I’m not sure if more core-drivers will be supported, but I would guess “no”.
Adding another core-driver would mean that it needs to go through a lot of testing and constant maintenance.