-
Notifications
You must be signed in to change notification settings - Fork 754
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
DNS resolution error when downloading bicep in bitbucket #9774
Comments
@davidcho23 -- can you take a look at this one? Is this error coming from the CDN? |
The CDN endpoint is working fine. I am able to see available Bicep versions and install the latest Bicep version using @majastrz do you have an idea of what the issue might be? |
The "Name does not resolve" part suggests that the Az CLI is unable to resolve the Locally, the name resolves for me successfully as well:
The random nature of this suggests some DNS resolution issue (rather than a configuration issue on our end) in the CI/CD environment. @ausy-tk can you share any details about the CI/CD environment that is executing the Az CLI commands? |
Hi @majastrz, unfortunately the CI/CD environment is not in our hand directly, so I can't provide any details. But I have also opened a support ticket on their side as it seems that the issue is not on your side. |
I am getting this same error also when trying to use This error seems to be intermittent. |
I'm getting the same problem on my end on Bitbucket pipelines. If I run the command
@danielmackay Since it is intermittent, caching the azure dependencies in my pipeline fixed my issue. This way I avoid downloading bicep on every run. In my bitbucket-pipelines.yml file:
After that I just needed one run to succeed. Now it always retrieves my cache and I no longer have this issue! |
We are unable to reproduce the issue ourselves without more information. Would anyone seeing this problem be able to provide any additional environment or networking details that could help us investigate this? |
@majastrz - This is not specific to ACA, but seems to be any pipeline that tries to use bicep. You can reproduce this by running a bit bucket pipeline that has a step like this: - step:
name: Deploy Infrastructure
image: mcr.microsoft.com/azure-cli
script:
- az login --service-principal -u $AZURE_APP_ID -p $AZURE_PASSWORD --tenant $AZURE_TENANT_ID
- az deployment group create --resource-group $RG_NAME --template-file ./deploy/main.bicep |
And is the issue intermittent, or does this happen every time you try to deploy with bitbucket? |
And do you have any pipelines that exhibit that issue that are not using bitbucket? |
@alex-frankel @majastrz - from my testing this happens every time. We are only using bitbucket. We also get this behavior from running
|
|
We are going to try to repro on our end, but any chance you can file a support case with BitBucket? It's very odd that it is only not working using that tool and it seems most likely the issue is on their end. |
Can you please test either of the following 2 workarounds ?
image: mcr.microsoft.com/azure-cli:2.34.1 # workaround 1
# image: mcr.microsoft.com/azure-cli:latest
pipelines:
default:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- az --version
- az bicep --help
- az bicep install With newer version of az cli, I see either of the the following
It's possible the regression was related to these new config options?
I see the following on the install.. The install does appear to complete, with the exception. Other possible workarounds appear to be as followsimage: mcr.microsoft.com/azure-cli:latest
pipelines:
default:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- az --version
- az config set bicep.use_binary_from_path=False #workaround 2
- az bicep --help
- az bicep install Adding text log for for follow up on az cli once we confirm the above workaround.
|
Tagging @ausy-tk @danielmackay @OlivierTD Can you please test above workarounds?
|
I believe this has been reported and a fix is rolling out: |
I see @danielmackay commented on that other thread that the workaround was successful. |
I'm going to close this one since it looks like Ben is right on the root cause and the issue is being tracked on the az CLI side. We can re-open if needed. |
We ran into above DNS issue intermittently from time to time. Below are my observations so far - We also encountered the issue mentioned Error with Azure CLI 2.46.0 and Bicep if no bicep configuration exists. Applying the fix (and temporary work around) for #25710 resolves the bicep configuration problem but not the intermittent DNS problem. We are using the latest image mcr.microsoft.com/azure-cli (2.46.0) where bicep was installed using command az bicep install. Also tried using other commands: az bicep list-versions and install a specific version of the bicep tool. All these resulted in the DNS errors intermittently. For troubleshooting, switched over to using mcr.microsoft.com/azure-functions/dotnet:4-dotnet6-core-tools instead and the DNS issue seems resolved. I haven't tried using any other image with Azure CLI yet. Switching back to azure-cli image resurfaces the problem intermittently. |
I also use BitBucket pipelines and this DNS issue was happening since before before the Azure/azure-cli#25710 issue started. Using workaround 2, it fixed the bicep config issue but the DNS issue still remained. Since recently, the DNS issue seems to become more frequent. There was a day when bicep finally got installed after 11 runs of the pipeline. So in agreement with az-core's comment above, this is still not fixed. |
@krizskp can you please test using the older azure-cli image ? i.e. workaround 1 |
No, this didn't work for me. |
@krizskp what did you mean by "didn't work" ? are you using Can you please provide some more info or logs from your error messages that relate to the DNS error. are you using hosted runners or what |
With workaround 1, having azure-cli version set to 2.34.1, I still get |
@krizskp Thank you ✅ will re-open. |
@krizskp are you using hosted runners or what Workspace runners are you using ? |
Appears to be other reports of this more widespread i.e. not specific to
|
@brwilkinson I'm running it on BitBucket pipelines. Fails at this command: |
@krizskp was this intermittent for you? Also what region? Can you check which DNS servers you are using? I still am not able to repro so far... in bitbucket... I can setup a deployment schedule if it is intermittent ? image: mcr.microsoft.com/azure-cli:latest
pipelines:
default:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- apk update
- apk add bind-tools
- uname -a
- cat /etc/resolv.conf
- nslookup downloads.bicep.azure.com
- dig downloads.bicep.azure.com
- ping downloads.bicep.azure.com -4 -c 2 all resolve correctly to
|
@brwilkinson Yes, it was intermittent. Here's the output: |
Thank you @krizskp for the output... It looks like you are using an internal IP Address for your DNS server? either way it appears DNS is actually working correctly... however the deployment fails... So are you also also applying the workaround ?
# full steps for repro and testing.image: mcr.microsoft.com/azure-cli:latest
pipelines:
default:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- apk update
- apk add bind-tools
- uname -a
- cat /etc/resolv.conf
- nslookup downloads.bicep.azure.com
- dig downloads.bicep.azure.com
- ping downloads.bicep.azure.com -4 -c 2
- az --version
# - az config set bicep.version_check=True
- az config set bicep.use_binary_from_path=False
- az bicep --help
- az bicep install output from the additional steps |
@brwilkinson I'm using BitBucket pipelines and don't configure the DNS myself. It is managed by BitBucket I suppose. And And yes, I'm using the |
Please test the complete config below and provide the logs. image: mcr.microsoft.com/azure-cli:latest
pipelines:
default:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- apk update
- apk add bind-tools
- uname -a
- cat /etc/resolv.conf
- nslookup downloads.bicep.azure.com
- dig downloads.bicep.azure.com
- ping downloads.bicep.azure.com -4 -c 2
- az --version
# - az config set bicep.version_check=True
- az config set bicep.use_binary_from_path=False
- az bicep --help
- az bicep install |
As mentioned further up in this thread...
We believe it's directly related and have confirmed with many that the workaround has been successful. You just need to add the following prior to running your deployment... until the fix is rolled out in the az cli image. az config set bicep.use_binary_from_path=False
az deployment group create --template-file xyx etc ..... |
This is another message which sometimes pops up. |
Thank you @krizskp ... interesting. I don't see the warning, to show the 'use_binary_from_path=False' Since the DNS looks good, can we try the following. image: mcr.microsoft.com/azure-cli:latest
pipelines:
default:
- step:
name: 'Deployment to Staging'
deployment: staging
script:
# - apk update
# - apk add bind-tools
# - uname -a
# - cat /etc/resolv.conf
# - nslookup downloads.bicep.azure.com
# - dig downloads.bicep.azure.com
# - ping downloads.bicep.azure.com -4 -c 2
# - az --version
# - az config set bicep.version_check=True
- az config set bicep.use_binary_from_path=False
#- az bicep --help
- az config get
- az bicep install e.g. |
Looks like the fix for the config has been merged I guess we will see a new version in the next week. |
Azure-CLI 2.47.0 is now latest, will close. |
@krizskp if you get a chance, some other commands that would be useful to help debug:
|
Reopen - confirm DNS issue has resolution. |
Hi @krizskp any additional status updates on the DNS failures? |
Bicep version
v0.14.6 via
az bicep version
Describe the bug
When deploying Docker containers to our Azure Container Apps environment with az cli using Bicep template, our deployments randomly fail while attempting to pull the latest Bicep version from
downloads.bicep.azure.com
with the following error:To Reproduce
Deploy a Docker container to Azure Container Apps environment with az-cli using a bicep template (but happens randomly)
Additional context
We know there is a workaround which was described in issue #3689 to use the ARM json as a template, but anyway this may be should analyzed in more depth, if teams as us want to standardize to Bicep templates.
We don't experience any other internet connection issues within our CI/CD environment
The text was updated successfully, but these errors were encountered: