az upgrade fails on ml

DanM-UMB 1 Reputation point
2022-11-22T17:15:40.867+00:00

Im trying to go through az900 azure fundamentals, when it asks to open an interactive azure shell and upgrade I get errors on ml. I dont think its a huge deal since I think its just saying ml already exists, but i'd just rather not have an error. Anyone know what would cause this or better yet, how to get rid of it?

PS /home/daniel> az upgrade
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
You already have the latest azure-cli version: 2.42.0
Upgrading extensions
Checking update for ai-examples
Latest version of 'ai-examples' is already installed.

Use --debug for more information
Checking update for ml
Failed to delete '/usr/lib/python3.9/site-packages/azure-cli-extensions/ml': [Errno 13] Permission denied: 'py.typed'. Retrying ...
Failed to delete '/usr/lib/python3.9/site-packages/azure-cli-extensions/ml': [Errno 13] Permission denied: 'py.typed'. Retrying ...
Failed to delete '/usr/lib/python3.9/site-packages/azure-cli-extensions/ml': [Errno 13] Permission denied: 'py.typed'. Retrying ...
Failed to delete '/usr/lib/python3.9/site-packages/azure-cli-extensions/ml': [Errno 13] Permission denied: 'py.typed'. You may try to delete it manually.
An error occurred whilst updating.
The extension ml already exists.
The command failed with an unexpected error. Here is the traceback:
[Errno 17] File exists: '/usr/lib/python3.9/site-packages/azure-cli-extensions/ml'
Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/extension/operations.py", line 413, in update_extension
_add_whl_ext(cli_ctx=cmd_cli_ctx, source=download_url, ext_sha256=ext_sha256,
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/extension/operations.py", line 113, in _add_whl_ext
raise CLIError('The extension {} already exists.'.format(extension_name))
knack.util.CLIError: The extension ml already exists.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/extension/custom.py", line 34, in update_extension_cmd
return update_extension(cli_ctx=cmd.cli_ctx, extension_name=extension_name, index_url=index_url,
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/extension/operations.py", line 421, in update_extension
shutil.copytree(backup_dir, extension_path)
File "/usr/lib/python3.9/shutil.py", line 568, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
File "/usr/lib/python3.9/shutil.py", line 467, in _copytree
os.makedirs(dst, exist_ok=dirs_exist_ok)
File "/usr/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/usr/lib/python3.9/site-packages/azure-cli-extensions/ml'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
To open a new issue, please run az feedback
Checking update for ssh
Latest version of 'ssh' is already installed.

Use --debug for more information
Upgrade finished.You can enable auto-upgrade with 'az config set auto-upgrade.enable=yes'. More details in https://learn.microsoft.com/cli/azure/update-azure-cli#automatic-update
PS /home/daniel>

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,225 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 24,396 Reputation points Microsoft Employee
    2022-11-24T13:54:28.833+00:00

    DanMUMB-8469, Thanks for the follow-up and sharing additional info. Glad to know that you were able to proceed further with other Tasks'.

    From the cmdlet output/flow, the latest extension versions are already installed. I have noted this, and also relayed this feedback to our Learn module's team.

    az upgrade extension

    0 comments No comments