-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Paramiko crashes if a non-ascii character is used in the root password when running the playbook with -K #16557
Comments
Contributing... I got the same issue by using non-ascii characters in a private key path. ANSIBLE VERSION2.0.0.2 installed via apt-get CONFIGURATIONThe default one. OS / ENVIRONMENTXubuntu 16.04.1 LTS 64 bits SUMMARYAs previously reported, using --private-key instead of -K. STEPS TO REPRODUCERun any playbook, using a path containing non-ascii characters as the --private-key option argument. For instance: $ ansible-playbook -i inventory.txt all -m ping --private-key=/home/bruno/Segurança/Chaves/master.pem The "ç" in "Segurança" is a non-ascii character. EXPECTED RESULTSI expected the playbook to execute without errors or crashes. ACTUAL RESULTSI got the following error: $ ansible -i inventory.txt all -m ping --sudo --private-key=/home/bruno/Segurança/Chaves/professional/master.pem An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 19: ordinal not in range(128) |
@halfer, this appears to be fixed in devel and stable-2.2 branches:
@brunitto That appears to be a different problem. If is still occurring, please file a new ticket so we can track and fix it. We'll need the traceback to figure out where the error is occurring. Use the -vvv switch to run ansible in verbose mode to get that. Thanks! |
After fixing the local connection for the same error, I dug around in this a little more and found that the code looks like it should still fail in devel and stable-2.2 but I was unable to reproduce on my laptop. I switched to an ubuntu14 virtual machine and the error still occurred on devel. Seeing if the same fix as I implemented for local connection will work for paramiko. |
Fixes for non-ascii passwords on * both python2 and python3, * local and paramiko_ssh (ssh tested working with these changes) * sudo and su Fixes ansible#16557
Fixes for non-ascii passwords on * both python2 and python3, * local and paramiko_ssh (ssh tested working with these changes) * sudo and su Fixes #16557
Fix turned out to be a little bigger as there were also some python3 bugs lurking in there. #18045 should fix sudo and su on local and paramiko (ssh already worked) for py2 and py3. Complete fix is in devel and stable-2.2. The nonascii become on paramiko portion extracted and cherry-picked to stable-2.1 as well. If all goes well, the releases with the fix in it should end up being Ansible-2.1.3 and Ansible-2.2.0. |
Lovely, thanks for your efforts @abadger. I seem to recall I discovered a workaround at the time of making the above report, but it's great to see it is being resolved. |
Fixes for non-ascii passwords on * both python2 and python3, * local and paramiko_ssh (ssh tested working with these changes) * sudo and su Fixes ansible#16557 (cherry picked from commit f24c10c)
ISSUE TYPE
ANSIBLE VERSION
Ansible is installed from Github:
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 14.04
Python 2.7.6
Paramiko from
apt-get
:SUMMARY
Using Paramiko as an SSH transport layer, with a
-K
root password containing a£
pound sign causes a Python crash in Paramiko.STEPS TO REPRODUCE
I call my playbook with
ansible-playbook -K ansible/fetch-database.yml
. More details in this post.EXPECTED RESULTS
I expected the playbook to execute without errors or crashes. The password is correct, and using the default SSH transport, it seems to work fine. (I had originally swapped to Paramiko as the default transport was hanging upon successful
su
, but a pull on the Ansible repo fixed that, so I have swapped back).ACTUAL RESULTS
Upon encountering the
su
code, I get this crash inside Paramiko:It is possible that this would be solved with a bleeding-edge install of Paramiko. If you'd like me to install that in order to try it, please let me know how to do that - I'm just using the version in Ubuntu at the moment.
The text was updated successfully, but these errors were encountered: