Azure / azure-cli

Azure Command-Line Interface
MIT License
3.93k stars 2.9k forks source link

ModuleNotFoundError: No module named 'azure.mgmt.relay' #27357

Closed PicaChen closed 10 months ago

PicaChen commented 10 months ago

Describe the bug

When I want to create the Network Function Operator Kubernetes extension. It will show the following error.

Related command

az k8s-extension create \ --name networkfunction-operator \ --cluster-name "$ARC_CLUSTER_RESOURCE_NAME" \ --resource-group "$RESOURCE_GROUP_NAME" \ --cluster-type connectedClusters \ --extension-type "Microsoft.Azure.HybridNetwork" \ --auto-upgrade-minor-version "true" \ --scope cluster \ --release-namespace azurehybridnetwork \ --release-train preview \ --config-settings-file $TEMP_FILE

Errors

ModuleNotFoundError: No module named 'azure.mgmt.relay'

Issue script & Debug output

The command failed with an unexpected error. Here is the traceback: No module named 'azure.mgmt.relay' 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 561, in execute self.commands_loader.load_arguments(command) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/init.py", line 521, in load_arguments self.command_table[command].load_arguments() # this loads the arguments via reflection File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 318, in load_arguments super(AzCliCommand, self).load_arguments() File "/usr/lib64/az/lib/python3.9/site-packages/knack/commands.py", line 104, in load_arguments cmd_args = self.arguments_loader() File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader op = self.get_op_handler(self.op_path) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler handler = import_module(mod_to_import) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/home/pica/.azure/cliextensions/k8s-extension/azext_k8s_extension/custom.py", line 30, in from .partner_extensions.AzureMLKubernetes import AzureMLKubernetes File "/home/pica/.azure/cliextensions/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py", line 15, in import azure.mgmt.relay ModuleNotFoundError: No module named 'azure.mgmt.relay'

Expected behavior

works

Environment Summary

{ "azure-cli": "2.52.0", "azure-cli-core": "2.52.0", "azure-cli-telemetry": "1.1.0", "extensions": { "ai-examples": "0.2.5", "customlocation": "0.1.3", "k8s-extension": "1.4.2", "ml": "2.19.1", "ssh": "2.0.1" } }

Additional context

No response

yonzhan commented 10 months ago

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

microsoft-github-policy-service[bot] commented 10 months ago

Thank you for your feedback. This has been routed to the support team for assistance.

kairu-ms commented 10 months ago

Please use k8s-extension 1.4.5

PicaChen commented 10 months ago

How can I change the k8s-extension version?

kairu-ms commented 10 months ago

Please try this command

az extension add --upgrade --name k8s-extension
PicaChen commented 10 months ago

Thanks for your helping!