-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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 modules need support for left/right single quotes #67358
Comments
Files identified in the description:
If these files are inaccurate, please update the |
@Sneedes, just so you are aware we have a dedicated Working Group for azure. |
@sNeeds Thank you for taking the time to report this problem. Could you share your playbook (test case)? I will retest and it will be very helpful to solve this problem, thank you! |
At the moment, I cannot re-test/confirm this issue. The subscription/resource groups that I have access to now all have currently all have sufficiently sized quotas for Total Regional vCPUs and Standard DSv2 Family vCPUs. These quotas were increased once we found the root cause to failed Azure VM deployments from Ansible. In order to test/confirm, one would need to attempt to provision a new VM via the azure_rm_virtualmachine module that exceeds either the Total Regional vCPUs or Standard DSv2 Family vCPUs values. I do not have the access/rights to setup a new subscription/resource group with a very small quota where I could easily exceed the Azure quotas. Azure Portal > Select Desired Subscription > Usage + Quotas > Provider = Microsoft.Compute The error messages / output / return codes from Azure contain smart quotes. These non-ASCII characters cause the Ansible module to fail unexpectedly. An example snippet of Ansible to provision a VM would be something along the lines of:
|
I suspect this will hit every Azure module, not just the azure_rm_virtualmachine module. Azure error messages don't appear to have any guarantee to only contain ASCII characters in the output/error messages. |
Hi, same problem here. When I reach the quota:
|
@haiyuazhang Can you help me with this problem when you are free? I tried to find the reason, but I couldn't. Thank you very much! |
@Sneedes Thank you very much for your interest in Ansible. This repo is no longer maintained in this repository and has been migrated to https://github.com/ansible-collections/azure |
I was able to reproduce this problem using the scale set module - if you try and spin up 3 or 4 of these scale sets in an Azure Subscription, you'll probably hit the quota issue...
The full traceback is:
Running this command from cli: I get this response:
|
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
For further information, please see: |
SUMMARY
Utilizing the azure_rm_virtualmachine module.
Receive the following error from Ansible in the stderr:
UnicodeEncodeError: 'ascii' codec can't encode character u'\\\\u2018' in position 596: ordinal not in range(128)\\n
Noting that the actual Azure error message reported is believed to be along the lines of:
Operation could not be completed as it results in exceeding approved Total Regional Cores quota. Additional details - Deployment Model: Resource Manager, Location: eastus, Current Limit: 350, Current Usage: 346, Additional Required: 8, (Minimum) New Limit Required: 354. Submit a request for Quota increase at https://aka.ms/ProdportalCRP/?#create/Microsoft.Support/Parameters/%7B%22subId%22:%222b66c83b-5e20-4ee0-a2e2-4ba091559f95%22,%22pesId%22:%2206bfd9d3-516b-d5c6-5802-169c800dec89%22,%22supportTopicId%22:%22e12e3d1d-7fa0-af33-c6d0-3c50df9658a3%22%7D by specifying parameters listed in the ‘Details’ section for deployment to succeed. Please read more about quota limits at https://docs.microsoft.com/en-us/azure/azure-supportability/regional-quota-requests.
Note that the error message from Azure includes left/right single quotes (hex U+2018 and U+2019). The fancy quotes are around the word Details in the 2nd to last sentence.
ISSUE TYPE
COMPONENT NAME
azure_rm_virtualmachine module
Suspect this could apply to any/all Azure modules.
ANSIBLE VERSION
CONFIGURATION
No changes/default config.
OS / ENVIRONMENT
Ansible Tower ; RHEL 7.7 control nodes.
Azure Cloud Module(s)
STEPS TO REPRODUCE
In my case, used azure_rm_virtualmachine to create an Azure VM. The Azure Subscription had quotas in place that prevented the VM from being created. Azure believed to generate an error message to be read by Ansible. However, the Azure message/output contains unicode punctuation (left-quote and right-quote; u2018 and u02019).
These left-quote and right-quote characters result in the UnicodeEncodeError: 'ascii' codec can't encode character reported by Ansible.
EXPECTED RESULTS
Expect that Azure error messages be reported via Ansible modules. Expect to not need to obtain a nonsensical/ASCII error, then navigate to Azure to determine the actual error.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: