6 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.
48 Replies
6 months ago
cfe555eb-4fc0-417e-b1fe-88b5516418dd
6 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
6 months ago
ok nope it's actually not
6 months ago
yeah it's literally just seeming like health checks are not working at all?
6 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?
6 months ago
I can try to make one
6 months ago
much appreciated
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.
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
6 months ago
where is it done from? what http client?
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
6 months ago
side note: railpack really needs to start using precompiled ruby versions instead of building them from source. 2 minutes is crazy

6 months ago
Railpack is OSS 😉
6 months ago
i know, just shouting into the air
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.
6 months ago
okay i've got a MRE
6 months ago
6 months ago
literally just ran rails@7 bootstrap
6 months ago
here's a real world example @ project a8763251-12dc-4d8d-a29d-4849bca82e4b
6 months ago
I made this project just for this so y'all have my full permission to do whatever to it
6 months ago

6 months ago
version without healthchecks is perfectly fine
6 months ago
version with healthchecks fails
6 months ago
puma says it's listening so I have no reason to doubt that's the case
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?
6 months ago
yeah one sec
6 months ago
Done
6 months ago
I also added you as a collab in case you wanna try committing or anything
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
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
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.
5 months ago
Update: on puma it doesn't respond, but on Unicorn it 301's
5 months ago

5 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?)
LocationX-Forwarded-ForHost
5 months ago
These are the only headers that are set -
{
"Accept-Encoding": [
"gzip"
],
"Connection": [
"close"
],
"User-Agent": [
"RailwayHealthCheck/1.0"
]
}5 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](https://xyz.up.railway.app/up)
5 months ago
I managed to come up with a Caddy setup that mitigates the problem, but still feels less than ideal
I had this same issue. I managed to fix it by disabling ssl redirects for the /up endpoint
4 months ago
This should he documented by Railway as a known platform bug
17 days ago
🛠️ The ticket Deployment health check improvements has been marked as todo.