Skip to content

Creating user with mysql::db failed on version 16 #1652

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

Closed
gmenuel opened this issue Oct 11, 2024 · 1 comment
Closed

Creating user with mysql::db failed on version 16 #1652

gmenuel opened this issue Oct 11, 2024 · 1 comment

Comments

@gmenuel
Copy link

gmenuel commented Oct 11, 2024

Describe the Bug

When upgrading from v14 to v16, I've encountered the following error:

Error: /Stage[main]/Profile::Test/Mysql::Db[test]/Mysql_user[test@localhost]/password_hash: change from [old password hash redacted] to [new password hash redacted] failed: Only mysql_native_password (*ABCD...XXX) hashes are supported.

I think that this problem only occurs when using a Puppet server.

Expected Behavior

The password should not be changed since the configuration didn't change, and the run must be successful.

Steps to Reproduce

Add a configuration like:

mysql::db { 'test_db':
  user     => 'test_user',
  password => 'test_password',
}

Environment

  • Debian 12
  • mysql module 16.0.0
  • Puppet 7.29.1

Additional Context

This seems to be caused by #1569 . While investigating the bug, I've noticed that in the puppetserver log we have:

Puppet Mysql_user[test@127.0.0.1]['password_hash'] contains a Deferred value. It will be converted to the String 'Deferred({'name' => 'mysql::password', 'arguments' => ['XXXXXXXXXXXX']})

I think that this problem is caused by using ensure_resource with a parameter containing a Deferred function :

ensure_resource('mysql_user', "${user}@${host}", $user_resource)

@gmenuel
Copy link
Author

gmenuel commented Oct 11, 2024

I've figured out that we have in our Puppet configuration :

preferred_serialization_format = pson

Removing this line fix the problem. Sorry for the bother.

@gmenuel gmenuel closed this as completed Oct 11, 2024
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

1 participant