Skip to content
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 CLI version 2.24.0 has a bug when deploying a container group (ACI) from a YAML file #3508

Closed
2 of 7 tasks
ramirezalfredo opened this issue Jun 2, 2021 · 15 comments
Closed
2 of 7 tasks
Assignees
Labels
Area: Common Tools awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working external OS: Windows

Comments

@ramirezalfredo
Copy link

Description
When using Azure CLI version 2.24.0 which is the default in the latest OS image (at least in Windows), Container Group deployment from YAML file fails. Version 2.23.0 has no issues.

Area for Triage: Artifacts

Question, Bug, or Feature?: Bug

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11
  • Windows Server 2016 R2
  • Windows Server 2019

Image version

20210525.0

Expected behavior
To deploy a container group (ACI) from an Azure DevOps pipeline using the Azure CLI task with a YAML file.

Actual behavior
Azure CLI task fails with the following message:

$ az container create -g CloudMasterRG -f deploy-aci.yaml
The command failed with an unexpected error. Here is the traceback:
'ResourcesOperations' object has no attribute 'create_or_update'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/custom.py", line 113, in create_container
    return _create_update_from_file(cmd.cli_ctx, resource_group_name, name, location, file, no_wait)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/custom.py", line 407, in _create_update_from_file
    resource_client.resources.create_or_update,
AttributeError: 'ResourcesOperations' object has no attribute 'create_or_update'

Repro steps

  1. Upgrade to Azure CLI v2.24.0
  2. Deploy a container group from YAML: az container create -g -f your-deployment.yaml
@github-actions github-actions bot added Area: Artifacts investigate Collect additional information, like space on disk, other tool incompatibilities etc. labels Jun 2, 2021
@ramirezalfredo
Copy link
Author

One way to resolve this is to downgrade Azure CLI to version 2.23.0 in the latest OS images.

@maxim-lobanov
Copy link
Contributor

Hello @ramirezalfredo , have you reported this issue to https://github.com/Azure/azure-cli team?

@ramirezalfredo
Copy link
Author

@maxim-lobanov, Not me but there are 5 different GitHut issues with the same information:

Azure/azure-cli#18262
Azure/azure-cli#18275
Azure/azure-cli#18276
Azure/azure-cli#18290
Azure/azure-cli#18291

What I'm asking to you is to downgrade the Azure CLI version as this one is buggy. I believe that downgrading is faster than waiting for a solution from Azure CLI, I mean, this is something that you can do without waiting for others. Please find me on teams.

Thanks!

@miketimofeev
Copy link
Contributor

miketimofeev commented Jun 2, 2021

@ramirezalfredo by the way, version 2.24.1 was released yesterday. Could you try upgrading to it and check if the issue persists?
choco upgrade azure-cli
UPD: Looks like it won't help. Azure/azure-cli#18291 (comment)

@miketimofeev miketimofeev added bug Something isn't working external and removed investigate Collect additional information, like space on disk, other tool incompatibilities etc. labels Jun 2, 2021
@ramirezalfredo
Copy link
Author

@miketimofeev I did and I've got the same result. That's why I'm asking the safest option to downgrade. I also made the ACI PM aware of the issue and a bug was filed, but not sure how long would that take. Same reason I'm asking for your help. Customer changed from Windows to Ubuntu as 2.23 is not available in that image but afraid that when it does, Azure DevOps pipeline will brake again. Other options are not feasible like using Docker containers for the pipeline or switching to ARM Template as that would incur in so much job that we introduced by upgrading to a buggy version of the Azure CLI.

@miketimofeev
Copy link
Contributor

@ramirezalfredo the customer can add this step for Ubuntu to stick to azure-cli 2.23.0 no matter what version is on the image. The installation takes about 40 seconds.

sudo apt-get remove azure-cli
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update
sudo apt-get install azure-cli=2.23.0-1~$(lsb_release -cs)

@miketimofeev miketimofeev self-assigned this Jun 2, 2021
@koenreijns
Copy link

According to the release notes of Azure CLI, a hotfix is already available:
https://docs.microsoft.com/en-us/cli/azure/release-notes-azure-cli?tabs=azure-cli#june-02-2021

It would be helpful if this can be pushed to the latest images as soon as available.

@mathsnunes
Copy link

We are having problems with version 2.24.0 of azure cli too.

The problem is not the same related by @ramirezalfredo, it is related to appservice and was fixed in release 2.24.1 (release notes), so I think that upgrade az-cli would be nice.

@miketimofeev
Copy link
Contributor

azure-cli 2.24.2 was released a few hours ago and it fixes the initial issue.
The new images with updated azure-cli will be deployed next week.

@miketimofeev miketimofeev added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Jun 2, 2021
@miketimofeev
Copy link
Contributor

miketimofeev commented Jun 2, 2021

The following steps are required to update to the latest version:
Ubuntu:

sudo apt-get remove azure-cli
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update
sudo apt-get install azure-cli

Windows:

$azCliUrl = "https://github.com/Azure/azure-cli/releases/download/azure-cli-2.24.2/azure-cli-2.24.2.msi"
$azCliName = [IO.Path]::GetFileName($azCliUrl)
Install-Binary -Url $azCliUrl -Name $azCliName -ArgumentList ("/qn", "/norestart")

macOS:

brew upgrade azure-cli

@AlenaSviridenko AlenaSviridenko pinned this issue Jun 2, 2021
@ramirezalfredo
Copy link
Author

@miketimofeev 2.24.2 works, how soon can that version be available in the OS images? And also, commands to update the azure cli in Ubuntu, for example, would that work in an Azure DevOps pipeline?

@miketimofeev
Copy link
Contributor

@ramirezalfredo we're going to start new image deployment on Monday and it will take 3-4 days to propagate the image to all the environments. There is a chance of windows images delay since we need to wait for the new VS release.
Yes, these steps work both in GH and AzDO.

@ramirezalfredo
Copy link
Author

Thank you very much @miketimofeev, this really helps.

@miketimofeev miketimofeev mentioned this issue Jun 9, 2021
7 tasks
@miketimofeev
Copy link
Contributor

Quick update: macOS and Ubuntu images were updated. Windows image deployments will be finished on Monday.

@miketimofeev
Copy link
Contributor

@ramirezalfredo all the images were updated with Azure-cli 2.24.2
I'm going to close the issue. Please feel free to contact us if you have any concerns.
Thank you!

@AlenaSviridenko AlenaSviridenko unpinned this issue Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Common Tools awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working external OS: Windows
Projects
None yet
Development

No branches or pull requests

5 participants