Metabase deploys fail for no reason

sieteicFREE

6 days 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

0 Replies

sieteicFREE

6 days ago

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


6 days ago

What error are you getting?


sieteicFREE

6 days ago

Hi!

1382765068000690200


sieteicFREE

6 days ago

1382765133457129700


sieteicFREE

6 days ago

1382765194715074800


sieteicFREE

6 days 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:


6 days ago

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


sieteicFREE

6 days 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


sieteicFREE

6 days ago

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



6 days ago

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


sieteicFREE

6 days ago

OK, thanks a lot!


sieteicFREE

5 days ago

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


5 days ago

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


sieteicFREE

5 days ago

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


5 days ago

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


5 days ago

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


5 days ago

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


5 days 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


5 days ago

Can you test that please?


sieteicFREE

5 days ago

Ok, I'll try it.


5 days ago

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


sieteicFREE

5 days ago

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


sieteicFREE

5 days ago

1382775242451193900


sieteicFREE

5 days ago

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


5 days ago

Did metabase deploy successfully?


5 days ago

Those errors from postgres are from unclosed connections


sieteicFREE

5 days ago

1382775797672185900


sieteicFREE

5 days ago

Start but then crash


sieteicFREE

5 days ago

Now I will start with healthcheck


sieteicFREE

5 days ago

With heathcheck '/api/health'

1382777637243719700


sieteicFREE

5 days ago

1382777735734100000


sieteicFREE

5 days ago

1382777823810556000


5 days 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


sieteicFREE

5 days ago

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


sieteicFREE

5 days ago

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


5 days ago

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


5 days ago

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


5 days ago

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


sieteicFREE

5 days ago

I already did it, it's deploying


sieteicFREE

5 days ago

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


sieteicFREE

5 days ago

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


sieteicFREE

5 days ago

I already bought the hobby plan just in case.


sieteicFREE

5 days 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!


5 days ago

This is with the healthcheck path


5 days ago

Remove the Healthcheck path from your service settings


sieteicFREE

5 days ago

Yes, that's how it comes in the template


sieteicFREE

5 days ago

Ok


5 days ago

In the metabase settings


5 days ago

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


5 days ago

1382782314454581200


5 days ago

It's probably related to the already in use db


sieteicFREE

5 days ago

Done, without checkhealth it worked and the page appeared

1382782531727917000


5 days ago

Now try readding the healthcheck


sieteicFREE

5 days ago

Redeploy?


5 days ago

Since it supposedly did all the needed migrations


5 days ago

yeah


sieteicFREE

5 days ago

ok ok


5 days ago

healthchecks are important!


sieteicFREE

5 days ago

Yes, it is already redeploying.


sieteicFREE

5 days ago

Its work!


sieteicFREE

5 days 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!


5 days ago

Cool! seems like we fixed it


sieteicFREE

5 days ago

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


5 days 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


sieteicFREE

5 days ago

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


5 days ago

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


sieteicFREE

5 days ago

Yes, thank you very much, my friend!


5 days ago

!s


Status changed to Solved medim 5 days ago