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
module_utils/mysql: Fixing unexpected keyword argument 'cursorclass' error after migratio… #47809
Conversation
Hi @timorunge, thank you for submitting this pull-request! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@gundalow Oh, sorry I didn't notice this PR earlier. But unfortunaly no. I'm getting the same error as in #47736 Not familiar how Ansible dev versions are best installed but I installed it manually into a Python 3 virtual env using the
|
Applying patch from #47809 (https://patch-diff.githubusercontent.com/raw/ansible/ansible/pull/47809.patch) not worked for me.
|
@epeli: Can you send me some verbose output? @anniemelen: If this is the actual output I think your problem is now different to the one which is described in this PR: |
@timorunge Yes, it's actual and related to #47736. |
@anniemelen: Sorry, didn't notice that. Can you send me some verbose output? |
@timorunge Unfortunately, this is all. Other information in '-vvvvv' mode is related to establishing SSH connection.
Task:
|
@timorunge Here's the verbose output with https://gist.github.com/epeli/cad6e4c7b4f380816c63f164b865eaa7 |
@anniemelen, @epeli: I've rechecked everything on my side locally - before applying the patch and afterwards. Everything is working fine for me in a similar setup (just testing the MySQL connection itself): python 2.7:
python 3.6:
Since both of you are facing problems with setting a root password for MySQL itself:
|
Actually yes. The intention was to require one... I must re-check this on monday.
Yes. I'll get back to the other questions on monday as well. |
Yes.
Yes.
As you can see above, it's already disabled. #47809 (comment)
Yes, and it works. But the point of task is to initiate standard mysql_secure_installation procedure and set root password when it's not set by default. |
@anniemelen: If adding different mysql users is possible with this patch / not failing with the message which is described in this ticket the issues are not related. You're also mentioning Ansible 2.4.4 (here) and 2.7.0 (in 47736). If you can provide a Dockerfile to re-produce this issue I'm happy to help you further but I think this PR is the wrong place for this. :) |
This fix was very helpful for me. |
Code LGTM - I couldn't reproduce the initial issue in the first place, so can't test the fix here, but the logic seems reasonable. shipit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, did not test.
+label shipit |
bot_status |
Ansibullbot is current taking a nap. Thanks to everybody that's help with this, merged. |
If you'd like this fixed in Ansible 2.7 feel free to raise a backport PR. |
Github newbie trying to understand what's going on here. Is this fix going to make it into 2.7.9 (if there is one) and/or 2.8? I applied the code to my Ansible installation and it did fix the error I was receiving. |
@dsjagoda it will definitely be in 2.8; it will only be in 2.7.9 (or later) if someone creates a backport PR for this. I don't know how active the mysql WG is, can someone from them comment on this? |
It should go along with #53445 (which needs to be merged). |
@felixfontein I seem to be the only one for now |
@timorunge are you interested in becoming part of the mysql WG? (https://github.com/ansible/community/wiki/MySQL) |
If nobody is taking it, I took the 5 minutes: #53483 :) |
@felixfontein I rarely have time (or basically just some spare time). |
@timorunge that's a known problem, I guess most people here have it ;) Also, the number of people in a WG doesn't say that much, it depends on how many people are actively doing something. It looks that for the mysql WG, it's mainly @bmalynovytch. So you could also become another idling member ;) Being in the WG also has the advantage that you're pinged for all MySQL-related PRs and issues. If you can comment from time to time, or help reproducing something or can test PRs whether they do as promised, that would probably already be a great help. If you don't want to spend that time on this, I understand, I was just asking since you seem to be somewhat interested :) |
…n from MySQLdb to PyMySQL
SUMMARY
With Ansible 2.7.1 and the migration from MySQLdb to PyMySQL all my MySQL related tasks failed since the call
db_connection.cursor(cursorclass=mysql_driver.cursors.DictCursor)
is trying to trigger https://github.com/PyMySQL/PyMySQL/blob/v0.9.2/pymysql/connections.py#L483 which has no argument cursorclass.ISSUE TYPE
COMPONENT NAME
module_utils/mysql.py
ANSIBLE VERSION