Configuration of Metabase after deploy

Hi awesome community :sunglasses:

I am new here to the community, but have used Render for several projects.

We want to use Metabase and I have used the clear and simple one-click guide here:

However, when I enter the details of my database, it continues to say:

The connection attempt failed.

I have tried both internal and external connection details from my database instance.

Does anybody know how to set it up properly?

Thanks :pray:

Hi,

If your Metabase deployment is in the same account/team and region as the database you’re trying to connect to, you should be able to use the details from the “Internal Database URL”, otherwise you’d need to use the external creds.

The only other Metabase DB setting you may need would be to have “Use a secure connection (SSL)” enabled, with “SSL Mode” set to “require”.

Alan

1 Like

I have tried to fork the render-examples/metabase

Since my instances are located in Frankfurt, I have added that to render.yaml

Both instances spin up as they should, but I receive the following error:

Server unhealthy

Exited with status 1 while running your code. Check your service logs for more information.

The server log complains about not being able to run migrations:

Sep 18 12:44:02 PM  2023-09-18 10:44:02,269 INFO db.liquibase :: Database has unrun migrations. Waiting for migration lock to be cleared...
Sep 18 12:44:04 PM  2023-09-18 10:44:04,343 WARN util.jvm :: auto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51684@3c293d05: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.
Sep 18 12:44:06 PM  2023-09-18 10:44:06,355 WARN util.jvm :: auto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51684@3c293d05: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.
Sep 18 12:44:08 PM  2023-09-18 10:44:08,476 WARN util.jvm :: auto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51684@3c293d05: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.
Sep 18 12:44:10 PM  2023-09-18 10:44:10,488 WARN util.jvm :: auto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51684@3c293d05: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.
Sep 18 12:44:12 PM  2023-09-18 10:44:12,510 WARN util.jvm :: auto-retry metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51684@3c293d05: Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.
Sep 18 12:44:14 PM  2023-09-18 10:44:14,525 ERROR metabase.core :: Metabase Initialization FAILED
Sep 18 12:44:14 PM  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`.
Sep 18 12:44:14 PM      at metabase.db.liquibase$wait_for_migration_lock_to_be_cleared$fn__51684.invoke(liquibase.clj:139)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:176)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invokeStatic(jvm.clj:183)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_auto_retries.invoke(jvm.clj:165)
Sep 18 12:44:14 PM      at metabase.db.liquibase$wait_for_migration_lock_to_be_cleared.invokeStatic(liquibase.clj:134)
Sep 18 12:44:14 PM      at metabase.db.liquibase$wait_for_migration_lock_to_be_cleared.invoke(liquibase.clj:130)
Sep 18 12:44:14 PM      at metabase.db.liquibase$migrate_up_if_needed_BANG_.invokeStatic(liquibase.clj:150)
Sep 18 12:44:14 PM      at metabase.db.liquibase$migrate_up_if_needed_BANG_.invoke(liquibase.clj:144)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__51979$migrate_BANG___51984$fn__51985$fn__51986.invoke(setup.clj:78)
Sep 18 12:44:14 PM      at metabase.db.liquibase$fn__51648$do_with_liquibase__51653$fn__51654.invoke(liquibase.clj:66)
Sep 18 12:44:14 PM      at metabase.db.liquibase$fn__51648$do_with_liquibase__51653.invoke(liquibase.clj:59)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__51979$migrate_BANG___51984$fn__51985.invoke(setup.clj:73)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__51979$migrate_BANG___51984.doInvoke(setup.clj:52)
Sep 18 12:44:14 PM      at clojure.lang.RestFn.invoke(RestFn.java:445)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__52043$run_schema_migrations_BANG___52048$fn__52049.invoke(setup.clj:131)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__52043$run_schema_migrations_BANG___52048.invoke(setup.clj:125)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__52096$setup_db_BANG___52101$fn__52102$fn__52105$fn__52106.invoke(setup.clj:156)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_us_locale.invokeStatic(jvm.clj:239)
Sep 18 12:44:14 PM      at metabase.util.jvm$do_with_us_locale.invoke(jvm.clj:225)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__52096$setup_db_BANG___52101$fn__52102$fn__52105.invoke(setup.clj:152)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__52096$setup_db_BANG___52101$fn__52102.invoke(setup.clj:151)
Sep 18 12:44:14 PM      at metabase.db.setup$fn__52096$setup_db_BANG___52101.invoke(setup.clj:145)
Sep 18 12:44:14 PM      at metabase.db$setup_db_BANG_$fn__52129.invoke(db.clj:69)
Sep 18 12:44:14 PM      at metabase.db$setup_db_BANG_.invokeStatic(db.clj:64)
Sep 18 12:44:14 PM      at metabase.db$setup_db_BANG_.invoke(db.clj:55)
Sep 18 12:44:14 PM      at metabase.core$init_BANG__STAR_.invokeStatic(core.clj:113)
Sep 18 12:44:14 PM      at metabase.core$init_BANG__STAR_.invoke(core.clj:99)
Sep 18 12:44:14 PM      at metabase.core$init_BANG_.invokeStatic(core.clj:159)
Sep 18 12:44:14 PM      at metabase.core$init_BANG_.invoke(core.clj:154)
Sep 18 12:44:14 PM      at metabase.core$start_normally.invokeStatic(core.clj:171)
Sep 18 12:44:14 PM      at metabase.core$start_normally.invoke(core.clj:165)
Sep 18 12:44:14 PM      at metabase.core$_main.invokeStatic(core.clj:204)
Sep 18 12:44:14 PM      at metabase.core$_main.doInvoke(core.clj:198)
Sep 18 12:44:14 PM      at clojure.lang.RestFn.invoke(RestFn.java:397)
Sep 18 12:44:14 PM      at clojure.lang.AFn.applyToHelper(AFn.java:152)
Sep 18 12:44:14 PM      at clojure.lang.RestFn.applyTo(RestFn.java:132)
Sep 18 12:44:14 PM      at clojure.lang.Var.applyTo(Var.java:705)
Sep 18 12:44:14 PM      at clojure.core$apply.invokeStatic(core.clj:667)
Sep 18 12:44:14 PM      at clojure.core$apply.invoke(core.clj:662)
Sep 18 12:44:14 PM      at metabase.bootstrap$_main.invokeStatic(bootstrap.clj:31)
Sep 18 12:44:14 PM      at metabase.bootstrap$_main.doInvoke(bootstrap.clj:28)
Sep 18 12:44:14 PM      at clojure.lang.RestFn.invoke(RestFn.java:397)
Sep 18 12:44:14 PM      at clojure.lang.AFn.applyToHelper(AFn.java:152)
Sep 18 12:44:14 PM      at clojure.lang.RestFn.applyTo(RestFn.java:132)
Sep 18 12:44:14 PM      at metabase.bootstrap.main(Unknown Source)
Sep 18 12:44:14 PM  2023-09-18 10:44:14,531 INFO metabase.core :: Metabase Shutting Down ...
Sep 18 12:44:14 PM  2023-09-18 10:44:14,531 INFO metabase.server :: Shutting Down Embedded Jetty Webserver
Sep 18 12:44:14 PM  2023-09-18 10:44:14,535 INFO metabase.core :: Metabase Shutdown COMPLETE

Any idea on how to solve this?

Thank you for the reply, @al_ps :pray:

My own update crossed your reply.

I am trying to spin up the instances in Frankfurt since my prod DB is there as well, but it seems like there is an issue with the Metabase instance about running migrations.

Odd, I just tried to reproduce the issue by spinning up the example repo in my own account , but I didn’t see any migration issues.

Those logs seem to have a suggested command to run in there:

Database has migration lock; cannot run migrations. You can force-release these locks by running `java -jar metabase.jar migrate release-locks`.

Maybe you could try that in the “Shell” of the Metabase service?

Alan

1 Like

I reproduced the issue a couple of times, but suddenly it worked.

To be honest I am not sure what did the trick, but I managed to successfully deploy with a fork of the official repo, but with changed location to Frankfurt.

Thanks for your replies :pray:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.