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.
Related
I need to configure the server port in config/boot.rb file. Looking at lib/rails/commands/server/server_command.rb we have this:
125 def perform
126 set_application_directory!
127 Rails::Server.new(server_options).tap do |server|
128 # Require application after server sets environment to propagate
129 # the --environment option.
130 require APP_PATH
131 Dir.chdir(Rails.application.root)
132 server.start
133 end
134 end
135
136 no_commands do
137 def server_options
138 {
139 user_supplied_options: user_supplied_options,
140 server: #server,
141 log_stdout: #log_stdout,
142 Port: port,
143 Host: host,
144 DoNotReverseLookup: true,
145 config: options[:config],
146 environment: environment,
147 daemonize: options[:daemon],
148 pid: pid,
149 caching: options["dev-caching"],
150 restart_cmd: restart_command
151 }
152 end
153 end
How can I configure Port from config/boot.rb then?
Thanks in advance.
I also tried to monkey patch boot.rb to change port, but no luck. Upon browsing I learned that Rails 5 comes with puma, which is configured in config/puma.rb. You can change the default port number in that file, or override it by setting the PORT environment variable before starting rails.
config/puma.rb
# Specifies the `port` that Puma will listen on to receive requests;
# default is 3000.
port ENV.fetch("PORT") { 3000 }
I hope this helps.
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.
I updated my ruby on Bluehost following the guide below.
http://www.haydonryan.com/installing-ruby-2-1-1p76-and-rails-4-0-4-on-bluehost/
http://www.haydonryan.com/rails-4-passenger-and-bluehost-with-a-cameo-from-wordpress/
Then I installed redmine using the guide from bluehost.
If I run rails s through ssh, I get
=> Booting WEBrick
=> Rails 4.2.4 application starting in development on localhost 3000
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server
[2015-10-13 06:45:51] INFO WEBrick 1.3.1
[2015-10-13 06:45:51] INFO ruby 2.2.3 (2015-08-18) [x86_64-linux]
[2015-10-13 06:45:51] INFO WEBrick::HTTPServer#start: pid=19685 port=3000
However, if I open the url from my browser, I get the error message below. What could be causing this?
Error message: Could not initialize MySQL client library Exception
class: RuntimeError Application root: /home/user/rails_apps/redmine
Backtrace:
# File Line Location
0 /home/user/ruby/gems/gems/activesupport-4.2.4/lib/active_support/dependencies.rb
274 in require
1 /home/user/ruby/gems/gems/activesupport-4.2.4/lib/active_support/dependencies.rb
274 in block in require
2 /home/user/ruby/gems/gems/activesupport-4.2.4/lib/active_support/dependencies.rb
240 in load_dependency
3 /home/user/ruby/gems/gems/activesupport-4.2.4/lib/active_support/dependencies.rb
274 in require
4 /home/user/ruby/gems/gems/mysql2-0.3.20/lib/mysql2.rb 31 in
5 /home/user/ruby/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb 76 in require
6 /home/user/ruby/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb 76 in block (2 levels) in require
7 /home/user/ruby/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb 72 in each
8 /home/user/ruby/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb 72 in block in require
9 /home/user/ruby/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb 61 in each
10 /home/user/ruby/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb 61 in require
11 /home/user/ruby/gems/gems/bundler-1.10.6/lib/bundler.rb 134 in require
12 /home5/user/rails_apps/redmine/config/application.rb 5 in
13 /home5/user/rails_apps/redmine/config/environment.rb 2 in require
14 /home5/user/rails_apps/redmine/config/environment.rb 2 in
15 config.ru 3 in require
16 config.ru 3 in block in
17 /home/user/ruby/gems/gems/rack-1.6.4/lib/rack/builder.rb 55 in instance_eval
18 /home/user/ruby/gems/gems/rack-1.6.4/lib/rack/builder.rb 55 in initialize
19 config.ru 1 in new
20 config.ru 1 in
21 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb
225 in eval
22 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb
225 in load_rack_app
23 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb
157 in block in initialize_server
24 /etc/httpd/modules/passenger/lib/phusion_passenger/utils.rb 563 in report_app_init_status
25 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb
154 in initialize_server
26 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb
204 in start_synchronously
27 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb
180 in start
28 /etc/httpd/modules/passenger/lib/phusion_passenger/rack/application_spawner.rb
129 in start
29 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb
253 in block (2 levels) in spawn_rack_application
30 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb
132 in lookup_or_add
31 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb
246 in block in spawn_rack_application
32 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb
82 in block in synchronize
33 prelude> 10:in synchronize
34 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server_collection.rb
79 in synchronize
35 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb
244 in spawn_rack_application
36 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb
137 in spawn_application
37 /etc/httpd/modules/passenger/lib/phusion_passenger/spawn_manager.rb
275 in handle_spawn_application
38 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb
357 in server_main_loop
39 /etc/httpd/modules/passenger/lib/phusion_passenger/abstract_server.rb
206 in start_synchronously
40 /etc/httpd/modules/passenger/helper-scripts/passenger-spawn-server 99
in
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.
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.