Jar initialization failure [SOLVED]

Solution:
Command Prompt>right click>Run as administrator
Mea culpa, I forgot this important starting step!

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

What could be causing this error?

04-29 14:29:44 ←[1mERROR metabase.core←[0m :: Metabase Initialization FAILED
:
:
04-29 14:29:45 ←[1mINFO metabase.core←[0m :: Metabase Shutdown COMPLETE

Neither one of these commands succeed:
c:\Program Files\Metabase>java -jar metabase.jar
c:\Program Files\Metabase>java -jar metabase.jar migrate release-locks

Metabase JAR: v0.31.2
Host: Localhost:3000
Databases: H2 internal default, Server SQL external (joined in)
Browser: Firefox 52.9.0
OS: Microsoft Windows [Version 6.0.6002]
JAVA v1.8.0_191


Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\UserName>cd c:\Program Files\Metabase

c:\Program Files\Metabase>java -jar metabase.jar
04-29 14:29:08 ←[1mINFO metabase.util←[0m :: Loading Metabase…
04-29 14:29:08 ←[1mINFO metabase.util←[0m :: Maximum memory available to JVM: 24
7.5 MB
04-29 14:29:14 ←[1mINFO util.encryption←[0m :: Saved credentials encryption is D
ISABLED for this Metabase instance.
For more information, see https://www.metabase.com/docs/latest/operations-guide
/start.html#encrypting-your-database-connection-details-at-rest
04-29 14:29:40 ←[1mINFO metabase.core←[0m :: Starting Metabase in STANDALONE mod
e
04-29 14:29:40 ←[1mINFO metabase.core←[0m :: Launching Embedded Jetty Webserver
with config:
{:port 3000}

04-29 14:29:41 ←[1mINFO metabase.core←[0m :: Starting Metabase version v0.31.2 (
89c37eb release-0.31.2) …
04-29 14:29:41 ←[1mINFO metabase.core←[0m :: System timezone is ‘America/Los_Ang
eles’ …
WARNING: any? already refers to: #'clojure.core/any? in namespace: monger.collec
tion, being replaced by: #'monger.collection/any?
04-29 14:29:43 ←[1mINFO metabase.core←[0m :: Setting up and migrating Metabase D
B. Please sit tight, this may take a minute…
04-29 14:29:43 ←[1mINFO metabase.db←[0m :: Verifying h2 Database Connection …
04-29 14:29:44 ←[1mINFO metabase.db←[0m :: Verify Database Connection …
04-29 14:29:44 ←[1mINFO metabase.db←[0m :: Running Database Migrations…
04-29 14:29:44 ←[1mINFO metabase.db←[0m :: Setting up Liquibase…
04-29 14:29:44 ←[1mWARN metabase.util←[0m :: auto-retry metabase.db$run_schema_m
igrations_BANG_$fn__6572@f0035a: The database is read only; SQL statement:
UPDATE DATABASECHANGELOG SET FILENAME = ? [90097-197]
04-29 14:29:44 ←[1mINFO metabase.db←[0m :: Setting up Liquibase…
04-29 14:29:44 ←[1mERROR metabase.core←[0m :: Metabase Initialization FAILED
org.h2.jdbc.JdbcBatchUpdateException: The database is read only; SQL statement:
UPDATE DATABASECHANGELOG SET FILENAME = ? [90097-197]
at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.
java:1295)
at clojure.java.jdbc$execute_batch.invokeStatic(jdbc.clj:539)
at clojure.java.jdbc$execute_batch.invoke(jdbc.clj:532)
at clojure.java.jdbc$db_do_execute_prepared_statement$fn__4693.invoke(jd
bc.clj:969)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:790)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:730)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_do_execute_prepared_statement.invokeStatic(jdbc.
clj:968)
at clojure.java.jdbc$db_do_execute_prepared_statement.invoke(jdbc.clj:95
4)
at clojure.java.jdbc$db_do_prepared.invokeStatic(jdbc.clj:992)
at clojure.java.jdbc$db_do_prepared.invoke(jdbc.clj:972)
at clojure.java.jdbc$execute_BANG_$execute_helper__4766.invoke(jdbc.clj:
1386)
at clojure.java.jdbc$execute_BANG_.invokeStatic(jdbc.clj:1388)
at clojure.java.jdbc$execute_BANG_.invoke(jdbc.clj:1359)
at clojure.java.jdbc$execute_BANG_.invokeStatic(jdbc.clj:1378)
at clojure.java.jdbc$execute_BANG_.invoke(jdbc.clj:1359)
at metabase.db$consolidate_liquibase_changesets.invokeStatic(db.clj:257)
at metabase.db$consolidate_liquibase_changesets.invoke(db.clj:240)
at metabase.db$migrate_BANG_$fn__6539.invoke(db.clj:297)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:747)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:782)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:730)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at metabase.db$migrate_BANG_.invokeStatic(db.clj:288)
at metabase.db$migrate_BANG_.invoke(db.clj:269)
at metabase.db$run_schema_migrations_BANG_$fn__6572.invoke(db.clj:447)
at metabase.util$do_with_auto_retries.invokeStatic(util.clj:420)
at metabase.util$do_with_auto_retries.invoke(util.clj:412)
at metabase.util$do_with_auto_retries.invokeStatic(util.clj:424)
at metabase.util$do_with_auto_retries.invoke(util.clj:412)
at metabase.db$run_schema_migrations_BANG_.invokeStatic(db.clj:446)
at metabase.db$run_schema_migrations_BANG_.invoke(db.clj:429)
at metabase.db$setup_db_BANG_.invokeStatic(db.clj:465)
at metabase.db$setup_db_BANG_.doInvoke(db.clj:458)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at metabase.core$init_BANG_.invokeStatic(core.clj:162)
at metabase.core$init_BANG_.invoke(core.clj:139)
at metabase.core$start_normally.invokeStatic(core.clj:246)
at metabase.core$start_normally.invoke(core.clj:240)
at metabase.core$main.invokeStatic(core.clj:266)
at metabase.core$main.doInvoke(core.clj:261)
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)
org.h2.jdbc.JdbcSQLException: The database is read only; SQL statement:
UPDATE DATABASECHANGELOG SET FILENAME = ? [90097-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.engine.Database.checkWritingAllowed(Database.java:1989)
at org.h2.table.Table.checkWritingAllowed(Table.java:1201)
at org.h2.engine.User.hasRight(User.java:114)
at org.h2.engine.User.checkRight(User.java:100)
at org.h2.command.dml.Update.update(Update.java:97)
at org.h2.command.CommandContainer.update(CommandContainer.java:102)
at org.h2.command.Command.executeUpdate(Command.java:261)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedS
tatement.java:199)
at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.
java:1277)
at clojure.java.jdbc$execute_batch.invokeStatic(jdbc.clj:539)
at clojure.java.jdbc$execute_batch.invoke(jdbc.clj:532)
at clojure.java.jdbc$db_do_execute_prepared_statement$fn__4693.invoke(jd
bc.clj:969)
at clojure.java.jdbc$db_transaction_STAR
.invokeStatic(jdbc.clj:790)
at clojure.java.jdbc$db_transaction_STAR
.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:730)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_do_execute_prepared_statement.invokeStatic(jdbc.
clj:968)
at clojure.java.jdbc$db_do_execute_prepared_statement.invoke(jdbc.clj:95
4)
at clojure.java.jdbc$db_do_prepared.invokeStatic(jdbc.clj:992)
at clojure.java.jdbc$db_do_prepared.invoke(jdbc.clj:972)
at clojure.java.jdbc$execute_BANG_$execute_helper__4766.invoke(jdbc.clj:
1386)
at clojure.java.jdbc$execute_BANG_.invokeStatic(jdbc.clj:1388)
at clojure.java.jdbc$execute_BANG_.invoke(jdbc.clj:1359)
at clojure.java.jdbc$execute_BANG_.invokeStatic(jdbc.clj:1378)
at clojure.java.jdbc$execute_BANG_.invoke(jdbc.clj:1359)
at metabase.db$consolidate_liquibase_changesets.invokeStatic(db.clj:257)
at metabase.db$consolidate_liquibase_changesets.invoke(db.clj:240)
at metabase.db$migrate_BANG_$fn__6539.invoke(db.clj:297)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:747)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:782)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:730)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:717)
at metabase.db$migrate_BANG_.invokeStatic(db.clj:288)
at metabase.db$migrate_BANG_.invoke(db.clj:269)
at metabase.db$run_schema_migrations_BANG_$fn__6572.invoke(db.clj:447)
at metabase.util$do_with_auto_retries.invokeStatic(util.clj:420)
at metabase.util$do_with_auto_retries.invoke(util.clj:412)
at metabase.util$do_with_auto_retries.invokeStatic(util.clj:424)
at metabase.util$do_with_auto_retries.invoke(util.clj:412)
at metabase.db$run_schema_migrations_BANG_.invokeStatic(db.clj:446)
at metabase.db$run_schema_migrations_BANG_.invoke(db.clj:429)
at metabase.db$setup_db_BANG_.invokeStatic(db.clj:465)
at metabase.db$setup_db_BANG_.doInvoke(db.clj:458)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at metabase.core$init_BANG_.invokeStatic(core.clj:162)
at metabase.core$init_BANG_.invoke(core.clj:139)
at metabase.core$start_normally.invokeStatic(core.clj:246)
at metabase.core$start_normally.invoke(core.clj:240)
at metabase.core$_main.invokeStatic(core.clj:266)
at metabase.core$_main.doInvoke(core.clj:261)
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)
04-29 14:29:45 ←[1mINFO metabase.core←[0m :: Metabase Shutting Down …
04-29 14:29:45 ←[1mINFO metabase.core←[0m :: Metabase Shutdown COMPLETE

c:\Program Files\Metabase>

Hi @mesquest
Which version of Java are you using?
You’re not upgrading version or migrating H2, right?
What I noticed is The database is read only, which I would expect if another process is locking it, or if there’s not enough permissions.
Isn’t there some issues with running Metabase from %ProgramFiles% and also having the H2 database located there? I think you need to put data anywhere else, like %ProgramData% if shared or %AppData% if only available for that user.
But migrating to a different backend than H2 would be recommended.

Thanks @flamber! You’re a peach! Having you on-board this forum has really made a huge difference!

1 Like

@mesquest

I’ve been through the same problem and your solution helped me a lot.

Thanks :grinning: