-
Notifications
You must be signed in to change notification settings - Fork 32
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
Inventory failure IncompleteRead #406
Comments
I'm not sure this error is the same as the issues you linked. The standard modules and the lookup module use pynautobot, which has the Secondly, HTTP or Connection errors should raise during the section of the code above where your error got raised: nautobot-ansible/plugins/inventory/inventory.py Lines 296 to 305 in 900395a
This leads me to believe it got a response, but the response was incomplete in some way. So, not as an easy fix as just enabling retries. Not impossible, but will probably take extra work to implement. |
You're right, it's probably not linked to the mentioned issue I checked the Retry from urllib3 and in fact it does not behave with IncompleteRead exeception So somehow sometimes fetching the api spec at https://nautobot.xxx/api/docs/?format=openapi will return an IncompleteRead I'll try solve the issue at the core meaning Nautobot API response, unsure where to look at tho (timeout ?) |
I'm not 100% sure yet, but it appears that the Inventory plugin timeout default theoretical 60s value is not set anywhere in https://github.com/nautobot/nautobot-ansible/blob/develop/plugins/inventory/inventory.py and relies on |
The default 60s is indeed set on the documentation on line 169. Inventory plugins are "documentable" plugins meaning the options are set automatically via the yaml styled documentation rather than needing to set them in python like you do for standard ansible modules. I was able to confirm this by adding the following line to my local dev environment: self.timeout = self.get_option("timeout")
self.display.v("timeout: %s" % self.timeout) And then I was able to see it in the output: # inventory.yml
---
plugin: networktocode.nautobot.inventory
api_endpoint: https://demo.nautobot.com/
token: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
ISSUE TYPE
SOFTWARE VERSIONS
pynautobot
2.2.1
Ansible:
2.15.9
Nautobot:
2.2.6
Collection:
networktocode.nautobot 5.2.1
SUMMARY
AWX inventory sync randomly fails
STEPS TO REPRODUCE
EXPECTED RESULTS
Based on idea from #367, might be a good idea to add a retry on error in
fetch_api_docs
like in #338 for lookupACTUAL RESULTS
The text was updated successfully, but these errors were encountered: