twitter-archive / kestrel

simple, distributed message queue system (inactive)
http://twitter.github.io/kestrel
Other
2.77k stars 312 forks source link

Bad user permissions cause kestrel to silently not start #74

Closed jjlauer closed 12 years ago

jjlauer commented 13 years ago

On my Ubuntu machine, I tried running the following command:

java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar

Kestrel would fail to start and not print out any sort of error to my console. Since Kestrel writes to /var/run, /var/log, etc. and the user I was attempting to run it under didn't have permissions, Kestrel failed to start. That makes sense, but I didn't expect that to happen silently. The only way to get around this is to run via sudo:

sudo java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar

jkalucki commented 13 years ago

Servers shouldn't write to stdout. The error should be in the error log.

On Wed, Oct 19, 2011 at 9:15 PM, Joe Lauer < reply@reply.github.com>wrote:

On my Ubuntu machine, I tried running the following command:

java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar

Kestrel would fail to start and not print out any sort of error to my console. Since Kestrel writes to /var/run, /var/log, etc. and the user I was attempting to run it under didn't have permissions, Kestrel failed to start. That makes sense, but I didn't expect that to happen silently. The only way to get around this is to run via sudo:

sudo java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar

Reply to this email directly or view it on GitHub: https://github.com/robey/kestrel/issues/74

jjlauer commented 13 years ago

That's the problem though -- without valid permissions an error wasn't able to be printed out to a log. By default, /var/log/kestrel wasn't writable by my default account. Any errors prior to the valid opening up of a logfile should be printed out to at least stderr, otherwise its a mystery why it failed to start.

jeffstyr commented 13 years ago

Writing to stderr seems appropriate, in the case where the error is related to not being able to create a log file to write to, and especially when it's a fatal error. A coworker just ran into this. Silent failure is difficult to troubleshoot.

robey commented 12 years ago

ok, the version on head should now dump errors to stdout if the server isn't capable of starting (either because of a missing config file, or a broken queue folder).