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

Mysql charset (utf8) and collate (utf8_bin) not idempotent #832

Closed
xchotard-talentsoft opened this issue Aug 3, 2022 · 1 comment · Fixed by #842
Closed

Mysql charset (utf8) and collate (utf8_bin) not idempotent #832

xchotard-talentsoft opened this issue Aug 3, 2022 · 1 comment · Fixed by #842

Comments

@xchotard-talentsoft
Copy link
Contributor

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.27.1-1focal
  • Ruby: 2.5.9p229
  • Distribution: Ubuntu 20.04
  • Module version: v9.2.0

How to reproduce (e.g Puppet code you use)

class { 'apache':
  mpm_module => 'prefork',
}

class { 'apache::mod::php': }

class { 'mysql::server': }

class { 'zabbix':
  zabbix_url    => 'zabbix.example.com',
  database_type => 'mysql',
}

What are you seeing

At each Puppet agent execution, the following changes are reported:

Notice: /Stage[main]/Zabbix::Database/Mysql::Db[zabbix_server]/Mysql_database[zabbix_server]/charset: charset changed 'utf8mb3' to 'utf8' (corrective)
Notice: /Stage[main]/Zabbix::Database/Mysql::Db[zabbix_server]/Mysql_database[zabbix_server]/collate: collate changed 'utf8mb3_bin' to 'utf8_bin' (corrective)

What behaviour did you expect instead

The charset/collate changes should not be corrected at each run.

Output log

Any additional information you'd like to impart

This issue is very similar to: https://tickets.puppetlabs.com/browse/IAC-1612

As a workaround, it is possible to replace utf8 by utf8mb4 and utf8_bin by utf8mb4_unicode_ci in manifests/params.pp:

-  $server_database_charset                  = 'utf8'
-  $server_database_collate                  = 'utf8_bin'
+  $server_database_charset                  = 'utf8mb4'
+  $server_database_collate                  = 'utf8mb4_unicode_ci'

Being able to pass charset and collate parameters to the zabbix::server and zabbix::proxy classes would also be a nice addition.

This behavior depends on MySQL-Server version.

@john275
Copy link

john275 commented Oct 3, 2022

Can we get a 9.2.1 release for this fix 🙏

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 a pull request may close this issue.

2 participants