-
Notifications
You must be signed in to change notification settings - Fork 88
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
KeyError: 'type' when processing challenge error response. #651
Labels
bug
Something isn't working
Comments
There seems to be a bug in the error handling code, so you only see a crash of the error handling code instead of the actual error returned by the CA. I'll take a look at this later today... |
(Generally the module works with ZeroSSL, I renewed some test certs with them during the weekend and no modification was done to the code since then.) |
#652 should fix this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
We are getting invalid responses from ZeroSSL challenge requests, but can't tell why they are invalid. Instead, the crypto module is crashing with the below exception when trying to handle the challenge response. It looks like there just needs to be a check on type attribute here to make sure it actually exists. Maybe just print out the response body if there's not a better way to decode the error here?
Please note, this set of tasks has worked previously. This request is renewing an existing certificate, which might be related to the error. However, we can't even see the error to be sure because of this exception.
"module_stderr": "Traceback (most recent call last):
File "", line 100, in
File "", line 92, in _ansiballz_main
File "", line 41, in invoke_module
File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_community.crypto.acme_certificate_payload_2zt5rlrh/ansible_community.crypto.acme_certificate_payload.zip/ansible_collections/community/crypto/plugins/modules/acme_certificate.py", line 950, in
File "/tmp/ansible_community.crypto.acme_certificate_payload_2zt5rlrh/ansible_community.crypto.acme_certificate_payload.zip/ansible_collections/community/crypto/plugins/modules/acme_certificate.py", line 920, in main
File "/tmp/ansible_community.crypto.acme_certificate_payload_2zt5rlrh/ansible_community.crypto.acme_certificate_payload.zip/ansible_collections/community/crypto/plugins/modules/acme_certificate.py", line 766, in finish_challenges
File "/tmp/ansible_community.crypto.acme_certificate_payload_2zt5rlrh/ansible_community.crypto.acme_certificate_payload.zip/ansible_collections/community/crypto/plugins/module_utils/acme/challenges.py", line 316, in wait_for_validation
File "/tmp/ansible_community.crypto.acme_certificate_payload_2zt5rlrh/ansible_community.crypto.acme_certificate_payload.zip/ansible_collections/community/crypto/plugins/module_utils/acme/challenges.py", line 234, in raise_error
File "/tmp/ansible_community.crypto.acme_certificate_payload_2zt5rlrh/ansible_community.crypto.acme_certificate_payload.zip/ansible_collections/community/crypto/plugins/module_utils/acme/errors.py", line 30, in format_error_problem
KeyError: 'type'
ISSUE TYPE
COMPONENT NAME
community.crypto.acme_certificate
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Execution Environment based on quay.io/ansible/ansible-runner:latest
STEPS TO REPRODUCE
EXPECTED RESULTS
We should get some information about the error response here, not a traceback from the module crashing.
ACTUAL RESULTS
Module crashed with this traceback.
The text was updated successfully, but these errors were encountered: