-
Notifications
You must be signed in to change notification settings - Fork 335
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
azure_rm inventory batch_fetch not working in v1.19.0 #1328
Comments
@chipselden I have repeatedly tested on my environment and have not encountered the problem you submitted? No matter whether batch_fetch is true or false, it can be returned normally. Could you please help confirm the situation and problems on your side? Thank you! |
@Fred-sun - Thanks for looking into this. I think the error also depends on the azure subscription having enough VMs in it so that the resulting calls are large enough for pagination to be needed. The account where I've observed the bug has 70+ VMs. In a smaller account I have access to (8 VMs), the inventory plugin works fine no matter if batch_fetch is enabled or disabled. |
@chipselden Thank you for your feedback! Will I look into the matter again? |
Hi; I am also observing this issue presented by @chipselden - exactly the same details. I have my original venv with azure.azcollection 1.16.0 working fine, but a second venv with azure.azcollection 1.19.0 which fails against the same subscription with 11 (or more) VMs in the resource group (batch_fetch is not explicitly defined, and is presumably defaulting to true). Doing either of the following results in the 1.19.0 code working: neither are long term solutions.
@Fred-sun - in answer to your question - yes please; Add more VMs to trigger the behaviour. |
@rick-ha @mystery-rabbit Thanks for your feedback! I will retry it! |
I am also facing the same issue. We have 500+ VMs and as of now, the workaround is found to be setting |
@chipselden @vijayreddiar I've found out why, and I'm trying to fix it. Thank you! |
I also got this error. I added print(response)
print(response.body()) to
So it seems in some cases the API doesn't return data which leads to a JSON decode error. In my case it seems to be related to having different subscriptions for different VMs. |
I've also got this issue from 22 out of 55 azure tenant imports. Setting the |
Fixes by #1344 |
Can confirm that I was having the same issue, and manually applying the code in the PR fixes it for me (even with batch_mode: true). |
@harCamConsulting Thanks for your feedback! I will push for merge as soon as possible! |
SUMMARY
After upgrading my azure collection from 1.18.1 to 1.19.0, a dynamic inventory I've been using stopped working. The error seems to have to do with the
batch_fetch
functionality when running against an Azure subscription with many VMs. I'm seeing this behavior with a subscription that has 71 VMs, but not seeing it with one that has 8 VMs. The issue doesn't happen with v1.18.1 of the azure collection.ISSUE TYPE
COMPONENT NAME
azure.azcollection.azure_rm inventory – Azure Resource Manager inventory plugin
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
The machine I'm running ansible from is macOS Ventura. I have also seen this issue when running through AWX in a Centos Execution Environment.
STEPS TO REPRODUCE
ansible.cfg
file belowazure_rm.yml
inventory file belowbatch_fetch: true
which is the defaultaz login
generate inventory
command below --> FAILSbatch_fetch
tofalse
inazure_rm.yml
generate inventory
command below --> SUCCEEDSEXPECTED RESULTS
The inventory file to parse without error.
ACTUAL RESULTS
The inventory file fails to parse due to a json decoding issue during the second execution of the _send_batch method from _process_queue_batch. The response body from the second call is an empty byte string.
The text was updated successfully, but these errors were encountered: