Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

Running `az ml` v2 API: ERROR: cli.azure.cli.core: Error loading command module 'iotcentral': unrecognized kwargs: ['min_profile'] #27418

Closed alegend4u closed 10 months ago

alegend4u commented 1 year ago

Describe the bug

I have azure cli (version: 2.39.0). I referred this official doc and install az ml extension v2 using below command: az extension add -n ml After that I also did: az extension update -n ml and it said it's already latest version. However, I can't run any az ml commands. Following are the commands and outputs I've received.

Related command

az extension add -n ml and then any az ml command like: az ml --debug -h

Errors

Command: az ml -h

ERROR: Error loading command module 'iotcentral': unrecognized kwargs: ['min_profile']
ERROR: 'ml' is misspelled or not recognized by the system.

Issue script & Debug output

Command: which az az ml --debug -h

Debug Output:

2023-09-18T23:46:59.1440954Z /home/SuperAdmin/.local/bin/az
2023-09-18T23:46:59.2856536Z DEBUG: cli.knack.cli: Command arguments: ['ml', '--debug', '-h']
2023-09-18T23:46:59.2857464Z DEBUG: cli.knack.cli: __init__ debug log:
2023-09-18T23:46:59.2858010Z Cannot enable color.
2023-09-18T23:46:59.2858370Z DEBUG: cli.knack.cli: Event: Cli.PreExecute []
2023-09-18T23:46:59.2860121Z DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7fbaa3dd3378>, <function OutputProducer.on_global_arguments at 0x7fbaa390c378>, <function CLIQuery.on_global_arguments at 0x7fbaa36ae840>]
2023-09-18T23:46:59.3015129Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
2023-09-18T23:46:59.3016361Z DEBUG: cli.azure.cli.core: Command index version or cloud profile is invalid or doesn't match the current command.
2023-09-18T23:46:59.3037601Z DEBUG: cli.azure.cli.core: Command index has been invalidated.
2023-09-18T23:46:59.3038636Z DEBUG: cli.azure.cli.core: No module found from index for '['ml', '--debug', '-h']'
2023-09-18T23:46:59.3039056Z DEBUG: cli.azure.cli.core: Loading all modules and extensions
2023-09-18T23:46:59.3060850Z DEBUG: cli.azure.cli.core: Discovered command modules: ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'config', 'configure', 'consumption', 'container', 'cosmosdb', 'databoxedge', 'deploymentmanager', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'identity', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'marketplaceordering', 'monitor', 'natgateway', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'serviceconnector', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'synapse', 'util', 'vm']
2023-09-18T23:46:59.3062498Z DEBUG: cli.azure.cli.core: Loading command modules:
2023-09-18T23:46:59.3062857Z DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands
2023-09-18T23:46:59.3126238Z DEBUG: cli.azure.cli.core: acr                       0.007        30       126
2023-09-18T23:46:59.4235465Z DEBUG: cli.azure.cli.core: acs                       0.111         8        58
2023-09-18T23:46:59.4243586Z DEBUG: cli.azure.cli.core: advisor                   0.001         3         6
2023-09-18T23:46:59.4290702Z DEBUG: cli.azure.cli.core: ams                       0.005        22       100
2023-09-18T23:46:59.4327870Z DEBUG: cli.azure.cli.core: apim                      0.004        11        60
2023-09-18T23:46:59.4349434Z DEBUG: cli.azure.cli.core: appconfig                 0.002         7        37
2023-09-18T23:46:59.4459447Z DEBUG: cli.azure.cli.core: appservice                0.011        68       245
2023-09-18T23:46:59.4481093Z DEBUG: cli.azure.cli.core: aro                       0.002         1         7
2023-09-18T23:46:59.4517145Z DEBUG: cli.azure.cli.core: backup                    0.003        16        58
2023-09-18T23:46:59.4794209Z DEBUG: cli.azure.cli.core: batch                     0.028        36       104
2023-09-18T23:46:59.4813774Z DEBUG: cli.azure.cli.core: batchai                   0.002        10        30
2023-09-18T23:46:59.4857703Z DEBUG: cli.azure.cli.core: billing                   0.004        19        52
2023-09-18T23:46:59.4883914Z DEBUG: cli.azure.cli.core: botservice                0.003        12        42
2023-09-18T23:46:59.4942257Z DEBUG: cli.azure.cli.core: cdn                       0.006        39       133
2023-09-18T23:46:59.4951738Z DEBUG: cli.azure.cli.core: cloud                     0.001         1         7
2023-09-18T23:46:59.4970015Z DEBUG: cli.azure.cli.core: cognitiveservices         0.002         8        31
2023-09-18T23:46:59.4978933Z DEBUG: cli.azure.cli.core: config                    0.001         2         7
2023-09-18T23:46:59.4986424Z DEBUG: cli.azure.cli.core: configure                 0.001         2         5
2023-09-18T23:46:59.5000598Z DEBUG: cli.azure.cli.core: consumption               0.001         8         9
2023-09-18T23:46:59.5011736Z DEBUG: cli.azure.cli.core: container                 0.001         1        11
2023-09-18T23:46:59.5098313Z DEBUG: cli.azure.cli.core: cosmosdb                  0.009        47       167
2023-09-18T23:46:59.5126690Z DEBUG: cli.azure.cli.core: databoxedge               0.003         5        27
2023-09-18T23:46:59.5144066Z DEBUG: cli.azure.cli.core: deploymentmanager         0.002         7        30
2023-09-18T23:46:59.5176040Z DEBUG: cli.azure.cli.core: dla                       0.003        23        62
2023-09-18T23:46:59.5198360Z DEBUG: cli.azure.cli.core: dls                       0.002         7        41
2023-09-18T23:46:59.5212644Z DEBUG: cli.azure.cli.core: dms                       0.001         3        22
2023-09-18T23:46:59.5255978Z DEBUG: cli.azure.cli.core: eventgrid                 0.004        25        96
2023-09-18T23:46:59.5293227Z DEBUG: cli.azure.cli.core: eventhubs                 0.004        21        73
2023-09-18T23:46:59.5300083Z DEBUG: cli.azure.cli.core: extension                 0.001         1         7
2023-09-18T23:46:59.5304615Z DEBUG: cli.azure.cli.core: feedback                  0.000         1         1
2023-09-18T23:46:59.5309938Z DEBUG: cli.azure.cli.core: find                      0.000         1         1
2023-09-18T23:46:59.5335261Z DEBUG: cli.azure.cli.core: hdinsight                 0.002         8        39
2023-09-18T23:46:59.5344925Z DEBUG: cli.azure.cli.core: identity                  0.001         1         6
2023-09-18T23:46:59.5348787Z DEBUG: cli.azure.cli.core: interactive               0.000         1         1
2023-09-18T23:46:59.6161788Z /home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/command_modules/iot/_utils.py:9: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
2023-09-18T23:46:59.6162747Z   from cryptography import x509
2023-09-18T23:46:59.6163127Z DEBUG: cli.azure.cli.core: iot                       0.081        19        81
2023-09-18T23:46:59.6166840Z ERROR: cli.azure.cli.core: Error loading command module 'iotcentral': unrecognized kwargs: ['min_profile']
2023-09-18T23:46:59.6173784Z DEBUG: cli.azure.cli.core: Traceback (most recent call last):
2023-09-18T23:46:59.6175144Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 264, in _update_command_table_from_modules
2023-09-18T23:46:59.6176108Z     module_command_table, module_group_table = _load_module_command_loader(self, args, mod)
2023-09-18T23:46:59.6177169Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 1085, in _load_module_command_loader
2023-09-18T23:46:59.6177827Z     return _load_command_loader(loader, args, mod, 'azure.cli.command_modules.')
2023-09-18T23:46:59.6178496Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 1067, in _load_command_loader
2023-09-18T23:46:59.6179010Z     command_table = command_loader.load_command_table(args)
2023-09-18T23:46:59.6179672Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/command_modules/iotcentral/__init__.py", line 24, in load_command_table
2023-09-18T23:46:59.6180118Z     load_command_table(self, args)
2023-09-18T23:46:59.6180744Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/command_modules/iotcentral/commands.py", line 21, in load_command_table
2023-09-18T23:46:59.6181462Z     with self.command_group('iotcentral app', iotcentral_sdk, client_factory=iotcentral_service_factory) as g:
2023-09-18T23:46:59.6182134Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 782, in command_group
2023-09-18T23:46:59.6182587Z     return self._command_group_cls(self, group_name, **kwargs)
2023-09-18T23:46:59.6183185Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 1196, in __init__
2023-09-18T23:46:59.6183885Z     merged_kwargs = self._merge_kwargs(kwargs, base_kwargs=command_loader.module_kwargs)
2023-09-18T23:46:59.6184770Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 1220, in _merge_kwargs
2023-09-18T23:46:59.6185254Z     return _merge_kwargs(kwargs, base, CLI_COMMAND_KWARGS)
2023-09-18T23:46:59.6186710Z   File "/home/SuperAdmin/.local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 1165, in _merge_kwargs
2023-09-18T23:46:59.6187336Z     raise TypeError('unrecognized kwargs: {}'.format(unrecognized_kwargs))
2023-09-18T23:46:59.6187788Z TypeError: unrecognized kwargs: ['min_profile']
2023-09-18T23:46:59.6187938Z 
2023-09-18T23:46:59.6243393Z DEBUG: cli.azure.cli.core: keyvault                  0.007        20       122
2023-09-18T23:46:59.6255945Z DEBUG: cli.azure.cli.core: kusto                     0.001         3        14
2023-09-18T23:46:59.6279464Z DEBUG: cli.azure.cli.core: lab                       0.002        11        34
2023-09-18T23:46:59.6288301Z DEBUG: cli.azure.cli.core: managedservices           0.001         3         8
2023-09-18T23:46:59.6298933Z DEBUG: cli.azure.cli.core: maps                      0.001         5        13
2023-09-18T23:46:59.6313561Z DEBUG: cli.azure.cli.core: marketplaceordering       0.001         1         2
2023-09-18T23:46:59.6468604Z DEBUG: cli.azure.cli.core: monitor                   0.015        32       123
2023-09-18T23:46:59.6478564Z DEBUG: cli.azure.cli.core: natgateway                0.001         3         6
2023-09-18T23:46:59.6520246Z DEBUG: cli.azure.cli.core: netappfiles               0.004        16        86
2023-09-18T23:46:59.7075419Z DEBUG: cli.azure.cli.core: network                   0.055       143       660
2023-09-18T23:46:59.7087507Z DEBUG: cli.azure.cli.core: policyinsights            0.001         6        12
2023-09-18T23:46:59.7120911Z DEBUG: cli.azure.cli.core: privatedns                0.003        14        66
2023-09-18T23:46:59.7130197Z DEBUG: cli.azure.cli.core: profile                   0.001         2         9
2023-09-18T23:46:59.7973376Z DEBUG: cli.azure.cli.core: rdbms                     0.084        47       201
2023-09-18T23:46:59.7988478Z DEBUG: cli.azure.cli.core: redis                     0.002         5        27
2023-09-18T23:46:59.8009976Z DEBUG: cli.azure.cli.core: relay                     0.002        10        37
2023-09-18T23:46:59.8022095Z DEBUG: cli.azure.cli.core: reservations              0.001         5        12
2023-09-18T23:46:59.8118709Z DEBUG: cli.azure.cli.core: resource                  0.010        47       207
2023-09-18T23:46:59.8145519Z DEBUG: cli.azure.cli.core: role                      0.003        17        61
2023-09-18T23:46:59.8160514Z DEBUG: cli.azure.cli.core: search                    0.001         7        22
2023-09-18T23:46:59.8210264Z DEBUG: cli.azure.cli.core: security                  0.005        46       102
2023-09-18T23:46:59.8253430Z DEBUG: cli.azure.cli.core: servicebus                0.004        21        74
2023-09-18T23:46:59.8442192Z DEBUG: cli.azure.cli.core: serviceconnector          0.019         4        53
2023-09-18T23:46:59.8476492Z DEBUG: cli.azure.cli.core: servicefabric             0.003        26        75
2023-09-18T23:46:59.8489900Z DEBUG: cli.azure.cli.core: signalr                   0.001         6        20
2023-09-18T23:46:59.8576324Z DEBUG: cli.azure.cli.core: sql                       0.009        45       179
2023-09-18T23:46:59.8884217Z DEBUG: cli.azure.cli.core: sqlvm                     0.031         4        18
2023-09-18T23:46:59.9250619Z DEBUG: cli.azure.cli.core: storage                   0.037        56       261
2023-09-18T23:46:59.9359345Z DEBUG: cli.azure.cli.core: synapse                   0.011        54       246
2023-09-18T23:46:59.9367148Z DEBUG: cli.azure.cli.core: util                      0.001         3         6
2023-09-18T23:46:59.9513203Z DEBUG: cli.azure.cli.core: vm                        0.015        56       292
2023-09-18T23:46:59.9513739Z DEBUG: cli.azure.cli.core: Total (66)                0.639      1192      4830
2023-09-18T23:46:59.9522193Z DEBUG: cli.azure.cli.core: Loading extensions:
2023-09-18T23:46:59.9522741Z DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
2023-09-18T23:47:00.2027208Z DEBUG: cli.azure.cli.core: ml                        0.249         1         0  /home/SuperAdmin/runner/runner-2/_work/_temp/.azclitask/cliextensions/ml
2023-09-18T23:47:00.2028153Z DEBUG: cli.azure.cli.core: Total (1)                 0.249         1         0  
2023-09-18T23:47:00.2028614Z DEBUG: cli.azure.cli.core: Loaded 1182 groups, 4830 commands.
2023-09-18T23:47:00.2077166Z DEBUG: cli.azure.cli.core: Updated command index in 0.004 seconds.
2023-09-18T23:47:00.2077884Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fbaa264d8c8>]
2023-09-18T23:47:00.2087748Z DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/SuperAdmin/runner/runner-2/_work/_temp/.azclitask/commands/2023-09-18.23-47-00.unknown_command.14500.log'.
2023-09-18T23:47:00.2089249Z INFO: az_command_data_logger: command args: ml --debug -h
2023-09-18T23:47:00.2123938Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7fbaa21d26a8>]
2023-09-18T23:47:00.2136543Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
2023-09-18T23:47:00.2137261Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7fbaa213c510>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7fbaa213c620>]
2023-09-18T23:47:00.2856104Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
2023-09-18T23:47:00.2856774Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x7fbaa0231488>]
2023-09-18T23:47:00.2863930Z INFO: cli.azure.cli.core._session: Failed to load or parse file /home/SuperAdmin/runner/runner-2/_work/_temp/.azclitask/extensionCommandTree.json. It will be overridden by default settings.
2023-09-18T23:47:00.2895682Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): aka.ms:443
2023-09-18T23:47:00.6408906Z DEBUG: urllib3.connectionpool: https://aka.ms:443 "GET /azExtCmdTree HTTP/1.1" 301 0
2023-09-18T23:47:00.6437198Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): azurecliextensionsync.blob.core.windows.net:443
2023-09-18T23:47:01.5940689Z DEBUG: urllib3.connectionpool: https://azurecliextensionsync.blob.core.windows.net:443 "GET /cmd-index/extensionCommandTree.json HTTP/1.1" 200 149275
2023-09-18T23:47:02.3709575Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
2023-09-18T23:47:02.7170369Z DEBUG: 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.39.0%22%2C+%22errorType%22%3A+%22UnknownSubcommand%22%2C+%22correlationId%22%3A+%221e0390de-1aea-4b97-ab82-619f84adafdb%22%2C+%22subscriptionId%22%3A+%2270e86587-74bb-419d-b686-0c52d81912af%22%2C+%22eventId%22%3A+%226c85da10-12a1-41ee-a3e7-79df92686884%22%7D HTTP/1.1" 200 None
2023-09-18T23:47:02.7186829Z DEBUG: cli.azure.cli.core.command_recommender: "--name" is an invalid parameter for command "ml".
2023-09-18T23:47:02.7233907Z ERROR: cli.azure.cli.core.azclierror: 'ml' is misspelled or not recognized by the system.
2023-09-18T23:47:02.7235438Z ERROR: az_command_data_logger: 'ml' is misspelled or not recognized by the system.
2023-09-18T23:47:02.7235945Z 
2023-09-18T23:47:02.7236451Z Examples from AI knowledge base:
2023-09-18T23:47:02.7237239Z az extension add --name anextension
2023-09-18T23:47:02.7237605Z Add extension by name
2023-09-18T23:47:02.7237743Z 

Expected behavior

No error must be received and all az ml commands should work.

Environment Summary

2023-09-18T23:46:59.1158776Z azure-cli                         2.39.0 *
2023-09-18T23:46:59.1158963Z 
2023-09-18T23:46:59.1159343Z core                              2.39.0 *
2023-09-18T23:46:59.1159672Z telemetry                          1.0.6 *
2023-09-18T23:46:59.1159799Z 
2023-09-18T23:46:59.1159997Z Extensions:
2023-09-18T23:46:59.1162792Z ml                                2.20.0
2023-09-18T23:46:59.1163007Z 
2023-09-18T23:46:59.1163461Z Dependencies:
2023-09-18T23:46:59.1163897Z msal                            1.18.0b1
2023-09-18T23:46:59.1165067Z azure-mgmt-resource             21.1.0b1
2023-09-18T23:46:59.1165342Z 
2023-09-18T23:46:59.1166127Z Python location '/opt/rh/rh-python36/root/usr/bin/python3'
2023-09-18T23:46:59.1166863Z Extensions directory '/home/SuperAdmin/runner/runner-2/_work/_temp/.azclitask/cliextensions'
2023-09-18T23:46:59.1167217Z 
2023-09-18T23:46:59.1167736Z Python (Linux) 3.6.9 (default, Nov 11 2019, 11:24:16) 
2023-09-18T23:46:59.1168481Z [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
2023-09-18T23:46:59.1168625Z 
2023-09-18T23:46:59.1168883Z Legal docs and information: aka.ms/AzureCliLegal

Additional context

I'm trying to use az ml v2 CLI in an azure devops pipeline. The agent is centos 7 (Red Hat 4.8.5-39).

azure-client-tools-bot-prd[bot] commented 1 year ago

Hi @alegend4u,

2.39.0 is not the latest Azure CLI(2.52.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-iot-cli-triage.

microsoft-github-policy-service[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

HangyiWang commented 1 year ago

image

@alegend4u Hi, could you update Azure CLI by running az upgrade? I can't reproduce this with latest version.

alegend4u commented 10 months ago

Yes, actually I lost access to the virtual environment which was having the issue, so I created a new one and it's running fine.