Mantis - collectd_plugin_python
Viewing Issue Advanced Details
5255 major always 2015-10-22 00:01 2016-10-08 22:31
omen Solaris  
dam OmniOS  
normal v11 r151014  
closed  
suspended  
none    
none  
0005255: Unable to load Python plugin
I am unable to use the python plugin in collectd. I get the following error:
lt_dlopen ("/opt/csw/lib/collectd/python.so") failed: file not found. The most common cause for this problem is missing dependencies. Use ldd(1) to check the dependencies of the plugin / shared object.
plugin_load: Load plugin "python" failed with status 1.

The problem seems to be that collectd cannot load any of the 32 bit plugins (in /opt/csw/lib/collectd/) but the collectd_plugin_python package provides no 64 bit plugin in /opt/csw/lib/64/collectd .
Install the collectd and collectd_plugin_python plugins.

Extract the contents of the attached collectd-conf.tar.gz to /etc/opt/csw .

Try to run collectd: collectd -C /etc/opt/csw/collectd.conf -t

It will die with the above error.
From a truss the error appears to be in the mmapobj call:

2843: stat("/opt/csw/lib/collectd/python.so", 0xFFFFFD7FFFDFE320) = 0
2843: resolvepath("/opt/csw/lib/collectd/python.so", "/opt/csw/lib/collectd/python.so", 1023) = 31
2843: open("/opt/csw/lib/collectd/python.so", O_RDONLY) = 4
2843: mmapobj(4, MMOBJ_INTERPRET, 0xFFFFFD7FFF140DF8, 0xFFFFFD7FFFDFDE7C, 0x00000000) Err#48 ENOTSUP
2843: mmap(0x00000000, 4096, PROT_READ, MAP_PRIVATE, 4, 0) = 0xFFFFFD7FFF130000
2843: munmap(0xFFFFFD7FFF130000, 4096) = 0
2843: close(4) = 0
2843: open("/usr/lib/locale/en_US.UTF-8/LC_MESSAGES/SUNW_OST_SGS.mo", O_RDONLY) Err#2 ENOENT
2843: fstat(2, 0xFFFFFD7FFFDFD340) = 0
lt_dlopen ("/opt/csw/lib/collectd/python.so") failed: file not found. The most common cause for this problem is missing dependencies. Use ldd(1) to check the dependencies of the plugin / shared object.2843: write(2, " l t _ d l o p e n ( "".., 201) = 201

The error suggests running ldd, which shows no issues:
root@zaphod.lawr.ucdavis.edu:/etc/opt/csw# ldd "/opt/csw/lib/collectd/python.so"
        libpython2.7.so.1.0 => /opt/csw/lib/i386/libpython2.7.so.1.0
        libgcc_s.so.1 => /opt/csw/lib/i386/libgcc_s.so.1
        libc.so.1 => /lib/libc.so.1
        libsocket.so.1 => /lib/libsocket.so.1
        libnsl.so.1 => /lib/libnsl.so.1
        librt.so.1 => /lib/librt.so.1
        libdl.so.1 => /lib/libdl.so.1
        libm.so.2 => /lib/libm.so.2
        libmp.so.2 => /lib/libmp.so.2
        libmd.so.1 => /lib/libmd.so.1
related to 0003054new  python Add 64-bit support 
gz file icon collectd-conf.tar.gz [^] (519 bytes) 2015-10-22 00:01
gz file icon collectd-conf-2.tar.gz [^] (750 bytes) 2015-10-23 01:44
Issue History
2015-10-22 00:01 omen New Issue
2015-10-22 00:01 omen File Added: collectd-conf.tar.gz
2015-10-22 13:17 dam Status new => assigned
2015-10-22 13:17 dam Assigned To => dam
2015-10-22 13:21 dam Note Added: 0011071
2015-10-22 21:30 omen Note Added: 0011072
2015-10-23 01:44 omen File Added: collectd-conf-2.tar.gz
2015-10-23 01:45 omen Note Added: 0011073
2015-10-23 08:59 dam Note Added: 0011074
2015-10-23 18:09 omen Note Added: 0011075
2016-10-08 22:30 dam Relationship added related to 0003054
2016-10-08 22:31 dam Note Added: 0011197
2016-10-08 22:31 dam Status assigned => closed
2016-10-08 22:31 dam Resolution open => suspended

Notes
(0011071)
dam   
2015-10-22 13:21   
Yes, this is true. You cannot use 32 bit modules for 64 bit binaries.
Unfortunately we don't have 64 bit Python as the configuration is not supported by upstream and nobody had the time to fix it.
You can run a separate 32 bit instance of CollectD with the plugin by calling it explicitly
by editing the SMF script /var/opt/csw/svc/method/svc-cswcollectd or call
/opt/csw/sbin/<sparcv8plus|pentium_pro>/collectdmon explicitly.

It would be nice to have a way to explicitly enable 32 and 64 bit daemons separately in SMF but that is not finished yet.
(0011072)
omen   
2015-10-22 21:30   
Awesome, that works. Thanks! Did I miss an FAQ or an install note somewhere? If not, it would be a nice thing to add.

root@zap:~# /opt/csw/sbin/pentium_pro/collectd -C /etc/opt/csw/collectd.conf -t
interfaces [verbose]: Configured with Verbose = True

Looks like you can close this ticket. I appreciate the help.
(0011073)
omen   
2015-10-23 01:45   
Err, now I'm getting core dumps by collectd:
root@zap:~# /opt/csw/sbin/pentium_pro/collectd -C /etc/opt/csw/collectd.conf -f
Initialization complete, entering read-loop.
kstat chain has been updated
Fatal Python error: PyEval_SaveThread: NULL tstate
Abort (core dumped)

You can recreate by using the new config I uploaded (collectd-conf-2.tar.gz) and run collectd as above. It crashes on the second loop (after 10 seconds). Looks like an upstream issue with collectd: https://github.com/collectd/collectd/issues/864 [^] .
(0011074)
dam   
2015-10-23 08:59   
This is expected: as you run a 64 bit kernel you need a 64 bit application to access kstat. You need to run one CollectD instance in 32 bit for the embedded Python (where you can't access kstat) and a 64 bit CollectD instance where you can access kstat but not Python.

I know it would be best to have a 64 bit Python, but it is just not done yet.
(0011075)
omen   
2015-10-23 18:09   
Ah, I see. That makes it a little trickier. Thanks for letting me know, and you can probably close this ticket now.

Thanks for all the help.
(0011197)
dam   
2016-10-08 22:31   
Just FYI: the long-standing python 64 bug is 0003054