New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passenger hangs on spawning (Ubuntu 18.04 Rails 5.2.2 Passenger 6.0.1) #2181
Comments
Have the same issue. Passenger just got updated on a production box, and the whole thing went down. Ubuntu 16.04, nginx/passenger for passenger repo in my case. Downgraded to 6.0.0 for the time being, which works. |
So, I'm not seeing this on my end. Can either (or both) of you try sending a |
Hi, Can't get it to output anything meaningful (or anything at all, really, sending it SIGQUIT). It just terminates without logging. If I let it time out, it will stop at the "Initialize language runtime" step after 90 seconds. I use Linode which uses their own kernel, which is ahead of stock Ubuntu, and it seems to be related to the kernel version. It doesn't work with kernel versions: But it works fine with version Passenger 6.0.0 still works with the newer versions. |
Some more info, passenger-status also hangs (indefinitly, it seems). According to strace, both the ruby prespawn process and passenger-status hangs at "getrandom" Edit: It would probably proceed after gaining enough entropy, if the timeout is increased sufficiently, but more than 90 seconds waiting for passenger to start would be unacceptable anyway. |
Ah, that does sound like a good lead. We also wouldn't experience that in our testing as our systems are long-running and have had time to generate entropy. However the fact that you don't have trouble with 6.0.0 is odd, there are only 2 non-trivial changes in 6.0.1, I fixed a problem with generic language app spawning (which shouldn't be related), and I made the container detection more thorough. I don't directly call getrandom, however perhaps the implementation of the virtual filesystem at /proc uses getrandom... I saw in that thread that systemd is affected, and I adapted my container detection from them, perhaps it's related. @sokkalf since you are able to use strace, would it be too much to ask for a line number for the hanging getrandom? @ianrandmckenzie can you provide the output of |
Can't seem to get a line number for that address. Had a go with strace, ltrace and gdb, but I'm no expert in either. It does, however, seem like Passenger 6.0.0 also is affected, contrary to what I stated above. I guess that by the time I got to reverting the version, the system had enough entropy, and voilá. So, I guess this really is a ruby bug, and rules out passenger as the culprit. I'll downgrade the kernel to 4.15 for now, and look out for a patch. |
Ok so that covers that case. @ianrandmckenzie have you had time to check your kernel version? |
Sorry about the delay @CamJN – my time for this particular project is very limited availability. Here's the
|
Thanks, so it looks like a different issue from sokkalf. Can you, when you have a moment, set I understand if you don't have much time, I can wait. |
Hey @CamJN I'm finally back on this project. Edit: Here's my updated
I got the following showing up:
|
Interesting, it looks like the bash config is taking more than the startup time limit on its own. You might want to find out what's so slow there before we continue. |
Thank for the reply, @CamJN When you say bash config, are you talking about files like |
Yes though I said |
@CamJN I simply removed the off-the-shelf I don't know if these are default This stuff definitely seems above my paygrade, but I'd certainly like to figure out why this problem happened. Shell scripts are not something I'm terribly experienced with. |
Another question: How did you know it was a problem with the bash config based on looking at the logs? The logfiles are hard for me to understand. Is it because the log ended on Either way, thank you for helping me figure this out. |
The combination of Passenger saying that app startup takes too long, and the output from the app not getting past the shell script stage are what told me it was the shell config. When Passenger starts your app it actually launches a shell first and then starts the app, this is meant to simplify user's lives as they often set environment variables in their shells, and expect them to be present in their apps. By turning the log level to 7, the shell is instructed to print all of the scripts that it runs as it runs them (lines starting with + in the log you provided), and we can see that the actual ruby app is never started. Therefore we can conclude that the script(s) took too long. As for debugging why a script was too slow, that's outside the scope of this project, but you can probably find help on stack overflow or a similar site. |
Sounds good @CamJN , thanks again for your help. |
Issue report
Are you sure this is a bug in Passenger?
I have scoured Google/Stack Overflow for people with the same issue and have found nothing.
Please try with the newest version of Passenger to avoid issues that have already been fixed
Using 6.0.1
Question 1: What is the problem?
Passenger hangs on process spawning, then presents the error page because it goes past the 90-second limit. I eventually changed the limit to 60 seconds to speed up my debugging. I tried disabling smart spawning, to no effect. I also tried upgrading the server to 8gig RAM and 4 CPUs, also to no effect. I should also note that the only traffic the server is getting is just me, SSH access and a single browser request at a time.
What is the expected behavior?
The process spawns within a few seconds and the Rails application serves the requested page.
What is the actual behavior?
Passenger times out on the process spawning.
How can we reproduce it? Please try to provide a sample application (or Virtual Machine) demonstrating the issue. Otherwise, if we can't reproduce it, we might have to ask you a number of followup questions or run certain commands to try and figure out the problem.
I am using Rails 5.2.2, Ruby 2.5.1, Passenger 6.0.1, nginx 1.14.0, Ubuntu 18.04.2
There are no stack traces. Passenger seems to think its a server load problem, but again, there is nothing tying up the resources.
Question 2: Passenger version and integration mode:
Question 3: OS or Linux distro, platform (including version):
Question 4: Passenger installation method:
Your answer:
[ ] RubyGems + Gemfile
[ ] RubyGems, no Gemfile
[*] Phusion APT repo
[ ] Phusion YUM repo
[ ] OS X Homebrew
[ ] source tarball
[ ] Other, please specify:
Question 5: Your app's programming language (including any version managers) and framework (including versions):
Question 6: Are you using a PaaS and/or containerization? If so which one?
Question 7: Anything else about your setup that we should know?
No, not as far as I know, it's a fairly vanilla setup, it's for an extremely freshly built application.
We strive for quality and appreciate you taking the time to submit a report! Please note that if you want guaranteed response times and priority issue support we encourage you to join our enterprise customer base. They also provide us with the means to continue our high level of open source support!
The text was updated successfully, but these errors were encountered: