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.
48 Replies
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
That is odd, we haven't seen any other reports of this, do you have an MRE we could look into?
6 months ago
much appreciated
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.
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
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
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
Can you open an issue on the Railpack GitHub? we have someone staffed to tackle them.
I made this project just for this so y'all have my full permission to do whatever to it
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?
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
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.
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
6 months ago
These are the only headers that are set -
{
"Accept-Encoding": [
"gzip"
],
"Connection": [
"close"
],
"User-Agent": [
"RailwayHealthCheck/1.0"
]
}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
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
a month ago
🛠️ The ticket Deployment health check improvements has been marked as todo.
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

