Open chris-tomkins-flexgrid opened 4 months ago
I believe using ansible retries
should work. Can you try that?
We also have a retries
arg on pynautobot, but we don't expose it (outside of the lookup plugin) in lieu of the built-in ansible retry option.
Thanks. It's undesirable to add this to every single play (as any of them could be vulnerable to the issue), but I'll investigate if we can somehow do it globally.
One possible solution I would suggest would be to add the ability to ingest the number of retries on pynautobot via an environment variable (e.g. PYNAUTOBOT_RETRIES).
ISSUE TYPE
SOFTWARE VERSIONS
pynautobot
pip freeze | grep pynautobot pynautobot==2.2.0
Ansible:
ansible --version ansible [core 2.16.0] config file = /root/flexgrid-netbuild/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3) jinja version = 3.1.2 libyaml = True
Nautobot:
2.2.6
Collection:
ansible-galaxy collection list | grep nautobot networktocode.nautobot 5.2.1
SUMMARY
We have runs that make hundreds of API calls to Nautobot. Extremely rarely, these fail with ConnectionError, which causes the entire run to appear to have failed, causing reporting issues.
STEPS TO REPRODUCE
EXPECTED RESULTS
(this is what I see almost all times)
ACTUAL RESULTS
error scenario (very approximately 1 in 1000 calls):
Running the exact same command again will result in a successful run.
This happens regardless of whether the API call was going to make any actual change.