#Metabase deploys fail for no reason

70 messages · Page 1 of 1 (latest)

untold escarp
#

Greetings, I'm trying to deploy a metabase and it keeps failing for no reason. To test, I used your official integration (https://railway.com/deploy/metabase) and it also failed. What can I do?

Env example:

ENABLE_ALPINE_PRIVATE_NETWORKING="true"

MB_DB_DBNAME="${{Postgres.PGDATABASE}}"

MB_DB_HOST="${{Postgres.PGHOST}}"

MB_DB_PASS="${{Postgres.PGPASSWORD}}"

MB_DB_PORT="${{Postgres.PGPORT}}"

MB_DB_TYPE="postgres"

MB_DB_USER="${{Postgres.PGUSER}}"

MB_PASSWORD_COMPLEXITY="strong"

MB_SITE_URL="https://${{RAILWAY_PUBLIC_DOMAIN}}"

PORT="3000"

Railway

Fast analytics and integrated tooling for companies exploring their data

tiny pikeBOT
#

Project ID: N/A

untold escarp
#

359c609d-ccdf-4c40-9d4b-6f826fd77509

small dagger
#

What error are you getting?

untold escarp
#

In the deploy console it doesn't show me any errors, in the build console it shows me the error that occurred to you, and if I go to the general console of the entire project it says this:

small dagger
#

Seems like the healthcheck endpoint is failing, not the service itself

untold escarp
#

2025-06-12 16:12:06.008 UTC [30702] LOG: could not receive data from client: Connection reset by peer
2025-06-12 16:12:06.008 UTC [30699] LOG: could not receive data from client: Connection reset by peer
2025-06-12 16:12:06.008 UTC [30701] LOG: could not receive data from client: Connection reset by peer
2025-06-12 16:12:06.008 UTC [30700] LOG: could not receive data from client: Connection reset by peer
Warning: environ value jdk-21.0.7+6 for key :java-version has been overwritten with 21.0.7
2025-06-12 16:12:14,577 INFO metabase.util :: Maximum memory available to JVM: 29.5 GB
2025-06-12 16:12:18,827 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. 🔓
For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2025-06-12 16:12:30.989 UTC [30709] LOG: could not receive data from client: Connection reset by peer
2025-06-12 16:12:30.989 UTC [30707] LOG: could not receive data from client: Connection reset by peer
2025-06-12 16:12:30.989 UTC [30708] LOG: could not receive data from client: Connection reset by peer
2025-06-12 16:12:30.989 UTC [30706] LOG: could not receive data from client: Connection reset by peer
2025-06-12 16:13:21.673 UTC [74] LOG: checkpoint starting: time
2025-06-12 16:13:24.526 UTC [74] LOG: checkpoint complete: wrote 29 buffers (0.2%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.810 s, sync=0.008 s, total=2.854 s; sync files=23, longest=0.006 s, average=0.001 s; distance=128 kB, estimate=169 kB; lsn=0/1AD2180, redo lsn=0/1AD2148

#

Correct, I tried using the railway official, and displaying it exactly the same also gives the same error

small dagger
#

Im not at home rn, will try to see if I can reproduce it when possible

untold escarp
#

OK, thanks a lot!

untold escarp
#

Will it affect my trial plan? I'll upgrade to the hobby plan to see if the increased capacity stops the error

small dagger
#

Oh, then it's probably the trial resource limits like the 500mb

untold escarp
#

Ohhh, a thousand apologies, I'm going to try the hobby plan and I'll let you know if it's fixed.

small dagger
#

@untold escarp Deployed an instance and it also gave health check endpoint errors

#

While the metabase service initializes tables the healthcheck endpoint triggers multiple times and fails

#

But after some minutes it finished migrating tables and the next healthcheck endpoint was fine

#

What I would do: remove the healthcheck endpoint for the first start, let metabase run and migrate tables and then re-add the healthcheck endpoint

#

Can you test that please?

untold escarp
#

Ok, I'll try it.

small dagger
#

You can find the healthcheck endpoint on the bottom of the service settings

untold escarp
#

Yes, I already removed it, although I already have the tables created in Postgres, it is deploying healthcheck at this time.

#

The deploy has not failed yet but the general log is like this

small dagger
#

Did metabase deploy successfully?

small dagger
untold escarp
#

Start but then crash

#

Now I will start with healthcheck

#

With heathcheck '/api/health'

small dagger
#

Can you test one last thing?
Remove all metabase related services (metabase, postgres and volumes)
Right click the empty canvas -> templates -> search for metabase

It will show the services it will deploy, remove the endpoint from there then confirm the deploy of the template

untold escarp
#

Ok ok, shouldn't the metabase database be the same as my project's?

#

I'm going to try this implementation that you indicated.

small dagger
small dagger
untold escarp
#

I already did it, it's deploying

#

And is it advisable to separate the database from my project's metabase? I create many tables in my app's database.

#

Discord won't let me upload images, but the deploy failed again.

#

I already bought the hobby plan just in case.

#

====================

Starting Healthcheck

====================

Path: /api/health

Retry window: 5m0s

Attempt #1 failed with service unavailable. Continuing to retry for 4m49s

Attempt #2 failed with service unavailable. Continuing to retry for 4m38s

Attempt #3 failed with service unavailable. Continuing to retry for 4m26s

Attempt #4 failed with service unavailable. Continuing to retry for 4m12s

Attempt #5 failed with service unavailable. Continuing to retry for 3m54s

Attempt #6 failed with status 503: {"status":"initializing","progress":0.2}. Continuing to retry for 3m36s

Attempt #7 failed with service unavailable. Continuing to retry for 2m56s

Attempt #8 failed with service unavailable. Continuing to retry for 2m15s

Attempt #9 failed with service unavailable. Continuing to retry for 1m35s

Attempt #10 failed with service unavailable. Continuing to retry for 55s

Attempt #11 failed with service unavailable. Continuing to retry for 17s

1/1 replicas never became healthy!

Healthcheck failed!

small dagger
#

Remove the Healthcheck path from your service settings

untold escarp
small dagger
#

In the metabase settings

#

I swear I can't reproduce this error of yours lol

#

It's probably related to the already in use db

untold escarp
#

Done, without checkhealth it worked and the page appeared

small dagger
#

Now try readding the healthcheck

untold escarp
#

Redeploy?

small dagger
#

Since it supposedly did all the needed migrations

small dagger
untold escarp
#

ok ok

small dagger
#

healthchecks are important!

untold escarp
#

Yes, it is already redeploying.

#

Its work!

#

====================

Starting Healthcheck

====================

Path: /api/health

Retry window: 5m0s

Attempt #1 failed with service unavailable. Continuing to retry for 4m49s

Attempt #2 failed with status 503: {"status":"initializing","progress":0.2}. Continuing to retry for 4m43s

Attempt #3 failed with status 503: {"status":"initializing","progress":0.3}. Continuing to retry for 4m41s

[1/1] Healthcheck succeeded!

small dagger
#

Cool! seems like we fixed it

untold escarp
#

Thanks a lot, I was having a hard time fixing it hahaha

small dagger
#

What probably happened was that Metabase was taking some extra time migrating the DB that was already in use, it took longer than the healthcheck timespan so it crashed

untold escarp
#

Yeah, that's why I was canceling the connections to Postgres too.

small dagger
#

Since it's fixed, can I mark this thread as solved?

untold escarp
#

Yes, thank you very much, my friend!

small dagger
#

!s