Skip to content

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

Closed
@gmenuel

Description

@gmenuel

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[[email protected]]['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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions