Skip to content

Retry in conjur_variable lookup not working for errors out of urllib_error.HTTPError or socket.timeout #202

Description

@stiplo

Summary

Error 111 - Connection refused is raised immediatly without retry during secret retrieval due to no handling for this exception in

def retry(retries, retry_interval):

Same issues occur for other kind of errors out of urllib_error.HTTPError or socket.timeout already handled.

Could you add a default base Exception to let the retry perform the secret retrieval when the retry_count is not reached ?

Thanks for your support.

Steps to Reproduce

  • Having Conjur serving server returning Error 111 - Connection refused frequently.
  • Running several times the lookup conjur_variable to retrieve a host password on this Conjur server until the error is encountered.

Expected Results

Keep retrying to get the host password until the retry_count is reached even when Error 111 - Connection refused is encountered.

Actual Results

Lookup fails immediatly with message:

"msg": "An unhandled exception occurred while running the lookup plugin 'cyberark.conjur.conjur_variable'. Error was a <class 'urllib.error.URLError'>, original message: <urlopen error [Errno 111] Connection refused>. <urlopen error [Errno 111] Connection refused>"

Reproducible

  • Sometimes

Version/Tag number

v1.2.0

Environment setup

Ansible Automation Platform v2.4 On Premise
Ansible [core 2.15.0]

Conjur Pods On Premise with 2 active nodes seems to increase the number of connection refused versus 1 active - 1 passive node.

Additional Information

In same parameters_wrapper method: missing alias 'e' in

except socket.timeout:
if retry_count >= retries:
raise e

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions