The application spawner server exited unexpectedly: Connection refused - ruby-on-rails

I am getting the following error just after my host updated to Phusion Passenger 3.0. It happens "sometimes", for no apparent reason. If the problem was a gem, I guess I would always get the error.
I can reproduce the bug somewhat easily by clicking the same link over and over again.
Any idea?
Passenger encountered the following error:
The application spawner server exited unexpectedly: Connection refused - /tmp/passenger.1.0.17525/generation-3/spawn-server/socket.8572.59234504525620
Exception class:
PhusionPassenger::Rack::ApplicationSpawner::Error
Backtrace:
File Line Location
0 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/rack/application_spawner.rb 118 in spawn_application'
1 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb 257 inspawn_rack_application'
2 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb 82 in synchronize'
3 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server_collection.rb 79 insynchronize'
4 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb 244 in spawn_rack_application'
5 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb 137 inspawn_application'
6 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/spawn_manager.rb 275 in handle_spawn_application'
7 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb 357 insend'
8 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb 357 in server_main_loop'
9 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/lib/phusion_passenger/abstract_server.rb 206 instart_synchronously'
10 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/helper-scripts/passenger-spawn-server 99

Have you checked if there is any permission issue in the /tmp directory? This message looks strange:
Connection refused - /tmp/passenger.1.0.17525/generation-3/spawn-server/socket.8572.59234504525620
Plus, last version of Passenger is 3.0.12, although an upgrade will not probably fix the issue.

Related

Sidekiq throws Redis::CommandError

I have this redis container I use for Sidekiq/Rails and also set up rabbitmq a few days ago on the same docker host. Ever since I keep getting these errors:
UNBLOCKED force unblock from blocking operation, instance state changed (master -> slave?)
redis/client.rb in call at line 126
def call(command)
reply = process([command]) { read }
raise reply if reply.is_a?(CommandError)
if block_given?
yield reply
redis/client.rb in block in call_with_timeout at line 219
redis/client.rb in with_socket_timeout at line 292
redis/client.rb in call_with_timeout at line 218
redis.rb in block in _bpop at line 1186
redis.rb in block in synchronize at line 52
monitor.rb in mon_synchronize at line 226
redis.rb in synchronize at line 52
redis.rb in _bpop at line 1183
redis.rb in brpop at line 1228
redis/namespace.rb in call_with_namespace at line 469
redis/namespace.rb in block (2 levels) in <class:Namespace> at line 349
sidekiq/fetch.rb in block in retrieve_work at line 37
sidekiq.rb in block in redis at line 97
connection_pool.rb in block (2 levels) in with at line 65
connection_pool.rb in handle_interrupt at line 64
connection_pool.rb in block in with at line 64
connection_pool.rb in handle_interrupt at line 61
connection_pool.rb in with at line 61
sidekiq.rb in redis at line 94
sidekiq/fetch.rb in retrieve_work at line 37
sidekiq/processor.rb in get_one at line 83
sidekiq/processor.rb in fetch at line 95
sidekiq/processor.rb in process_one at line 77
sidekiq/processor.rb in run at line 68
sidekiq/util.rb in watchdog at line 15
sidekiq/util.rb in block in safe_thread at line 24
The redis logs show nothing relevant, just the "save database" stuff.
Have I done something evil getting them both set up within the same host?
Turns out someone removed a firewall rule so the redis port was exposed to datacenter-wide VLAN.
And since the datacenter where that machine lives have promised 3 years ago they will be releasing a feature where each customer/account can have their own separate VLAN, they have yet to and some of their customers seem to be up to no good.
The error I was seeing was someone probing ports and trying all sorts of remote exploits.
After adding the firewall rule back up, the error disappeared.

Rails server command bug

I started a new ruby-on-rails project called "myrubyblog", changed directories to my project then launched rails server command, but the terminal then outputs me this after an incredible amount of lines of information I don't understand;
-- Other runtime information -----------------------------------------------
* Loaded script: bin/rails
* Loaded features:
0 enumerator.so
1 thread.rb
2 rational.so
3 complex.so
4 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/armv7l-linux-eabihf/enc/encdb.so
5 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/armv7l-linux-eabihf/enc/trans/transdb.so
6 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/armv7l-linux-eabihf/rbconfig.rb
7 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/compatibility.rb
8 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/defaults.rb
9 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/deprecate.rb
10 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/errors.rb
11 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/version.rb
12 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/requirement.rb
13 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/platform.rb
14 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/basic_specification.rb
15 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/stub_specification.rb
16 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/util/list.rb
17 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/armv7l-linux-eabihf/stringio.so
18 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/rfc2396_parser.rb
19 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb
20 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/common.rb
21 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/generic.rb
22 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/ftp.rb
23 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/http.rb
24 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/https.rb
25 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/ldap.rb
26 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/ldaps.rb
27 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/mailto.rb
28 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri.rb
29 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/specification.rb
30 /home/pi/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/exceptions.rb
... (up to 320 lines)
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Abandon
What is that supposed to mean?

Passenger error Could not find rake-11.3.0 in any of the sources (Bundler::GemNotFound) on Bluehost shared hosting

I have to use bluehost shared hosting for some reason. I upgraded ruby to version 2.1.1 and Rails to version 4.2.2 (Following this article http://www.haydonryan.com/installing-ruby-2-1-1p76-and-rails-4-0-4-on-bluehost/).
Then I uploaded my application and followed instructions provided by Bluehost at https://my.bluehost.com/cgi/help/rails
Now when I go to the domain obortunity.org I get this error message:-
Ruby (Rack) application could not be started
Error message:
Could not find rake-11.3.0 in any of the sources (Bundler::GemNotFound)
Exception class:
PhusionPassenger::UnknownError
Application root:
/home4/obortuni/rails_apps/obortunity
Backtrace:
0 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/spec_set.rb 92 in block in materialize'
1 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/spec_set.rb 85 inmap!'
2 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/spec_set.rb 85 in materialize'
3 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/definition.rb 114 inspecs'
4 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/definition.rb 159 in specs_for'
5 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/definition.rb 148 inrequested_specs'
6 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/environment.rb 18 in requested_specs'
7 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler/runtime.rb 13 insetup'
8 /usr/lib64/ruby/gems/1.9.3/gems/bundler-1.3.5/lib/bundler.rb 120 in setup'
9 /etc/httpd/modules/passenger/lib/phusion_passenger/utils.rb 326 inprepare_app_process'
10 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 156 in block in initialize_server'
11 /etc/httpd/modules/passenger/lib/phusion_passenger/utils.rb 563 inreport_app_init_status'
12 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 154 in initialize_server'
13 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 204 instart_synchronously'
14 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 180 in start'
15 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb 129 instart'
16 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 253 in block (2 levels) in spawn_rack_application'
17 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb 132 inlookup_or_add'
18 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 246 in block in spawn_rack_application'
19 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb 82 inblock in synchronize'
20 prelude> 10:in synchronize'
21 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb 79 insynchronize'
22 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 244 in spawn_rack_application'
23 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 137 inspawn_application'
24 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb 275 in handle_spawn_application'
25 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 357 inserver_main_loop'
26 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb 206 in start_synchronously'
27 /etc/httpd/modules/passenger/helper-scripts/passenger-spawn-server 99 in
'
For some reason Passenger is stuck on previous version of ruby which comes default in bluehost shared hosting. I tried 3-4 hours searching for a possible solution but couldn't find any.
Really looking forward for someones help. Thanks
I did not work with bluehost before, but here are few suggestions, hope they can help:
You can try to check where ruby version is set for Passenger. It depends how it is running on bluehost, if it is nginx - you can try to specify ruby version explicitly in webapp.conf file. If it is apache (did not work with it directly) - there should be it's own configuration file, where you can try to set the version explicitly
https://www.phusionpassenger.com/library/config/apache/reference/
If the previous point did not help I would try to edit .bashrc file, not sure if it can be a problem (as I am using rvm), but it sounds strange for me:
In setup article you provided is stated to edit .bashrc file:
export GEM_PATH=$GEM_HOME:/lib64/ruby/gems/1.9.3 - could you check
what you have there? If you upgraded to new ruby - probably path to ruby 2.1.1 gems folder should be specified.

What does Lejos NXJ error 76 mean?

We're getting an error 76 for code that worked outside the lejos runtime.
What does error 76 mean?

Phusion Passenger cannot start Rails application

Any help would be greatly appreciated. I'm trying to run basic Rails apps on my server.
I'm running Ubuntu and nginx. Ideally I'd like to be able to still run php apps so nginx+Phusion seems like the way to go.
A source file that the application requires, is missing.
It is possible that you didn't upload your application files correctly. Please check whether all your application files are uploaded.
A required library may not installed. Please install all libraries that this application requires.
Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.
Error message:
no such file to load -- bundler
Exception class:
LoadError
0 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in gem_original_require'
1 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 inrequire'
2 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb 325 in prepare_app_process'
3 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb 156 ininitialize_server'
4 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb 563 in report_app_init_status'
5 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb 154 ininitialize_server'
6 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 204 in start_synchronously'
7 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 180 instart'
8 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb 129 in start'
9 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 253 inspawn_rack_application'
10 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 132 in lookup_or_add'
11 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 246 inspawn_rack_application'
12 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 82 in synchronize'
13 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 79 insynchronize'
14 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 244 in spawn_rack_application'
15 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 137 inspawn_application'
16 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 275 in handle_spawn_application'
17 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 357 insend'
18 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 357 in server_main_loop'
19 /var/lib/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 206 instart_synchronously'
20 /var/lib/gems/1.8/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server 99
It seems like you installed passenger to your system ruby installation and not for the 1.9.3-p374 version via rvm. Try to follow the below steps:
rvm use 1.9.3-p374
gem install bundler passenger
passenger-install-apache2-module
Then use the instructions from the last command and configure your apache with them. Additionally, go to the project directory and do
rvm use 1.9.3-p374
bundle install
That should do the trick.

Resources