# Collectd-client.rb core dumped

**URL:** <https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560>\
**Category:** Product Support\
**Created:** [January 11, 2017, 10:44pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560 "2017-01-11T22:44:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 11, 2017, 10:44pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/1 "2017-01-11T22:44:41Z")

</div>

Hi Friends

I have question about adding new host. When master node ssh to node1, it always fail to execute run\_probe. As I debug the script, I found that this line in “collectd-client.rb” throw error

_data = `#{@run_probes_cmd} 2>&1`_

Google search about this issue return 2 solutions/issues  
a) passwordless issue  
b) SSH\_CLIENT issue  
c) try run “onehost sync --force”

I confirm that first 2 issues are solved in my system and the third one doesn’t help. All required files are valid , accessible and executable by oneadmin.

This thread looks similar to my issue. Unfortunately, there is no valid solution  
[http://users.opennebula.narkive.com/SEKiQERb/one-users-opennebula-node-ubuntu-14-04-saying-error-executing-collectd-client-rb-when-creating-a](http://users.opennebula.narkive.com/SEKiQERb/one-users-opennebula-node-ubuntu-14-04-saying-error-executing-collectd-client-rb-when-creating-a)

One version is 5.2.0 , Ubuntu 16.04 , ruby 2.3

checking core dump file in /var/crash , it looks like it’s something in ruby itself. Not sure it’s a bug in ruby 2.3.

I try duplicate _collectd-client.rb_ to _test.rb_ and remove all lines except the line in question, it runs fine without error. Below is its content.

> #!/usr/bin/env ruby

> data = `./../run_probes kvm-probes /var/lib/one/datastores 4124 20 1 node1 2>&1`  
> code = $?.exitstatus == 0  
> puts “#{code}”

Does anyone has solution or shed me some light where the issue is ? Ruby ?

thanks in advance,  
Tor.

---

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 11, 2017, 11:18pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/2 "2017-01-11T23:18:27Z")

</div>

Checking further in coredump file, I found this error (and others)

_Jan 10 21:16:59 node1 libvirtd[12096]: internal error: QEMU / QMP failed: Could not access KVM kernel module: No such file or directory_

I guess that the root cause is I am running Ubuntu in VirtualBox. Although Ubuntu is KVM-ready but virtualbox can’t nest VM in guest OS.

What do you think ?

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [January 12, 2017, 11:37am UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/3 "2017-01-12T11:37:07Z")

</div>

Even if the node doesn’t have virtualization extensions the monitoring part should work. Send us the `/var/log/one/oned.log` part where monitoring fails.

Also, which process is creating the core? You can find out with:

```auto
$ file <core file>

```

---

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 12, 2017, 11:58pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/4 "2017-01-12T23:58:15Z")

</div>

Thanks for your response Javi.

I also have the same thought, run\_probe just collects statistic via collectd.  
Today I setup another system in VMWare but still have no luck, crash file looks different this time.

Unfortunately, I can’t upload log file in this thread. Please find them from my share drive  
[https://drive.google.com/drive/folders/0B0EZTM0AkotHRU1Qem9vNDFaVDQ?usp=sharing](https://drive.google.com/drive/folders/0B0EZTM0AkotHRU1Qem9vNDFaVDQ?usp=sharing)

cheers!

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [January 13, 2017, 7:49pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/5 "2017-01-13T19:49:33Z")

</div>

The process that is crashing is ruby. It’s strange that it fails. Can you check that you have enough memory and the system is up to date?

---

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 13, 2017, 10:15pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/6 "2017-01-13T22:15:06Z")

</div>

Thanks for your advice. I run 2 guest hosts in my machine, each has 2GB memory and system is up to date (using “updater” tool). I monitor memory when collectd-client.rb crash, there is 1GB+ available. I don’t think it’s computing resource issue.

I try debug again in VMWare. /var/tmp/one/im/run\_probes kvm script will run all scripts in kvm.d and kvm-probe.d folder. I try run each file manually and it totally fine. So , the root cause would sit in Ruby itself.

I install ruby package (sudo apt-get install ruby), is there any addition ruby packages required ?  
(collectd-core package installed)

---

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 13, 2017, 11:09pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/7 "2017-01-13T23:09:40Z")

</div>

If I bypass _collectd-client.rb_ but call _runprobe kvm-prove_ manually it works fine.  
Why _collectd-client.rb_ fail to execute line 4 below , or it doesn’t support recursive, nahhh ?

