collectd-haproxy icon indicating copy to clipboard operation
collectd-haproxy copied to clipboard

ImportError: dynamic module does not define init function (initcsv)

Open dankeder opened this issue 9 years ago • 3 comments

The configuration example in README.md recommends to put the plugin into /usr/lib64/collectd/. This directory may contain the file csv.so (the collectd CSV plugin) which conflicts with the standard Python csv module, which is used in haproxy.py. The conflict manifests itself with the following error message in collectd logs:

python plugin: Error importing module "haproxy".
Unhandled python exception in importing module: ImportError: dynamic module does not define init function (initcsv)
Traceback (most recent call last):
File "/usr/lib64/collectd/haproxy.py", line 10, in <module>
              import csv
ImportError: dynamic module does not define init function (initcsv)
python plugin: Found a configuration for the "haproxy" plugin, but the plugin isn't loaded or didn't register a configuration callback.

Since renaming the csv.so collectd plugin is most likely not an option due to backward compatibility, the documentation here should be updated to not recommend putting the plugin into ``/usr/lib64/collectd/`.

dankeder avatar Aug 12 '15 10:08 dankeder

+1

madhur avatar Sep 24 '16 08:09 madhur

+1

smeapng avatar Oct 31 '16 12:10 smeapng

Phew, thanks for pointing that out - you've saved me some serious time.

arrkerr avatar Nov 30 '16 13:11 arrkerr