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
Logstash upstart script not working for some users #1289
Comments
I am also getting same Error. running as command line. /opt/logstash# /app_packages/jdk1.7.0_45/bin/java -Xmx500m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -jar /opt/logstash/vendor/jar/jruby-complete-1.7.11.jar -I/opt/logstash/lib /opt/logstash/lib/logstash/runner.rb agent -f conf/logstash.conf |
I tried to reproduce this today (in a vm) but I was unable to proceed due to problems with the vm itself - silly computers! I'll try again once I've got an ubuntu vm online. |
I've run into the same issue. Installing Logstash 1.4.0 from a .deb, the process is continually restarted by Upstart(new pids can be seen in top). If I run the command manually, it runs fine:
There are no errors in I've also cut my configuration down to the bare minimum:
|
Hi, /opt/logstash/bin/logstash does several settings including the GEM_HOME one. Can you verify if you have the same issue when you use the script instead calling java directly? Cheers. |
Hey @electrical, sorry, this might have been misleading. I am using the script, but it keeps crashing/respawning in upstart. See the Vagrantfile below to test it yourself (tail # -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "helderco/trusty64"
config.vm.provision :shell, :inline => "cd /tmp && wget 'https://download.elasticsearch.org/logstash/logstash/packages/debian/logstash_1.4.0-1-c82dc09_all.deb'"
config.vm.provision :shell, :inline => "sudo dpkg -i /tmp/logstash_1.4.0-1-c82dc09_all.deb; sudo apt-get -fy install && sudo dpkg -i /tmp/logstash_1.4.0-1-c82dc09_all.deb"
config.vm.provision :shell, :inline => "sudo echo 'input { stdin{} }\noutput { stdout{} }\n' > /etc/logstash/conf.d/t.conf"
config.vm.provision :shell, :inline => "sudo service logstash start && sudo service logstash-web start"
end If you meant testing without upstart but with the script: $ sudo -u logstash /opt/logstash/bin/logstash agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log This works… |
@alappe ah okay. we haven't done anything to the upstart configs, only the sysv init scripts for 1.4.1 |
@electrical Too bad. And the release is imminent, so no chance? It's a pity because you cannot use the deb on ubuntu at the moment without adding a separate upstart config (as I have no fix for the issue, I wouldn't know what to override the upstart config with anyway)… |
You could remove the upstart config and use the init script, i do the same for the puppet module :-) |
Alright… thanks for taking care! |
@electrical it looks like the init script is no good either:
See https://logstash.jira.com/browse/LOGSTASH-2155 for more detail. |
@jpb that is most likely the old init script. |
@electrical On my test box, it starts without error message, but after some seconds the process is gone. It doesn't log into Let's see what @jpb sees… |
|
Make sure there are no other files in your LS_CONF_DIR or point it directly to your conf file. Had the same issue. |
I have the same issue - logstash 1.4.1 installed from elasticsearch.org repositories crashes after a minute and respawns. Adding the GEM_HOME line to |
@electrical Is there some progress on the horizon? This makes deploying/using logstash a less fun experience… |
@alappe for easier deployment, you could try adding an override file for the upstart job:
|
Same issue as OP. Fresh Ubuntu 14.04, Logstash 1.4.2 from debian repo. Minimal config file. Do a service logstash start. Process starts but nothing is happening and logs are empty. When I do service logstash stop the startup messages show up in the logstash logs. Tried putting GEM_HOME in front of direct java call like OP and that works. We have over 100 servers and growing and every new server shows this error. Not fun. Thanks. |
This way of invoking logstash is fine, but you didn't set any environment variables that the logstash start script sets, so it shouldn't work unless you set all the environment variables - this is why I do not recommend invoking logstash with the I will agree that many users are reporting problems, but the "solution" doesn't make sense because this variable is set by bin/logstash. I will try to reproduce. |
Logstash 1.4.2 on Ubuntu 14.04 is working fine for me. I install it, add a config, start the For everyone encountering this problem, can you please attach as a gist:
|
@jordansissel This wasn't meant as a solution but merely a way to debug what could be wrong with the Upstart script… |
@jordansissel thanks for the gist. Turns out the Ubuntu image I was on was not clean. My bad. I loaded an actual fresh Ubuntu VM and my configs and it works. So something we're installing or upgrading to our base OS is causing this problem. Thanks for the help. I'll comment back if I track it down. btw, my /opt/logstash/bin/logstash file doesn't set GEM_HOME. |
So, just to make it repeatable: # -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
installLogstash = <<EOT
cd /tmp && \
wget 'https://download.elasticsearch.org/logstash/logstash/packages/debian/logstash_1.4.2-1-2c0f5a1_all.deb' && \
echo 'fb2c384f61b6834094b31a34d75b58d00c71d81a logstash_1.4.2-1-2c0f5a1_all.deb' | shasum --check - && \
sudo apt-get update && \
sudo apt-get install -y 'java7-runtime-headless' && \
sudo dpkg -i logstash_1.4.2-1-2c0f5a1_all.deb && \
echo "input { stdin { } }\n output { stdout { codec => rubydebug } }\n" > /etc/logstash/conf.d/simple.conf && \
sudo service logstash start && \
sudo service logstash-web start
EOT
config.vm.box = "precise64"
config.vm.provision "shell", inline: installLogstash
end
vagrant@precise64:~$ ls -la /etc/logstash/conf.d/
total 12
drwxrwxr-x 2 root root 4096 Jul 4 01:19 .
drwxrwxr-x 3 root root 4096 Jul 4 01:19 ..
-rw-r--r-- 1 root root 63 Jul 4 01:19 simple.conf
vagrant@precise64:~$
|
@jordansissel with the debian packages (Ubuntu 14.04) logstash 1.4.2-1-2c0f5a1 starts fine, still there's a problem with logstash-web, which is fixed by adding GEM_HOME="/opt/logstash/vendor/bundle/jruby/1.9" to /etc/default/logstash-web (I tested both, upstart and sysv init scripts and adding GEM_HOME fixes things and make kibana to start). Without GEM_HOME you get this error: LoadError: no such file to load -- i18n Which seems to be a problem loading the i18n gem in this line: https://github.com/elasticsearch/logstash/blob/1.4/lib/logstash/runner.rb#L46 Thanks |
@alappe I think your simple.conf might be a bit too... simple, for testing purposes. You mentioned above that you're using:
If you temporarily set
If you give it a config with an input that actually stays open ( like the logstash-apache.conf example found here http://logstash.net/docs/1.4.2/tutorials/getting-started-with-logstash ) the input plugin will stay open and the process stays up just fine. |
logstash errors is in /var/log/logstash/logstash.err |
1.4.2 doesn't start correctly with the supplied init script on EL6. With the Git version it works. I think the 1.4.3 version should contain the git init script. |
I have the same issue on my VM with Ubuntu 14.04 Logstash agent starts After some investigations
==> if I starts logstash web using : "sudo /etc/init.d/logstash-web start", that works and port is specified for the process (see the end of the line)
Strange, isn't it ? In the script /etc/init.d/logstash-web, these options are specified and passed to logstash
In the file /etc/init/logstash-web.conf, there is no option specified
so, logstash doesn't use 9292 this time I tried to modify the file /etc/init/logstash-web.conf like that
but that didn't work, because there is a bug in the file. In the few next lines, we have that
and that should be
(see the underscore between LS and OPTS) With this 2 modifications, logstash web works like a charm.. |
logstash-web is removed in the next release (Logstash 1.5.0) |
Do you mean remove /etc/init.d/logstash-web or remove /etc/init/logstash-web.conf or remove both ? Thanking you in advance. |
I have found out why logstash doesn't start with rhel6 service. Logstash uses some unusual method to start the service, via : I have set LS_GROUP="squid" to my /etc/sysconfig/logstash as a workaround. Unfortunately only 1 group can be used. |
What could be the issue here - unable to access "jruby-complete-1.7.11.jar"? [logstash-1.4.2]$ bin/logstash -e 'input { stdin {} } output { stdout {}}' [logstash-1.4.2]$ ls vendor/jar/ -l |
I think I found a solution here: #1524 |
/var/log/upstart/logstash.log
only gives the following:Sending logstash logs to /var/log/logstash/logstash.log
. Sadly, there's no information in it. So I tried to run command that is executed as thelogstash
user:It works if I set $GEM_HOME:
I don't know if that is the actual problem, or if this is simply because I am running the command differently compared to the upstart daemon. If you have any more clues on how to dig into that, I will try…
The text was updated successfully, but these errors were encountered: