Health checks failing (service is perfectly healthy)
reece
PROOP

7 months ago

While running a Ruby on Rails app, health checks seem to fail despite the fact the server is listening. However, if I remove the health check, and fetch the route myself, it works just fine.

Awaiting User Response

48 Replies

reece
PROOP

7 months ago

cfe555eb-4fc0-417e-b1fe-88b5516418dd


reece
PROOP

7 months ago

hmm, seems to have something to do with the predeploy command - is it trying to healthcheck the pre-deploy script? that doesn't make much sense if so


reece
PROOP

7 months ago

ok nope it's actually not


reece
PROOP

7 months ago

yeah it's literally just seeming like health checks are not working at all?


reece
PROOP

7 months ago

Health checks failing (service is perfectly healthy)


6 months ago

That is odd, we haven't seen any other reports of this, do you have an MRE we could look into?


reece
PROOP

6 months ago

I can try to make one


6 months ago

much appreciated


reece
PROOP

6 months ago

any chance that health checks can be extended to say the actual message that the request failed with?


6 months ago

They already do. The body will be printed out if the application responds, but that isn't even happening here, so there's no message available.


reece
PROOP

6 months ago

same meme, is there any documentation for what exactly the health check is doing (curl command? some process on the machine doing a fetch?)


6 months ago

just an http request to the path set


reece
PROOP

6 months ago

where is it done from? what http client?


reece
PROOP

6 months ago

i'm just trying to figure out what exactly is happening so I can get a better idea of why this could be happening


6 months ago

It would be done from the stacker with go's stdlib http client


reece
PROOP

6 months ago

side note: railpack really needs to start using precompiled ruby versions instead of building them from source. 2 minutes is crazy

1408137995906846700


6 months ago

Railpack is OSS 😉


reece
PROOP

6 months ago

i know, just shouting into the air


reece
PROOP

6 months ago

i shall do it some day


6 months ago

Can you open an issue on the Railpack GitHub? we have someone staffed to tackle them.


reece
PROOP

6 months ago

okay i've got a MRE


reece
PROOP

6 months ago


reece
PROOP

6 months ago

literally just ran rails@7 bootstrap


reece
PROOP

6 months ago

here's a real world example @ project a8763251-12dc-4d8d-a29d-4849bca82e4b


reece
PROOP

6 months ago

I made this project just for this so y'all have my full permission to do whatever to it


reece
PROOP

6 months ago

1408139041525993500


reece
PROOP

6 months ago

version without healthchecks is perfectly fine



reece
PROOP

6 months ago

version with healthchecks fails


reece
PROOP

6 months ago

puma says it's listening so I have no reason to doubt that's the case


reece
PROOP

6 months ago

but yeah you can either use that project, or use the zip + add RAILS_ENV=production and SECRET_KEY_BASE=literallywhatever and that's enough to repro the issue


6 months ago

can you make the repo public?


reece
PROOP

6 months ago

yeah one sec


reece
PROOP

6 months ago

Done


reece
PROOP

6 months ago

I also added you as a collab in case you wanna try committing or anything


reece
PROOP

6 months ago

The only reason i said this is because right now it doesn't say what happened at all. I.e. "service unavailable" doesn't tell me if the request got to the server and timed out, or if it couldn't establish a connection, or if the connection was refused, so on


reece
PROOP

6 months ago

My original hypothesis was that the DNS rebinding protection built into rails was kicking in and not allowing it with no host header, but if the application can't be reached at all, i don't think that is the case


Railway
BOT

6 months ago

Hello!

We're acknowledging your issue and attaching a ticket to this thread.

We don't have an ETA for it, but, our engineering team will take a look and you will be updated as we update the ticket.

Please reply to this thread if you have any questions!


6 months ago

I can reproduce the issue, but the root cause isn't clear to me at this time. You're the first user to report this specific health check problem - we haven't seen other reports of this type of failure beyond some configuration misunderstandings.

I've created a ticket to track this and will add any similar reports we receive. Once we have a few more reports to help identify patterns, we'll be able to investigate more thoroughly.


reece
PROOP

6 months ago

Update: on puma it doesn't respond, but on Unicorn it 301's


reece
PROOP

6 months ago

1413534050190233600


reece
PROOP

6 months ago

would you be able to check if the raw Go HTTP request is setting any of the following headers (and if so, to which values?)

Location
X-Forwarded-For
Host


6 months ago

These are the only headers that are set -

{
  "Accept-Encoding": [
    "gzip"
  ],
  "Connection": [
    "close"
  ],
  "User-Agent": [
    "RailwayHealthCheck/1.0"
  ]
}

reece
PROOP

6 months ago

hmm interesting. I think what might be happening is that Rack sees that no intended host is set and is trying to redirect to https://xyz.up.railway.app/up


reece
PROOP

6 months ago

I managed to come up with a Caddy setup that mitigates the problem, but still feels less than ideal


mattpatterson94
FREE

5 months ago

I had this same issue. I managed to fix it by disabling ssl redirects for the /up endpoint


reece
PROOP

5 months ago

This should he documented by Railway as a known platform bug


Railway
BOT

a month ago

🛠️ The ticket Deployment health check improvements has been marked as todo.


Railway
BOT

11 days ago

Hello!

We've escalated your issue to our engineering team.

We aim to provide an update within 1 business day.

Please reply to this thread if you have any questions!

Status changed to Awaiting User Response Railway 11 days ago


Loading...