Open danxg87 opened 1 year ago
@danxg87 thanks for the details. can you please provide a (fake) dummy ssh key with the newline you had? we'll use this to fix the bug / validation issue
also, if you want to put up a PR to address this, we'll certainly welcome it!
@danxg87 if you will provide dummy ssh key then I would like to put up a PR
Hello @danxg87 and @KamilBlaz I'm interested to work on this task. Thanks to let me know of we have further progress :blush:
Please confirm the following
security@ansible.com
instead.)Bug Summary
Hey all,
When creating a new
Source Control
credential in AWX, we were receiving a 500 error from AWX:The AWX server logs showed a decoding error:
This was not very helpful and led me down multiple unrelated rabbit holes/issues/etc.
Ultimately, it turns out the user was supplying a VALID ssh_key, but there appear to have been newlines in it, causing us to continually get 500 errors as above every time (UI/API accepted the ssh_key_data as valid, but failed as above if there were newlines somewhere).
By trimming the ssh_key_data in our playbook and rerunning, things succeeded just fine.
It appears we have a bug either:
If someone can, please confirm the behavior as I've outlined and if it seems appropriate, add some capability to "sanitize" the ssh_key_data and/or message on detected issues with the content so end users can address that.
AWX version
21.11.0
Select the relevant components
Installation method
kubernetes
Modifications
yes
Ansible version
2.14.5
Operating system
Linux/Ubuntu
Web browser
Chrome
Steps to reproduce
GH_KEY_DATA
GH_UNLOCK_DATA
hosts: localhost connection: local gather_facts: false
tasks:
Expected results
A successfully created Source Control credential with the generated ssh_key data/passphrase.
Actual results
We get a 500 error back from AWX. AWX server logs show a padding error/no clear reason for the actual failure here, which was the key data string had "hidden characters" in it.
Additional information
No response