-
Notifications
You must be signed in to change notification settings - Fork 65
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
Cannot connect to process running in Phusion Passenger #9
Comments
passenger removes all signal handlers on startup. try |
I'm having the same issue under Sinatra. I've tried instrumenting the require statement in a controller action, app load, and the rackup file independently but it doesn't take. A simple ruby script works with rbtrace on the same machine. Using ruby 1.9.2 and passenger 3.0.6. |
If you're using |
Unblocked, thanks! This also reminds me of the value of Bundler's 'require => false' option. |
Still have a problem connecting to passenger instance :( It says But, I've required it in before_filter and in envrionment.rb |
You need to ensure it is only required in the before_filter. Remove from environment.rb and make sure the Gemfile says |
Hi @tmm1 I am following up on this blog http://blog.skylight.io/hunting-for-leaks-in-ruby/, I have created an endpoint in admin namespace and request that endpoint I am getting this error in the logs my configuration controller.rb file
initializers/users.rb
This setup worked fine if I ran rbtrace from the console but I am getting the above errors when I run it from the endpoint. it would be great if you would please have a look Thanks |
It works well then using |
I am trying to perform an rbtrace on a Rails app running in puma, add gem 'rbtrace', '~> 0.4.7', require: false in Gemfile, and add require 'rbtrace' in config/environment.rb. then what should i do for listenning the pid. |
@kmile were you able to make I am having a hard luck in 1.Added controller action to get a heap dump def dump
require 'rbtrace'
pid = Process.pid
Rails.logger.debug("Process.pid: #{pid}")
system("rbtrace -p #{pid} -e 'Thread.new{require \"objspace\"; ObjectSpace.trace_object_allocations_start; GC.start(); ObjectSpace.dump_all(output: File.open(\"/tmp/dump/heap_dump_#{params[:id]}.json\", \"w\"))}.join'")
head :ok
end 2.required before_filter :require_rbtrace
def require_rbtrace
require 'rbtrace'
end 3.In boot.rb --> 4.Call the Still see
|
Getting the same issue as @swapnilabnave I'm using Rails 4.0.6 |
@mariogintili It helped me pin down leaks in my application. |
@tmm1 I getting the same error. But the only difference for me is that I'm using |
I was having this same issue- the given pid was not listening for messages. What ultimately worked for me was putting the code from the Thread.new command into a controller method by itself:
then I created a route to this action and navigated to it in my browser. This completed successfully. |
For anyone running into this issue, the correct way to use rbtrace with recent versions of passenger is to require it within the # config.ru
PhusionPassenger.on_event(:after_installing_signal_handlers) do
require 'rbtrace'
end If you require it earlier, passenger resets all signal handlers after fork, which removes the |
It working. passenger 6.0.2, ruby 2.6.1 |
Is that before or after the After adding In gemfile: In config.ru, at the very top:
|
It doesnt work for me too. Passenger 5.1.12 and ruby 2.4.0 |
I am getting the same error "argument --pid (process already being traced?)" as well. I am on: |
I am trying to perform an rbtrace on a Rails app running in Phusion Passenger. If I execute a long running rake task it can connect just fine. If I connect it to the corresponding Passenger Process it tells me (pid is not listening for messages, did you
require "rbtrace"
).I have required rbtrace in the environment.rb. Passenger runs in production mode, and I am using REE 1.8.7. Is there any reason rbtrace would not work for a Passenger process?
The text was updated successfully, but these errors were encountered: