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

Avoid test failures on CentOS caused by locale #708

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oranenj
Copy link
Contributor

@oranenj oranenj commented Apr 20, 2021

Setting en_US.UTF-8 prevents the builds from falling back to C, which
can break some tests for no good reason.

Observed with puppet-jira, at least.

Setting en_US.UTF-8 avoids the builds from falling back to C, which
can break some tests for no good reason.
@kenyon
Copy link
Member

kenyon commented Apr 26, 2021

Context: voxpupuli/puppet-jira#364

Copy link
Member

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl @trevor-vaughan do you think this makes sense / should that not be required and indicates broken code / should that be in beaker instead?

bastelfreak added a commit to bastelfreak/puppet-zabbix that referenced this pull request Apr 26, 2021
To make this work, we also enforce UTF8 for the acceptance tests. The
also voxpupuli/modulesync_config#708
bastelfreak added a commit to bastelfreak/puppet-zabbix that referenced this pull request Apr 26, 2021
To make this work, we also enforce UTF8 for the acceptance tests. The
also voxpupuli/modulesync_config#708
@ekohl
Copy link
Member

ekohl commented Apr 29, 2021

What we do in Foreman is to set the locale on the database:
https://github.com/theforeman/puppet-foreman/blob/92eb55dd9fd343417ffd7f719ba0f54fbef0bc3f/manifests/database/postgresql.pp#L24-L25

Would that actually be a better approach? Can you check if that does work?

@bastelfreak
Copy link
Member

I gave this a try in voxpupuli/puppet-zabbix#762 again. The tests fail if we don't set the locale in the workflow file. In the past I tried setting it in the postgresql module and that didn't work as well. I suggest we merge this here and roll it out to all nodes.

@ekohl
Copy link
Member

ekohl commented May 19, 2021

I still think this can mask real issues for users and because of that I'm hesitant to merge this.

@ekohl
Copy link
Member

ekohl commented May 27, 2021

So I got a bit more info now. This appears to show up more often with Puppet 7 with PostgreSQL, at least in some tests that I did. It fails on initdb which also needs locales. Right now I'm not sure what the best way to deal with this is, but at least I understand the problem better.

Trying some of these options now that I know a reproducer.

@ekohl
Copy link
Member

ekohl commented May 27, 2021

So some more info.

Puppet 5 & 6 on CentOS use LANG=C while Puppet 7 uses LANG=C.UTF-8.

Output from Puppet 6 with exec { '/usr/bin/env': logouput => true }:

centos7-64.example.com 15:04:18$ puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.T1Lmzt
  2021-05-27 15:04:18.760084 WARN  puppetlabs.facter -   locale environment variables were bad; continuing with LANG=C LC_ALL=C
  Info: Loading facts
  Info: Loading facts
  Notice: Compiled catalog for centos7-64.example.com in environment production in 0.13 seconds
  Info: Applying configuration version '1622127861'
  Notice: /Stage[main]/Main/Yumrepo[candlepin]/ensure: created
  Info: Yumrepo[candlepin](provider=inifile): changing mode of /etc/yum.repos.d/candlepin.repo from 600 to 644
  Notice: /Stage[main]/Main/Package[nmap]/ensure: created
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: MANPATH=:/opt/puppetlabs/puppet/share/man
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: XDG_SESSION_ID=2
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SHELL=/bin/bash
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SSH_CLIENT=172.17.0.1 50630 22
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: LD_LIBRARY_PATH=
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: PATH=/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: MAIL=/var/mail/root
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: ***
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: LANG=C
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SHLVL=1
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SSH_CONNECTION=172.17.0.1 50630 172.17.0.2 22
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: XDG_RUNTIME_DIR=/run/user/0
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: LC_ALL=C
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: DEBIAN_FRONTEND=noninteractive
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: APT_LISTBUGS_FRONTEND=none
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: APT_LISTCHANGES_FRONTEND=none
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: executed successfully
  Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
  Notice: Applied catalog in 34.51 seconds

The same on Puppet 7:

centos7-64.example.com 15:03:09$ puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.c7Z1uM
  Info: Loading facts
  Info: Loading facts
  Notice: Compiled catalog for centos7-64.example.com in environment production in 0.06 seconds
  Info: Applying configuration version '1622127792'
  Notice: /Stage[main]/Main/Yumrepo[candlepin]/ensure: created
  Info: Yumrepo[candlepin](provider=inifile): changing mode of /etc/yum.repos.d/candlepin.repo from 600 to 644
  Notice: /Stage[main]/Main/Package[nmap]/ensure: created
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: MANPATH=:/opt/puppetlabs/puppet/share/man
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: XDG_SESSION_ID=2
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SHELL=/bin/bash
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SSH_CLIENT=172.17.0.1 48066 22
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: LD_LIBRARY_PATH=
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: PATH=/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: MAIL=/var/mail/root
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: ***
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: LANG=C.UTF-8
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SHLVL=1
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: SSH_CONNECTION=172.17.0.1 48066 172.17.0.2 22
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: XDG_RUNTIME_DIR=/run/user/0
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: DEBIAN_FRONTEND=noninteractive
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: APT_LISTBUGS_FRONTEND=none
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: APT_LISTCHANGES_FRONTEND=none
  Notice: /Stage[main]/Main/Exec[/usr/bin/env]/returns: executed successfully
  Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
  Notice: Applied catalog in 6.19 seconds

This locale (C.UTF-8) does not exist on EL 7. https://bugzilla.redhat.com/show_bug.cgi?id=1361965#c19 also states that it won't be added due to bugs and where RHEL 7 currently (maintenance mode).

It should also be noted that the en_US.UTF-8 locale is not present by default on CentOS 8 images. Merging this would break that since we don't install glibc-langpack-en by default.

I also don't know if setting these variables here moves them into the actual system that's tested.

oraziobattaglia added a commit to oraziobattaglia/puppet-zabbix that referenced this pull request Aug 28, 2021
Added details to host network interface for SNMP

Added details to host network interface for SNMP

Added details to host network interface for SNMP

Added details to host network interface for SNMP

Added details to host network interface for SNMP

Added details to host network interface for SNMP

Added spec acceptance test for interfacetype and interfacedetails

Added context test3.example.com to acceptance test

Fix include in test3 context

Fix hash syntax in test3 context

Change template for snmp in acceptance test

Fix case for var template_snmp

Removed conflicts on templates used for snmp host test acceptance

Trying to fix interface details data types

Sub double quote with single quote in include

Trying to understand if interface details is nil

Fix trailing whitespace :-O!

Zabbix version 4.0 doesn't have the interface details hash, excluded from test

