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

tail: write error when run by node, not when run manually #5

Open
clickworkorange opened this issue Aug 27, 2010 · 7 comments
Open

Comments

@clickworkorange
Copy link

When the plugin is run as normal I get:
tail: write error
failed executing request-log-analyzer. Is the path to the binary correct?

But "munin-run rails_requests" works fine. My first assumption was a permissions problem but that doesn't seem to be the case. I've tried running the plugin as root, www-data and a local user account - no change. Any ideas?

Thanks,

mikrogroove

@barttenbrinke
Copy link
Owner

What does the debug output give you?

@clickworkorange
Copy link
Author

Since I'm using RVM the default path for for request-log-analyzer needs to be changed, I do this in the plugin configuration:

env.request_log_analyzer '/usr/local/rvm/gems/ruby-1.9.2-head/bin/request-log-analyzer'
command /usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby %c

But I can't do that when running the plugin in debug mode from the command line (it only accepts a log file path). Because of this I'm unable to provide debug output - though I suppose I could edit the plugin script and change the default path.

@clickworkorange
Copy link
Author

Ok, here is the debug output:

/etc/munin/plugins/rails_redmine_requests debug '/var/rails/Redmine/log/production.log'

Processing the last 50000 lines of /var/rails/Redmine/log/production.log which are less then 300 seconds old.

"tail -n 50000 /var/rails/Redmine/log/production.log | /usr/local/rvm/gems/ruby-1.9.2-head/bin/request-log-analyzer - --after 20100827181909 -b --dump /tmp/rla_1282929600.yml 2>/dev/null"

get.value 0.26666666666666666
post.value 0.01
put.value 0.0
delete.value 0.0

Looks ok to me?

@clickworkorange
Copy link
Author

FYI, here's the plugin configuration block:

[rails_redmine_requests]

env.log_file '/var/rails/Redmine/log/production.log'
env.request_log_analyzer '/usr/local/rvm/gems/ruby-1.9.2-head/bin/request-log-analyzer'
user root
command /usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby %c

@barttenbrinke
Copy link
Owner

That's really strange. Your config looks okay and as the debug output is working, I'm assuming RLA and the scripts are working, so the problem must lie elsewhere.

Are you sure you have the RLA gem installed in the 1.9.2 RVM environment you're using? Because it is TAIL who is giving a write error, which it'll probably do if the pipe is closed for some reason. This could be either RLA missing or that it is unable to write to /tmp/. What you could try is to replace "2>/dev/null" with " >> /tmp/rla_log.txt 2>&1" And checkout what is in the generated file.

Also make sure that there are no lingering files in /tmp/rla_*.

@ebertech
Copy link
Collaborator

I think this is because you used quotes in the names of the files. Try

env.log_file /var/rails/Redmine/log/production.log

instead of

env.log_file '/var/rails/Redmine/log/production.log'

@barttenbrinke
Copy link
Owner

Mikrogroove, is it working for you? If so, please let me know so I can close this ticket.

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