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
winrm: can't login with russian symbols #21183
Comments
Is your control machine configured to use a UTF8 locale? |
Yes. My control machine configure to use UTF8. |
I doesn't look like you are getting a winrm connection (still trying ssh I think). Also please try running ansible 192.168.40.105 -u Админ -m win_ping -vvv (this should show connection type and give information on how far it is getting) needs_info |
I got this stage already. If I try to do something with account created with english letters, then I works fine (e.g. "ansible 192.168.40.105 -u admin -m win_ping -vvv"). But it fails if account name contains russian symbols. |
Please can you run with -vvvvv and copy the output here as this will help work out where the problem is. Many thanks, needs_info |
root@ansible: ansible 192.168.40.105 -u test_admin -m win_ping 192.168.40.105 | UNREACHABLE! => { |
Sorry. I have posted same image double time. |
Hello! Do you have a solution? |
So it looks like the point where it is failing is in requests library where it attempts to create the Authorization header by base64 encoding the username and password def _basic_auth_str(username, password):
"""Returns a Basic Auth string."""
authstr = 'Basic ' + to_native_string(
b64encode(('%s:%s' % (username, password)).encode('latin1')).strip()
)
return authstr So I think the issue is really an issue with requests, not ansible, and would need raising on their bug tracking system. |
I looked a bit more at this.
I suggest you raise the issue on the requests issue tracker here: https://github.com/kennethreitz/requests/issues Because the problem lies outside ansible I am going to close this issue. |
Thank you kindly |
ISSUE TYPE
Bug Report
COMPONENT NAME
Ansible
ANSIBLE VERSION
ansible 2.2.0.1
CONFIGURATION
not any special configuration
OS / ENVIRONMENT
control machine: debian jessy minimal
remote machine: Windows 2012 R2
SUMMARY
running:
ansible 192.168.40.105 -u Админ -m win_ping
result:
192.168.40.105 | UNREACHABLE! => {
"changed": false,
"msg": "ssl: 'latin-1' codec can't encode characters in position 0-4: ordinal not in range(256)",
"unreachable": true
}
STEPS TO REPRODUCE
Create accout on Windows 2012 R2 with name Админ (russian letters).
EXPECTED RESULTS
Pass authentication.
The text was updated successfully, but these errors were encountered: