Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LVM plugin breaks with russian locale #3181

Closed
Self-Perfection opened this issue Jun 18, 2019 · 7 comments
Closed

LVM plugin breaks with russian locale #3181

Self-Perfection opened this issue Jun 18, 2019 · 7 comments

Comments

@Self-Perfection
Copy link
Contributor

  • Version of collectd: 5.8.1
  • Operating system / distribution: Arch linux

Expected behavior

Collectd should collect data regardless of locale.

Actual behavior

When running with LANG=ru_RU.UTF-8 in envirnoment and enabling LVM plugin collectd can't create rrd files for LVM plugin data.

Steps to reproduce

  • Make sure there is no rrd files for LVm plugin
  • uncomment LVM plugin in config and run collectd as LANG=ru_RU.UTF-8 collectd
  • Observe in logs something like:
июн 19 00:43:29 lvm[15599]: Filter subsystem: Built-in target `write': Dispatching value to all write plugins failed with status -1.
июн 19 00:43:29 lvm[15599]: rrdtool plugin: rrd_create_r (localhost.localdomain/lvm-vg01/df_complex-root.rrd) failed: parsing min val - Converted '0,000000' to 0,000000, but cannot convert ',000000'
июн 19 00:43:29 lvm[15599]: cu_rrd_create_file: srrd_create (localhost.localdomain/lvm-vg01/df_complex-root.rrd) returned status -1.

Looks like locale-aware function is used somewhere to dispatch value from LVM plugin,

@rpv-tomsk
Copy link
Contributor

rpv-tomsk commented Jun 21, 2019

Solution: Don't start Collectd with russian locale.
Other patches are welcome too.

@Self-Perfection
Copy link
Contributor Author

I'd rather say this is a workaround. I'd like to stress that user might quite easily bump into this issue with normally configured system. Setting system-wide locale is a standard and documented practice. And systemd passes LANG environment variable to running daemons (one may check with strings /proc/$(pidof collectd)/environ).

So I had to add extra config to avoid this:

cat /etc/systemd/system/collectd.service.d/override.conf
[Service]
# collectd lvm plugin seems to break on number format with russian locale
# See https://github.com/collectd/collectd/issues/3181

UnsetEnvironment=LANG

@rpv-tomsk
Copy link
Contributor

I'd rather say this is a workaround.

Ok, patches are welcome.

@rpv-tomsk rpv-tomsk reopened this Jul 12, 2019
@rpv-tomsk
Copy link
Contributor

rpv-tomsk commented Jul 12, 2019

The cause was found: 865f2eb#diff-67e997bcfdac55191033d57a16d1408a and patch will be published soon. Maybe, somedays it will be merged into master.

Thanks for reporting this.
Thanks for using Collectd.

rpv-tomsk added a commit to rpv-tomsk/collectd that referenced this issue Jul 12, 2019
limits.h check removed in 865f2eb
limits.h included in src/daemon/collectd.h unconditionally

Issue: collectd#3181
rpv-tomsk added a commit to rpv-tomsk/collectd that referenced this issue Jul 12, 2019
rpv-tomsk added a commit to rpv-tomsk/collectd that referenced this issue Jul 13, 2019
limits.h check removed in 865f2eb
limits.h included in src/daemon/collectd.h unconditionally

Issue: collectd#3181
rpv-tomsk added a commit to rpv-tomsk/collectd that referenced this issue Jul 13, 2019
@rpv-tomsk
Copy link
Contributor

As I see, Team committed my PR.

Unfortunately, they don't care about this issue so it was not closed. :-(

@Self-Perfection
Copy link
Contributor Author

All right, let's close this, if you believe that fix is committed.

@Self-Perfection
Copy link
Contributor Author

Yup, indeed fixed. Could not reproduce with collectd 5.9.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants