Skip to content
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

Daemons::Rails::Monitoring.statuses doesn't work in production #14

Open
rickygu opened this issue Sep 30, 2013 · 7 comments
Open

Daemons::Rails::Monitoring.statuses doesn't work in production #14

rickygu opened this issue Sep 30, 2013 · 7 comments

Comments

@rickygu
Copy link

rickygu commented Sep 30, 2013

When I call Daemons::Rails::Monitoring.statuses in development, it works fine, but on my production server, it returns not_exists even though the daemons are running.

@hospital-systems
Copy link

Do you have only one production server and are daemons running on same machine as application?

@rickygu
Copy link
Author

rickygu commented Sep 30, 2013

yes, only 1 production server

@hospital-systems
Copy link

Ok.
Can you describe layout for your daemons? (i.e. lib/daemons/__ctl or app/daemons/__ctl etc)
What returns command bundle exec lib/daemons/<your_daemon_name>_ctl status on your production server?
Are you sure your daemons are working well and doesn't crashes and restarts?
And what is result of ruby code run from rails console - Daemons::Rails::Monitoring.default.controllers?

@rickygu
Copy link
Author

rickygu commented Oct 1, 2013

daemons are in lib/daemons

bundle exec lib/daemons/<your_daemon_name>_ctl status
-> daemon.rb: running [pid 6334]
daemons are working for sure because otherwise my app wouldn't be working.

Daemons::Rails::Monitoring.default.controllers works fine in console production, but when i do

<%= Daemons::Rails::Monitoring.statuses["daemons.rb"] %> in the view it return "not_exists".

@hospital-systems
Copy link

Is it behave same if you set instance variable in controller and then display in view? Also, it may be result of page caching and actually you see old version of page when daemons not yet run. So, try to add timestamp to this page - will it change on reload? It it will not help - it may be helpful if you create simplest not working version of application and send me by email or share through github. I just checked your use case and it works for me, so I need more details to find problem.

@rickygu
Copy link
Author

rickygu commented Oct 2, 2013

just tried setting the instance variable in the controller but no dice. still shows not_exists when the daemons are clearly running. I'm using Rails 4.0.0 and daemons-rails (1.2.1) and ruby 2.0.0p247.

oh another piece of info, I had to comment out this line in my daemon or it wouldn't start. I don't know if that has anything to do with this problem:
#ENV["RAILS_ENV"] ||= "production"

@ACPK
Copy link

ACPK commented Nov 5, 2014

@rickygu @hospital-systems Did you get this fixed? I'm having the same issue when deploying to a Digital Ocean VPS running Dokku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants