azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

`az k8s-configuration create` fails with an exception

Open surajssd opened this issue 5 years ago • 4 comments

Describe the bug

Command Name

az k8s-configuration create

Errors:

The command failed with an unexpected error. Here is the traceback:
cannot import name 'ECC' from 'Crypto.PublicKey' (/usr/lib64/python3.9/site-packages/Crypto/PublicKey/__init__.py)
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 556, in execute
    self.commands_loader.load_arguments(command)
  File "/usr/lib64/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 "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 313, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/usr/lib64/az/lib/python3.6/site-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/usr/lib64/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 "/usr/lib64/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 "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/hummer/.azure/cliextensions/k8s-configuration/azext_k8s_configuration/custom.py", line 15, in <module>
    from Crypto.PublicKey import RSA, ECC, DSA
ImportError: cannot import name 'ECC' from 'Crypto.PublicKey' (/usr/lib64/python3.9/site-packages/Crypto/PublicKey/__init__.py)

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az extension add --name k8s-configuration
  • az k8s-configuration create --name {} --cluster-name {} --resource-group {} --operator-instance-name {} --operator-namespace {} --repository-url {} --scope {} --cluster-type {} --operator-params={}

Expected Behavior

The CLI creates the resource.

Environment Summary

Linux-5.12.12-200.fc33.x86_64-x86_64-with-glibc2.32
Python 3.9.5
Installer: RPM

azure-cli 2.25.0

Extensions:
k8s-configuration 1.0.0

Additional Context

I am planning to onboard a cluster to Azure Arc following this guide (not merged yet).

surajssd avatar Jun 28 '21 14:06 surajssd

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

Issue Details

Describe the bug

Command Name

az k8s-configuration create

Errors:

The command failed with an unexpected error. Here is the traceback:
cannot import name 'ECC' from 'Crypto.PublicKey' (/usr/lib64/python3.9/site-packages/Crypto/PublicKey/__init__.py)
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 556, in execute
    self.commands_loader.load_arguments(command)
  File "/usr/lib64/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 "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 313, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/usr/lib64/az/lib/python3.6/site-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/usr/lib64/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 "/usr/lib64/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 "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/hummer/.azure/cliextensions/k8s-configuration/azext_k8s_configuration/custom.py", line 15, in <module>
    from Crypto.PublicKey import RSA, ECC, DSA
ImportError: cannot import name 'ECC' from 'Crypto.PublicKey' (/usr/lib64/python3.9/site-packages/Crypto/PublicKey/__init__.py)

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az extension add --name k8s-configuration
  • az k8s-configuration create --name {} --cluster-name {} --resource-group {} --operator-instance-name {} --operator-namespace {} --repository-url {} --scope {} --cluster-type {} --operator-params={}

Expected Behavior

The CLI creates the resource.

Environment Summary

Linux-5.12.12-200.fc33.x86_64-x86_64-with-glibc2.32
Python 3.9.5
Installer: RPM

azure-cli 2.25.0

Extensions:
k8s-configuration 1.0.0

Additional Context

I am planning to onboard a cluster to Azure Arc following this guide (not merged yet).

Author: surajssd
Assignees: -
Labels:

Kubernetes Configuration, Service Attention

Milestone: -

ghost avatar Jun 28 '21 14:06 ghost

route to service team

yonzhan avatar Jun 28 '21 14:06 yonzhan

Resolving as K8sConfiguration feature is in deprecation path. Moreover, this issue is more than 2 years old and we seem to have missed this :(

NarayanThiru avatar Jan 08 '24 18:01 NarayanThiru

@yonzhan , can you please help close this issue? I am not sure how to close it. @bavneetsingh16 , FYI.

NarayanThiru avatar Jan 08 '24 18:01 NarayanThiru