> 1. oneadmin@node1:/var/tmp/one/im/kvm.d$ ls
> 2. collectd-client\_control.sh collectd-client.rb
> 3. oneadmin@node1:/var/tmp/one/im/kvm.d$ ./collectd-client\_control.sh /var/lib/one/datastores 4124 20 1 node1 2\>&1

> 1. oneadmin@node1:/var/tmp/one/im/kvm.d$ ./…/run\_probes kvm-probes /var/lib/one/datastores 4124 20 1 node1 2\>&1
> 2. ARCH=x86\_64
> 3. MODELNAME=“Intel(R) Core™ i5-4288U CPU @ 2.60GHz”
> 4. HYPERVISOR=kvm
> 5. TOTALCPU=200
> 6. CPUSPEED=2599
> 7. TOTALMEMORY=2964420
> 8. USEDMEMORY=1117900
> 9. FREEMEMORY=1846520
> 10. FREECPU=198
> 11. USEDCPU=2
> 12. NETRX=0
> 13. NETTX=0
> 14. DS\_LOCATION\_USED\_MB=5060
> 15. DS\_LOCATION\_TOTAL\_MB=97814
> 16. DS\_LOCATION\_FREE\_MB=87764
> 17. HOSTNAME=node1
> 18. VM\_POLL=YES
> 19. VERSION=“5.2.0”

I try change how collectd-client.rb execute that line but have no luck  
from  
data = `#{@run_probes_cmd} 2>&1`  
to  
data = `./../run_probes kvm-probes /var/lib/one/datastores 4124 20 1 node1 2>&1`

---

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 14, 2017, 11:58pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/8 "2017-01-14T23:58:33Z")

</div>

Issue now is solved if I change /var/tmp/one/im/run\_probe

from  
if [-x “$i”]; then

to  
if [[(-x “$i”) && ("$i" != “collectd-client.rb”)]]; then

The reason is run\_probe script will run all file in kvm.d folder. The first file it executes is collectd-client\_control.sh which execute collectd-client.rb as background process and keep PID is /tmp/one-collectd-client.pid.

It looks to me that we already run collectd-client.rb in background, so we don’t need to let run\_probe script executes collectd-client.rb again.

I am not 100% sure if this solution is the correct one. I will post consequence issue this change may caused.

---

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 15, 2017, 12:21am UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/9 "2017-01-15T00:21:16Z")

</div>

create VM in that host … ok  
host statistic … ok  
vnc to VM … ok

Look Good !!

Hi Javi - Do you think it’s a bug ?

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [January 17, 2017, 9:26am UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/10 "2017-01-17T09:26:08Z")

</div>

I don’t really understand what could be happening. We’ve been using the same system to start collectd client without problems.

Can you check that `kvm.d/collectd-client.rb` is not executable, that may be the problem. Here are the files from `kvm.d` from CentOS 7 packages.

```nohighlight
[root@scw-ceab44 kvm.d]# ls -l
total 12
-rwxr-xr-x 1 oneadmin oneadmin 2901 Oct 17 11:09 collectd-client_control.sh
-rw-r--r-- 1 oneadmin oneadmin 4151 Oct 17 11:09 collectd-client.rb

```

---

<div class="post-metadata">

**Author:** ![sutthipongl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/sutthipongl/32/4783_2.png) [@sutthipongl](https://forum.opennebula.io/u/sutthipongl)\
**Post date:** [January 17, 2017, 9:13pm UTC](https://forum.opennebula.io/t/collectd-client-rb-core-dumped/3560/11 "2017-01-17T21:13:43Z")

</div>

Hi Javi

Yes, those files are executable

> _oneadmin@master:/var/tmp/one/im/kvm.d$ ls -al_  
> _total 20_  
> _drwxr-xr-x 2 oneadmin oneadmin 4096 Jan 17 21:00 ._  
> _drwxr-xr-x 7 oneadmin oneadmin 4096 Jan 17 21:00 …_  
> _-rwxr-xr-x 1 oneadmin oneadmin 2901 Jan 17 21:00 collectd-client\_control.sh_  
> _-rwxr-xr-x 1 oneadmin oneadmin 4151 Jan 17 21:00 collectd-client.rb_

I don’t know the real root cause either. I agree that collectd-client.rb execution from run\_probe should works fine but unfortunately it’s not my case. Below is the conclusion how I fix this issue

1. run\_probe list all files in _kvm.d_ folder
2. run\_probe script executes collectd-client\_control.sh
3. collect-client\_control.sh run collectd-client.rb as background process and return
4. run\_probe execute collectd-client.rb again

The code I amend in run\_probe script removes the step 4 above and now my system run totally fine.

thanks for your help !!  
Tor.
