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

az connectedk8s connect cannot find kubernetes.client. #3844

Closed
YusukeTobo opened this issue Aug 31, 2021 · 4 comments
Closed

az connectedk8s connect cannot find kubernetes.client. #3844

YusukeTobo opened this issue Aug 31, 2021 · 4 comments
Labels
Connected Kubernetes Service Attention This issue is responsible by Azure service team.

Comments

@YusukeTobo
Copy link

YusukeTobo commented Aug 31, 2021

Extension name (the extension in question)

connectedk8s

Description of issue (in as much detail as possible)

In the middle of the instructions below, az connectedk8s cannot find kubernetes.client.
https://github.com/MicrosoftDocs/azure-docs/blob/25169e54940a75e34fcf600a2ffd53f5dff247e2/articles/app-service/manage-create-arc-environment.md

Here is the Traceback.

% az connectedk8s connect --resource-group $groupName --name $clusterName
The command failed with an unexpected error. Here is the traceback:
cannot import name 'Configuration'
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 556, in execute
    self.commands_loader.load_arguments(command)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 517, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 313, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/opt/az/lib/python3.6/site-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
    op = self.get_op_handler(self.op_path)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
    handler = import_module(mod_to_import)
  File "/opt/az/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/yutobo/.azure/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 33, in <module>
    from kubernetes import client as kube_client, config
  File "/home/yutobo/.azure/cliextensions/connectedk8s/kubernetes/config/__init__.py", line 16, in <module>
    from .incluster_config import load_incluster_config
  File "/home/yutobo/.azure/cliextensions/connectedk8s/kubernetes/config/incluster_config.py", line 17, in <module>
    from kubernetes.client import Configuration
ImportError: cannot import name 'Configuration'

Additional Information

% az version --verbose
{
  "azure-cli": "2.27.2",
  "azure-cli-core": "2.27.2",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "appservice-kube": "0.1.21",
    "connectedk8s": "Unknown"
  }
}
uname -a
Linux *** 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Aug 31, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Aug 31, 2021
@yonzhan yonzhan added needs-triage This is a new issue that needs to be triaged to the appropriate team. Service Attention This issue is responsible by Azure service team. labels Aug 31, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Aug 31, 2021
@ghost
Copy link

ghost commented Aug 31, 2021

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

Issue Details

Extension name (the extension in question)

connectedk8s

Description of issue (in as much detail as possible)

In the middle of the instructions below, az connectedk8s cannot find kubernetes.client.
https://github.com/MicrosoftDocs/azure-docs/blob/25169e54940a75e34fcf600a2ffd53f5dff247e2/articles/app-service/manage-create-arc-environment.md

Here is the Traceback.

% az connectedk8s connect --resource-group $groupName --name $clusterName
The command failed with an unexpected error. Here is the traceback:
cannot import name 'Configuration'
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 556, in execute
    self.commands_loader.load_arguments(command)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 517, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 313, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/opt/az/lib/python3.6/site-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
    op = self.get_op_handler(self.op_path)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
    handler = import_module(mod_to_import)
  File "/opt/az/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/yutobo/.azure/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 33, in <module>
    from kubernetes import client as kube_client, config
  File "/home/yutobo/.azure/cliextensions/connectedk8s/kubernetes/config/__init__.py", line 16, in <module>
    from .incluster_config import load_incluster_config
  File "/home/yutobo/.azure/cliextensions/connectedk8s/kubernetes/config/incluster_config.py", line 17, in <module>
    from kubernetes.client import Configuration
ImportError: cannot import name 'Configuration'

Additional Information

% az version --verbose
{
  "azure-cli": "2.27.2",
  "azure-cli-core": "2.27.2",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "appservice-kube": "0.1.21",
    "connectedk8s": "Unknown"
  }
}
uname -a
Linux *** 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Author: YusukeTobo
Assignees: -
Labels:

Service Attention, needs-triage, Connected Kubernetes

Milestone: -

@yonzhan
Copy link
Collaborator

yonzhan commented Aug 31, 2021

route to service team

@akashkeshari
Copy link
Contributor

akashkeshari commented Sep 18, 2021

@YusukeTobo ,

Seems like the connectedk8s extension was not installed properly.
Please try re-installing the extension and try again.

  1. az extension remove -n connectedk8s
  2. az extension add -n connectedk8s --debug
  3. az connectedk8s connect --resource-group $groupName --name $clusterName

Please also share the logs of step 2 mentioned above

@YusukeTobo
Copy link
Author

@akashkeshari Thank you so much for helping me. Once I reinstall the extension, I could run az connectedk8s connect successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Connected Kubernetes Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants