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

Error with 2 succcessive apply #18

Closed
ddup1 opened this issue Jul 15, 2022 · 5 comments
Closed

Error with 2 succcessive apply #18

ddup1 opened this issue Jul 15, 2022 · 5 comments

Comments

@ddup1
Copy link

ddup1 commented Jul 15, 2022

Hi,

After i saw that mysql provider is no more maintained by Hashicorps, i search for an alternative and begin update to tf1.1 or 1.2

I found your mysql provider that is a fork from the original provider.

The first time i launch terraform apply, my db user are well created, but if i launch a terraform apply a second time, then i got an error :

Error: Create user couldn't be parsed - it is CREATE USER myuser@% IDENTIFIED BY PASSWORD '*ABDEFGHIJKLMNOPR'

Any idea about this issue ?

I use terraform 1.1.9 and mysql provider 3.0.17.

Regards.

@ddup1
Copy link
Author

ddup1 commented Jul 15, 2022

I just check the code with the error i get and saw the regexp that is used to test if user already exist :
^CREATE USER [']([^'])']@[''] IDENTIFIED WITH ['['`] (?:AS '((?:.?[^\\\\])?)' )?REQUIRE ([^ ]*)")

I use mariadb and when i do show create user toto, i get this :
CREATE USER toto@% IDENTIFIED BY PASSWORD '*ABCDEFGHIJKLMNOPQRSTUVWXYZ'

It don't know what mysql return but i think the regexp must check both.

@petoju
Copy link
Owner

petoju commented Jul 18, 2022

@ddup1 you are right - it is an issue, because we currently test only Percona and MySQL.
Would you mind sending a patch to run tests on MariaDB and adding another regex?

I can get to this only later.

For now, you can enforce provider version 3.0.12, that didn't have such issue. That said, it was not able to read some user settings, so one could have a config drift.

@ddup1
Copy link
Author

ddup1 commented Jul 18, 2022

Hi,

Yes i was looking for it, i do some hello world in go to propose a patch for mariadb.

@petoju
Copy link
Owner

petoju commented Aug 3, 2022

@ddup1 this is fixed in 3.0.18.

@petoju petoju closed this as completed Aug 3, 2022
@ddup1
Copy link
Author

ddup1 commented Aug 4, 2022

Hi,

thanks @petoju , will try this.

On my side i try to unify regexp for maria and mysql in one regexp but fail as it change the group count.

Thanks a lot.

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