sensu / sensu-ruby-runtime

The Sensu Go Ruby Runtime Asset
MIT License
3 stars 23 forks source link

Failing on Ubuntu 18.04 #18

Open sjthespian opened 5 years ago

sjthespian commented 5 years ago

I'm having issues with any ruby sensu plugin that tries to use the sensu-ruby-runtime asset on Ubuntu 18.04. Things work fine on my 16.04 system that is running my sensu backend, but my 18.04 agent throws a library error:

$ check-ports.rb -p 22 -H desire
ruby: relocation error: /var/cache/sensu/sensu-agent/31a3b54b8dabedac5253c07b6c8f11f49a42c0f5a92193675b9c9d02ae00369f15909451ed914b499fe2ad9d67fbed10dd78f4091c00310516ad6c8492a0170b/lib/libpthread.so.0: symbol __libc_dl_error_tsd version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

Installing a libc.so.6 from a 16.04 system into the lib directory above causes a segfault. Trying the libpthread.so.0 from 18.04 causes ruby to segv in lib/ruby/2.4.0/x86_64-linux/enc/encdb.so. I'm assuming this is as simple as getting the right libc.so.6 into the asset, but I'm stumped as to what version that needs to be.

sjthespian commented 5 years ago

I should mention that I have tried both the debian and debian9 asset releases with no luck.

kriszentner commented 5 years ago

After testing here on Ubuntu 18.04, I've found this occurs sensu-ruby-runtime versions 0.0.6 and 0.0.7. A decent workaround is to use 0.0.5.

sjthespian commented 5 years ago

I can confirm that this problem doesn't exist on 0.0.5, I'm using that for now.

jspaleta commented 5 years ago

Hey, can you retest with sensu-ruby-runtime 0.0.8

jspaleta commented 5 years ago

okay i think i see the problem.. libpthread should NOT be part of the runtime as it needs to match the OS provided libc.

I'm going to try to make a change and spin up a new release in the next couple of days.

gtarnaras commented 5 years ago

Had the same issue with Ubuntu 18.04. Using 0.0.5 instead of 0.0.8 did the trick.

jspaleta commented 5 years ago

Hey! I just released ruby-runtime 0.0.9 with some changes to try to exclude glibc libraries so they are picked up from the operating system instead.

Can you re-test to see if either of the debian or debian9 runtime works for you on ubuntu 18.04.

sjthespian commented 5 years ago

So far so good, I deployed this to one of my systems earlier this morning.

I'm also in the process of building it for armv7l/debian to see if it works there as well (it would be nice if the build system included arm builds).

EDIT: I just checked it on armv7 and it is working there as well!

jspaleta commented 5 years ago

new 0.0.10 release coming out soon. I've added a platform test matrix for basic ruby operation that should catch glibc problems in the future. Both 0.0.9 and 0.0.10 debian assets should work for Ubuntu 14.04 through 18.04

Ubuntu 12.04 fails in the CI test coverage, due to requiring a very old glibc.

As for arm: We have some changes that need to go into sensu-go to make sure asset filters work correctly with arm. It's golang specific thing with how golang keeps track of arm variants at compile time. we are working on it making sure that get's capture as part of entity system info so we can reliably filter on it. Once sensu-go versions are out with the necessary system info we'll be able to construct asset filters that can tell the difference between armv7 and armv6.. soon.

actual-nsnow commented 3 years ago

Any update on arm support?