Wip (#1)

* Added details to result_hosts

* Add TODO file

* Run test specific to zabbix >= 4.0

* Add param documentation

* Fix spaces

* Remove TODO file

metadata: increase max versions of dependency modules

Enable Puppet 7 support

To make this work, we also enforce UTF8 for the acceptance tests. The
also voxpupuli/modulesync_config#708

Adjust for new option in configurations.

templateDashboards is replacing templateScreens option in 5.2+

Signed-off-by: Christos Papageorgiou <[email protected]>

Add Ubuntu 18.04 and 20.04 support

Signed-off-by: Christos Papageorgiou <[email protected]>

Enable Debian 10 acceptance tests

Signed-off-by: Christos Papageorgiou <[email protected]>

Remove packages installation before running acceptance tests

* This is already being handled by prepare_host function.

Signed-off-by: Christos Papageorgiou <[email protected]>

Allow non-default port database importing

Signed-off-by: Christos Papageorgiou <[email protected]>

Fix README regarding zbx_group(s) deprecation and fix small bug so deprecation actually work

modulesync 4.1.0

rubocop: autofix

rubocop: cleanup unused variables

beaker tests: set locale

Support sslcertlocation & sslkeylocation for zabbix proxy

Support sslcalocation for zabbix proxy

Ensure consistent use of logtype and logfile across agent/server/proxy (voxpupuli#765)

* Fix reference to camptocamp/systemd

* logfile param is now consistent across agent/server/proxy

* Add logtype param to proxy

* Add logtype to class parameters documentation

* Ensure logtype is passed to server from init and it is typed consistently

* logfile param is now consistent across agent/server/proxy

* Support sslcertlocation & sslkeylocation for zabbix proxy

* Ensure datatype for logtype and logfile in zabbix::init

Co-authored-by: Shaun Bugler - Xneelo <[email protected]>

Add ability to set $DB[DOUBLE_IEEE754] to true in zabbix.conf.php. (voxpupuli#735)

* Add ability to set $DB[DOUBLE_IEEE754] to true in zabbix.conf.php.

Zabbix 5.0 and greater enable extended range of float values.
>This is by default for new installations.
>However, when upgrading existing installations, a manual database
>upgrade patch must be applied

The $DB[DOUBLE_IEEE754] value must be set to true in zabbix.conf.php.
Otherwise, the message "Database history tables upgraded: No" will
continue to be displayed in the web frontend.
https://www.zabbix.com/documentation/5.0/manual/installation/upgrade_notes_500#enabling_extended_range_of_numeric_float_values

* Update spec/classes/web_spec.rb

* Update manifests/web.pp

Co-authored-by: Joshua Snapp <[email protected]>
Co-authored-by: Tim Meusel <[email protected]>

Allow to pass LDAP settings to zabbix class

* Also strong type ldap parameters

Signed-off-by: Christos Papageorgiou <[email protected]>

Implement additional SAML settings

Signed-off-by: Christos Papageorgiou <[email protected]>

release 9.0.0

[blacksmith] Bump version to 9.0.1-rc0

Deprecate EnableRemoteCommands

* https://www.zabbix.com/documentation/5.0/manual/appendix/config/zabbix_agentd

Signed-off-by: Christos Papageorgiou <[email protected]>

Add {Allow,Deny}Key options

Signed-off-by: Christos Papageorgiou <[email protected]>

Add {TLSCipher}* options for agent

Signed-off-by: Christos Papageorgiou <[email protected]>

Add DBTLS options

Signed-off-by: Christos Papageorgiou <[email protected]>

Add {TLSCipher}* options for proxy/server

Add StartAlerters option

Signed-off-by: Christos Papageorgiou <[email protected]>

Add StartEscalators option

Signed-off-by: Christos Papageorgiou <[email protected]>

Add StartLLDProcessors option

Signed-off-by: Christos Papageorgiou <[email protected]>

Add StartPreprocessors option

Signed-off-by: Christos Papageorgiou <[email protected]>

Optimize acceptance tests

Signed-off-by: Christos Papageorgiou <[email protected]>

switch from camptocamp/systemd to voxpupuli/systemd

Ensure correct logfile/logfilesize values when defaulting logtype to system

Signed-off-by: Christos Papageorgiou <[email protected]>

Add Vault parameters to server

Signed-off-by: Christos Papageorgiou <[email protected]>

Add Vault parameters to proxy

Signed-off-by: Christos Papageorgiou <[email protected]>

[temp] Pass ignore_version parameter to zabbixapi

* Don't fail if version is not supported by the gem, until the gem has been updated for zabbix 5.4

Signed-off-by: Christos Papageorgiou <[email protected]>

Drop zabbix_application support for zabbix 5.4

* Zabbix applications were replaced with Item tags in version 5.4
* applications and screens parameters were removed from configurations.import
* selectApplications parameter was removed from templates.get in version 5.4

Source: https://www.zabbix.com/documentation/5.4/manual/api/changes_5.2_-_5.4

Signed-off-by: Christos Papageorgiou <[email protected]>

Add supported_versions helper

Signed-off-by: Christos Papageorgiou <[email protected]>

Add zabbix-sql-scripts installation/zabbix server 5.4 is not supported on RHEL7

* zabbix 5.4 changed the location of the sql scripts, now there's a standalone package called zabbix-sql-scripts which installs the scripts in `/usr/share/doc/zabbix-sql-scripts/*

Signed-off-by: Christos Papageorgiou <[email protected]>

RHEL7 needs scl packages and on 5.4 version

Signed-off-by: Christos Papageorgiou <[email protected]>

Release 9.1.0

[blacksmith] Bump version to 9.1.1-rc0

Update README.md with new badges/transfer notice

modulesync 4.1.0

Use puppet-strings annotations/Generate REFERENCE.md

Signed-off-by: Christos Papageorgiou <[email protected]>

Drop Reference from README

Signed-off-by: Christos Papageorgiou <[email protected]>

Modulesync 4.2.0

Fix suggested
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

Successfully merging this pull request may close these issues.

4 participants