Metabase deploys fail for no reason
sieteic
HOBBYOP

8 months ago

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:

ENABLEALPINEPRIVATE_NETWORKING="true"

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

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

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

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

MBDBTYPE="postgres"

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

MBPASSWORDCOMPLEXITY="strong"

MBSITEURL="https://${{RAILWAYPUBLICDOMAIN}}"

PORT="3000"

Solved

69 Replies

sieteic
HOBBYOP

8 months ago

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


medim
MODERATOR

8 months ago

What error are you getting?


sieteic
HOBBYOP

8 months ago

Hi!

1382765068000690200


sieteic
HOBBYOP

8 months ago

1382765133457129700


sieteic
HOBBYOP

8 months ago

1382765194715074800


sieteic
HOBBYOP

8 months ago

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:


medim
MODERATOR

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


sieteic
HOBBYOP

8 months ago


medim
MODERATOR

8 months ago

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


sieteic
HOBBYOP

8 months ago

OK, thanks a lot!


sieteic
HOBBYOP

8 months ago

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


medim
MODERATOR

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


medim
MODERATOR

8 months ago

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


medim
MODERATOR

8 months ago

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


medim
MODERATOR

8 months ago

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


medim
MODERATOR

8 months ago

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


medim
MODERATOR

8 months ago

Can you test that please?


sieteic
HOBBYOP

8 months ago

Ok, I'll try it.


medim
MODERATOR

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


sieteic
HOBBYOP

8 months ago

1382775242451193900


sieteic
HOBBYOP

8 months ago

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


medim
MODERATOR

8 months ago

Did metabase deploy successfully?


medim
MODERATOR

8 months ago

Those errors from postgres are from unclosed connections


sieteic
HOBBYOP

8 months ago

1382775797672185900


sieteic
HOBBYOP

8 months ago

Start but then crash


sieteic
HOBBYOP

8 months ago

Now I will start with healthcheck


sieteic
HOBBYOP

8 months ago

With heathcheck '/api/health'

1382777637243719700


sieteic
HOBBYOP

8 months ago

1382777735734100000


sieteic
HOBBYOP

8 months ago

1382777823810556000


medim
MODERATOR

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


medim
MODERATOR

8 months ago

correcting myself here: trial limits have been bumped to 1gb so I don't think resources are the issue here.


medim
MODERATOR

8 months ago

it depends on the project, if you use the same db then yes


medim
MODERATOR

8 months ago

I wonder if we can deploy the Metabase template, let it run then switch the db with your db


sieteic
HOBBYOP

8 months ago

I already did it, it's deploying


sieteic
HOBBYOP

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


sieteic
HOBBYOP

8 months ago

I already bought the hobby plan just in case.


sieteic
HOBBYOP

8 months ago

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

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!


medim
MODERATOR

8 months ago

This is with the healthcheck path


medim
MODERATOR

8 months ago

Remove the Healthcheck path from your service settings


sieteic
HOBBYOP

8 months ago

Yes, that's how it comes in the template


sieteic
HOBBYOP

8 months ago

Ok


medim
MODERATOR

8 months ago

In the metabase settings


medim
MODERATOR

8 months ago

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


medim
MODERATOR

8 months ago

1382782314454581200


medim
MODERATOR

8 months ago

It's probably related to the already in use db


sieteic
HOBBYOP

8 months ago

Done, without checkhealth it worked and the page appeared

1382782531727917000


medim
MODERATOR

8 months ago

Now try readding the healthcheck


sieteic
HOBBYOP

8 months ago

Redeploy?


medim
MODERATOR

8 months ago

Since it supposedly did all the needed migrations


medim
MODERATOR

8 months ago

yeah


sieteic
HOBBYOP

8 months ago

ok ok


medim
MODERATOR

8 months ago

healthchecks are important!


sieteic
HOBBYOP

8 months ago

Yes, it is already redeploying.


sieteic
HOBBYOP

8 months ago

Its work!


sieteic
HOBBYOP

8 months ago

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

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!


medim
MODERATOR

8 months ago

Cool! seems like we fixed it


sieteic
HOBBYOP

8 months ago

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


medim
MODERATOR

8 months ago

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


sieteic
HOBBYOP

8 months ago

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


medim
MODERATOR

8 months ago

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


sieteic
HOBBYOP

8 months ago

Yes, thank you very much, my friend!


medim
MODERATOR

8 months ago

!s


Status changed to Solved medim 8 months ago


Loading...