Azure / Azure/azure-cli-extensions

CLI breaks when installing ML extension

Open
#8,667 11 comments 3 reactions 0 assignees View on GitHub
Auto-Assign bug customer-reported extension/ml Machine Learning Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### Describe the bug

The latest version of the "ml" extension breaks the Azure CLI when you install it.

It throws visible python errors and no longer recognises the "ml" extension.

~~~
$ az version
{
"azure-cli": "2.71.0",
"azure-cli-core": "2.71.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {}
}
$ az extension add -n ml -y
$ az extension list
cannot import name 'FieldInstanceResolutionError' from 'marshmallow.utils' (/home/azureuser/.azure/cliextensions/ml/marshmallow/utils.py)
[
{
"experimental": false,
"extensionType": "whl",
"name": "ml",
"path": "/home/azureuser/.azure/cliextensions/ml",
"preview": false,
"version": "2.36.3"
}
]
$ az ml -h
cannot import name 'FieldInstanceResolutionError' from 'marshmallow.utils' (/home/azureuser/.azure/cliextensions/ml/marshmallow/utils.py)
'ml' is misspelled or not recognized by the system.

Examples from AI knowledge base:
az extension add --name anextension
Add extension by name

az extension list-available
List all publicly available extensions

https://docs.microsoft.com/en-US/cli/azure/extension#az_extension_add
Read more about the command in reference docs
$ az -h
cannot import name 'FieldInstanceResolutionError' from 'marshmallow.utils' (/home/azureuser/.azure/cliextensions/ml/marshmallow/utils.py)

Group
az
...
~~~

### Related command

az extension add -n ml -y
az ml -h # returns error

### Errors

~~~
cannot import name 'FieldInstanceResolutionError' from 'marshmallow.utils' (/home/azureuser/.azure/cliextensions/ml/marshmallow/utils.py)
~~~

### Issue script & Debug output

~~~
$ az ml -h --debug
cli.knack.cli: Command arguments: ['ml', '-h', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: No module found from index for '['ml', '-h', '--debug']'
cli.azure.cli.core: Loading all modules and extensions
cli.azure.cli.core: Discovered command modules: ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'compute_recommender', 'computefleet', 'config', 'configure', 'consumption', 'container', 'containerapp', 'cosmosdb', 'databoxedge', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'identity', 'interactive', 'iot', 'keyvault', 'lab', 'managedservices', 'maps', 'marketplaceordering', 'monitor', 'mysql', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'resource', 'role', 'search', 'security', 'servicebus', 'serviceconnector', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'synapse', 'util', 'vm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: acr 0.160 36 149
cli.azure.cli.core: acs 0.015 15 79
cli.azure.cli.core: advisor 0.001 3 6
cli.azure.cli.core: ams 0.004 22 100
cli.azure.cli.core: apim 0.004 14 69
cli.azure.cli.core: appconfig 0.003 9 47
cli.azure.cli.core: appservice 0.019 80 277
cli.azure.cli.core: aro 0.006 1 10
cli.azure.cli.core: backup 0.003 16 60
cli.azure.cli.core: batch 0.054 32 96
cli.azure.cli.core: batchai 0.002 10 30
cli.azure.cli.core: billing 0.009 19 52
cli.azure.cli.core: botservice 0.002 12 42
cli.azure.cli.core: cdn 0.109 8 50
cli.azure.cli.core: cloud 0.001 1 7
cli.azure.cli.core: cognitiveservices 0.002 10 33
cli.azure.cli.core: compute_recommender 0.002 1 1
cli.azure.cli.core: computefleet 0.005 1 1
cli.azure.cli.core: config 0.001 2 7
cli.azure.cli.core: configure 0.001 2 5
cli.azure.cli.core: consumption 0.010 8 9
cli.azure.cli.core: container 0.006 2 17
cli.azure.cli.core: containerapp 0.073 37 123
cli.azure.cli.core: cosmosdb 0.010 58 200
cli.azure.cli.core: databoxedge 0.004 5 28
cli.azure.cli.core: dls 0.002 6 36
cli.azure.cli.core: dms 0.001 3 22
cli.azure.cli.core: eventgrid 0.004 25 96
cli.azure.cli.core: eventhubs 0.006 13 20
cli.azure.cli.core: extension 0.001 1 7
cli.azure.cli.core: feedback 0.000 1 2
cli.azure.cli.core: find 0.001 1 1
cli.azure.cli.core: hdinsight 0.004 9 42
cli.azure.cli.core: identity 0.001 2 11
cli.azure.cli.core: interactive 0.000 1 1
cli.azure.cli.core: iot 0.067 19 82
cli.azure.cli.core: keyvault 0.006 20 113
cli.azure.cli.core: lab 0.057 9 30
cli.azure.cli.core: managedservices 0.006 3 8
cli.azure.cli.core: maps 0.001 5 13
cli.azure.cli.core: marketplaceordering 0.001 1 2
cli.azure.cli.core: monitor 0.365 18 61
cli.azure.cli.core: mysql 0.053 16 56
cli.azure.cli.core: netappfiles 0.028 8 17
cli.azure.cli.core: network 0.089 104 345
cli.azure.cli.core: policyinsights 0.007 9 17
cli.azure.cli.core: privatedns 0.012 14 60
cli.azure.cli.core: profile 0.001 2 8
cli.azure.cli.core: rdbms 0.142 53 223
cli.azure.cli.core: redis 0.002 7 38
cli.azure.cli.core: relay 0.014 7 8
cli.azure.cli.core: resource 0.011 52 232
cli.azure.cli.core: role 0.003 17 62
cli.azure.cli.core: search 0.005 7 19
cli.azure.cli.core: security 0.009 48 98
cli.azure.cli.core: servicebus 0.005 14 17
cli.azure.cli.core: serviceconnector 0.041 20 323
cli.azure.cli.core: servicefabric 0.009 27 80
cli.azure.cli.core: signalr 0.002 10 42
cli.azure.cli.core: sql 0.011 56 215
cli.azure.cli.core: sqlvm 0.015 4 20
cli.azure.cli.core: storage 0.042 60 275
cli.azure.cli.core: synapse 0.010 54 246
cli.azure.cli.core: util 0.001 3 7
cli.azure.cli.core: vm 0.063 59 219
cli.azure.cli.core: Total (65) 1.602 1192 4672
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cannot import name 'FieldInstanceResolutionError' from 'marshmallow.utils' (/home/azureuser/.azure/cliextensions/ml/marshmallow/utils.py)
cli.azure.cli.core: ml 0.565 1 0 /home/azureuser/.azure/cliextensions/ml
cli.azure.cli.core: Total (1) 0.565 1 0
cli.azure.cli.core: Loaded 1179 groups, 4672 commands.
cli.azure.cli.core: Updated command index in 0.005 seconds.
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/azureuser/.azure/commands/2025-04-17.06-18-58.unknown_command.1083358.log'.
az_command_data_logger: command args: ml -h --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x7f71fabec720>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x7f71fabeef20>, .add_cache_arguments at 0x7f71fabef060>, .update_breaking_change_info at 0x7f71fabef100>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22ml%22%2C+%22parameters%22%3A+%22--help%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.71.0%22%2C+%22errorType%22%3A+%22UnknownSubcommand%22%2C+%22correlationId%22%3A+%227eafbcaf-3aa7-4ad8-b3f8-e854d72c3503%22%2C+%22eventId%22%3A+%221685c110-6a4a-4c71-a4aa-4cf456976420%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.command_recommender: "--name" is an invalid parameter for command "ml".
cli.azure.cli.core.azclierror: NoneType: None

cli.azure.cli.core.azclierror: 'ml' is misspelled or not recognized by the system.
az_command_data_logger: 'ml' is misspelled or not recognized by the system.

Examples from AI knowledge base:
az extension add --name anextension
Add extension by name

az extension list-available
List all publicly available extensions

https://docs.microsoft.com/en-US/cli/azure/extension#az_extension_add
Read more about the command in reference docs
cli.knack.cli: Event: Cli.PostExecute []
az_command_data_logger: exit code: 2
cli.__main__: Command ran in 3.076 seconds (init: 0.129, invoke: 2.946)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3839 in cache file under /home/azureuser/.azure/telemetry/20250417061859428
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.12/site-packages/azure/cli/telemetry/__init__.py /home/azureuser/.azure /home/azureuser/.azure/telemetry/20250417061859428"
telemetry.process: Return from creating process 1083442
telemetry.main: Finish creating telemetry upload process.
~~~

### Expected behavior

No error using the "ml" extension.

### Environment Summary

azure-cli 2.71.0

core 2.71.0
telemetry 1.1.0

Extensions:
ml 2.36.3

Dependencies:
msal 1.31.2b1
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Config directory '/home/azureuser/.azure'
Extensions directory '/home/azureuser/.azure/cliextensions'

Python (Linux) 3.12.8 (main, Mar 25 2025, 10:54:53) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

### Additional context

I think this upstream bug in the Python SDK may be related: https://github.com/Azure/azure-sdk-for-python/issues/40565

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.