Continuing the discussion from Support for Heroku:
Hi! We have metabase running on a heroku app that uses the old buildpacks. I am trying to upgrade to the docker configuration, so I can update metabase, so I can move to metabase cloud (version is too old to move to metabase cloud right now). Here's the steps I am taking:
- clone down the heroku app (I don't have access to any github repo associated with the app):
heroku git:clone -a {my app}
. The app is a fork / copy of GitHub - metabase/metabase-deploy: Metabase binary deployment - I added the Dockerfile and docker-entrypoint.sh as specified in related threads (they were not part of the repo before)
- Ran
heroku container:push web -a your-heroku-app
and thenheroku container:release web -a your-heroku-app
- The app crashes:
Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.e[0m
2023-09-06T21:58:01.471773+00:00 app[web.1]: 2023-09-06 21:58:01,471 WARN util.jvm :: e[31mauto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51743@7170302a: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.e[0m
2023-09-06T21:58:03.502265+00:00 app[web.1]: 2023-09-06 21:58:03,502 WARN util.jvm :: e[31mauto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51743@7170302a: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.e[0m
2023-09-06T21:58:05.535435+00:00 app[web.1]: 2023-09-06 21:58:05,535 WARN util.jvm :: e[31mauto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51743@7170302a: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.e[0m
2023-09-06T21:58:07.595756+00:00 app[web.1]: 2023-09-06 21:58:07,578 ERROR metabase.core :: Metabase Initialization FAILED
2023-09-06T21:58:07.595777+00:00 app[web.1]: liquibase.exception.LockException: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.
2023-09-06T21:58:07.595778+00:00 app[web.1]: at metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51743.invoke(liquibase.clj:139)
2023-09-06T21:58:07.595778+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:176)
2023-09-06T21:58:07.595779+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
2023-09-06T21:58:07.595779+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
2023-09-06T21:58:07.595779+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
2023-09-06T21:58:07.595780+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
2023-09-06T21:58:07.595780+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
2023-09-06T21:58:07.595780+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
2023-09-06T21:58:07.595781+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
2023-09-06T21:58:07.595781+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
2023-09-06T21:58:07.595781+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
2023-09-06T21:58:07.595782+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
2023-09-06T21:58:07.595782+00:00 app[web.1]: at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
2023-09-06T21:58:07.595782+00:00 app[web.1]: at metabase.db.liquibase$wait_for_migration_lock_to_be_cleared.invokeStatic(liquibase.clj:134)
2023-09-06T21:58:07.595783+00:00 app[web.1]: at metabase.db.liquibase$wait_for_migration_lock_to_be_cleared.invoke(liquibase.clj:130)
2023-09-06T21:58:07.595783+00:00 app[web.1]: at metabase.db.liquibase$migrate_up_if_needed_BANG_.invokeStatic(liquibase.clj:150)
2023-09-06T21:58:07.595783+00:00 app[web.1]: at metabase.db.liquibase$migrate_up_if_needed_BANG_.invoke(liquibase.clj:144)
2023-09-06T21:58:07.595784+00:00 app[web.1]: at metabase.db.setup$fn__52038$migrate_BANG___52043$fn__52044$fn__52045.invoke(setup.clj:78)
2023-09-06T21:58:07.595784+00:00 app[web.1]: at metabase.db.liquibase$fn__51707$do_with_liquibase__51712$fn__51713.invoke(liquibase.clj:66)
2023-09-06T21:58:07.595784+00:00 app[web.1]: at metabase.db.liquibase$fn__51707$do_with_liquibase__51712.invoke(liquibase.clj:59)
2023-09-06T21:58:07.595784+00:00 app[web.1]: at metabase.db.setup$fn__52038$migrate_BANG___52043$fn__52044.invoke(setup.clj:73)
2023-09-06T21:58:07.595785+00:00 app[web.1]: at metabase.db.setup$fn__52038$migrate_BANG___52043.doInvoke(setup.clj:52)
2023-09-06T21:58:07.595785+00:00 app[web.1]: at clojure.lang.RestFn.invoke(RestFn.java:445)
2023-09-06T21:58:07.595785+00:00 app[web.1]: at metabase.db.setup$fn__52102$run_schema_migrations_BANG___52107$fn__52108.invoke(setup.clj:131)
2023-09-06T21:58:07.595786+00:00 app[web.1]: at metabase.db.setup$fn__52102$run_schema_migrations_BANG___52107.invoke(setup.clj:125)
2023-09-06T21:58:07.595786+00:00 app[web.1]: at metabase.db.setup$fn__52155$setup_db_BANG___52160$fn__52161$fn__52164$fn__52165.invoke(setup.clj:156)
2023-09-06T21:58:07.595786+00:00 app[web.1]: at metabase.util.jvm$do_with_us_locale.invokeStatic(jvm.clj:239)
2023-09-06T21:58:07.595786+00:00 app[web.1]: at metabase.util.jvm$do_with_us_locale.invoke(jvm.clj:225)
2023-09-06T21:58:07.595787+00:00 app[web.1]: at metabase.db.setup$fn__52155$setup_db_BANG___52160$fn__52161$fn__52164.invoke(setup.clj:152)
2023-09-06T21:58:07.595787+00:00 app[web.1]: at metabase.db.setup$fn__52155$setup_db_BANG___52160$fn__52161.invoke(setup.clj:151)
2023-09-06T21:58:07.595787+00:00 app[web.1]: at metabase.db.setup$fn__52155$setup_db_BANG___52160.invoke(setup.clj:145)
2023-09-06T21:58:07.595787+00:00 app[web.1]: at metabase.db$setup_db_BANG_$fn__52188.invoke(db.clj:66)
2023-09-06T21:58:07.595787+00:00 app[web.1]: at metabase.db$setup_db_BANG_.invokeStatic(db.clj:61)
2023-09-06T21:58:07.595787+00:00 app[web.1]: at metabase.db$setup_db_BANG_.invoke(db.clj:52)
2023-09-06T21:58:07.595788+00:00 app[web.1]: at metabase.core$init_BANG__STAR_.invokeStatic(core.clj:113)
2023-09-06T21:58:07.595788+00:00 app[web.1]: at metabase.core$init_BANG__STAR_.invoke(core.clj:99)
2023-09-06T21:58:07.595788+00:00 app[web.1]: at metabase.core$init_BANG_.invokeStatic(core.clj:159)
2023-09-06T21:58:07.595788+00:00 app[web.1]: at metabase.core$init_BANG_.invoke(core.clj:154)
2023-09-06T21:58:07.595788+00:00 app[web.1]: at metabase.core$start_normally.invokeStatic(core.clj:171)
2023-09-06T21:58:07.595788+00:00 app[web.1]: at metabase.core$start_normally.invoke(core.clj:165)
2023-09-06T21:58:07.595789+00:00 app[web.1]: at metabase.core$_main.invokeStatic(core.clj:204)
2023-09-06T21:58:07.595789+00:00 app[web.1]: at metabase.core$_main.doInvoke(core.clj:198)
2023-09-06T21:58:07.595789+00:00 app[web.1]: at clojure.lang.RestFn.invoke(RestFn.java:397)
2023-09-06T21:58:07.595790+00:00 app[web.1]: at clojure.lang.AFn.applyToHelper(AFn.java:152)
2023-09-06T21:58:07.595790+00:00 app[web.1]: at clojure.lang.RestFn.applyTo(RestFn.java:132)
2023-09-06T21:58:07.595790+00:00 app[web.1]: at clojure.lang.Var.applyTo(Var.java:705)
2023-09-06T21:58:07.595790+00:00 app[web.1]: at clojure.core$apply.invokeStatic(core.clj:667)
2023-09-06T21:58:07.595790+00:00 app[web.1]: at clojure.core$apply.invoke(core.clj:662)
2023-09-06T21:58:07.595791+00:00 app[web.1]: at metabase.bootstrap$_main.invokeStatic(bootstrap.clj:31)
2023-09-06T21:58:07.595791+00:00 app[web.1]: at metabase.bootstrap$_main.doInvoke(bootstrap.clj:28)
2023-09-06T21:58:07.595791+00:00 app[web.1]: at clojure.lang.RestFn.invoke(RestFn.java:397)
2023-09-06T21:58:07.595791+00:00 app[web.1]: at clojure.lang.AFn.applyToHelper(AFn.java:152)
2023-09-06T21:58:07.595791+00:00 app[web.1]: at clojure.lang.RestFn.applyTo(RestFn.java:132)
2023-09-06T21:58:07.595791+00:00 app[web.1]: at metabase.bootstrap.main(Unknown Source)
2023-09-06T21:58:07.607291+00:00 app[web.1]: 2023-09-06 21:58:07,604 INFO metabase.core :: Metabase Shutting Down ...
2023-09-06T21:58:07.609298+00:00 app[web.1]: 2023-09-06 21:58:07,609 INFO metabase.server :: Shutting Down Embedded Jetty Webserver
2023-09-06T21:58:07.625021+00:00 app[web.1]: 2023-09-06 21:58:07,624 INFO metabase.core :: Metabase Shutdown COMPLETE
2023-09-06T21:58:08.212454+00:00 heroku[web.1]: Process exited with status 1
2023-09-06T21:58:08.248158+00:00 heroku[web.1]: State changed from up to crashed
What am I missing?
my docker-entrypoint.sh:
#!/usr/bin/env bash
if [ "$PORT" ]; then
export MB_JETTY_PORT="$PORT"
fi
if [ "$DATABASE_URL" ]; then
export MB_DB_CONNECTION_URI="$DATABASE_URL"
fi
/app/run_metabase.sh
my Dockerfile:
FROM metabase/metabase:latest
COPY docker-entrypoint.sh /app/
RUN ["chmod", "+x", "/app/docker-entrypoint.sh"]
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]