kostya / eye

Process monitoring tool. Inspired from Bluepill and God.
MIT License
1.19k stars 86 forks source link

Eye fails to parse confile and crash with timeout (Only ubuntu 16) #181

Closed borlafdev closed 7 years ago

borlafdev commented 7 years ago

I just migrated an old application to a new server and discovered and ugly bug in ubuntu 16, it isn't related to eye but make it crash.

The problem resides in config file parsing, running èye load gives me timeout, then try to run èye explain confile.eye and that gives me the error: ruby /home/deploy/.rvm/gems/ruby-2.3.1/bin/eye explain collectors.eye: symbol lookup error: /home /deploy/.rvm/gems/ruby-2.3.1/gems/sigar-0.7.3/lib/sigar.so: undefined symbol: sigar_skip_token

Just googled the error, found the sigar issue (https://github.com/hyperic/sigar/issues/60), and the solution: gem install sigar -- --with-cppflags="-fgnu89-inline"

After running that, eye works perfectly

kostya commented 7 years ago

yes, sigar bug, this is old not supported gem, but very useful.

borlafdev commented 7 years ago

So, this isn't an eye bug but should be documented to avoid frustration of anyone who wants to use this gem in lastest distro releases, ¿should i write a wiki page or make a readme pr?

kostya commented 7 years ago

how you install it?

borlafdev commented 7 years ago

I can reproduce the error installing with gem install eye( yes i know the correct way is in the readme but just in case someone is as stupid as me), this time with ruby 2.4.0, and Ubuntu 16.04.2 LTS.

Just used the solution provided by the sigar issue (https://github.com/hyperic/sigar/issues/60)

nisanthchunduru commented 7 years ago

@kostya This issue deserves a mention in the README.

I installed eye on the latest Ubuntu LTS (16.04) using the latest ruby (2.4.1) today. It didn't start

rails@mb-staging:~$ gem install eye
rails@mb-staging:~$ eye load ~/apps/myrailsapp/current/config/eye/mb-staging.eye 
server has not started in 15 seconds, something is very wrong
rails@mb-staging:~$ eye info
socket(/home/rails/.eye/sock) not found, did you run `eye load`?

I eventually found that this happened because of the misbehaving sigar gem

rails@mb-staging:~$ eye check ~/apps/myrailsapp/current/config/eye/mb-staging.eye
ruby /usr/local/rvm/gems/ruby-2.4.1/bin/eye check /home/rails/apps/emailcentral/current/config/eye/staging.eye: symbol lookup error: /usr/local/rvm/gems/ruby-2.4.1/gems/sigar-0.7.3/lib/sigar.so: undefined symbol: sigar_skip_token

The solution was to install the sigar gem using a specific flag as recommended here https://github.com/hyperic/sigar/issues/60#issuecomment-111600492

gem install sigar -- --with-cppflags="-fgnu89-inline"

This bug will leave new eye users frustrated. I found this solution in a reasonable amount of time only because I've used eye before and am familiar with other eye commands like eye check.

nisanthchunduru commented 7 years ago

@kostya Never mind. This issue is already mentioned in the README and there's a wiki too https://github.com/kostya/eye/wiki/Dealing-with-%22server-has-not-started-in-15-seconds%22 My bad!