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 extension add is not installing dependent pycryptodome library defined in setup.py #20431

Closed
NarayanThiru opened this issue Nov 19, 2021 · 1 comment

Comments

@NarayanThiru
Copy link
Member

Describe the bug
k8s-configuration extension has defined pycryptodome as dependent library in setup.py (https://github.com/Azure/azure-cli-extensions/blob/main/src/k8s-configuration/setup.py#L33), is not getting installed when the extension is added. This was reported by customer - #19562

To Reproduce
Install k8s-configuration extension
Then run az k8s-configuration show
NOTE: This was also repro'd by Az CLI Team, when reported in Internal Teams channel
The command fails with the following error
The command failed with an unexpected error. Here is the traceback:
Cannot load native module 'Crypto.PublicKey._ec_ws': Trying '_ec_ws.cp38-win32.pyd': cannot load library 'C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\Crypto\Util..\PublicKey_ec_ws.cp38-win32.pyd': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\Users\nithinkadumberi\.azure\cliextensions\k8s-configuration\Crypto\Util\..\PublicKey\_ec_ws.cp38-win32.pyd', Trying '_ec_ws.pyd': cannot load library 'C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\Crypto\Util..\PublicKey_ec_ws.pyd': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\Users\nithinkadumberi\.azure\cliextensions\k8s-configuration\Crypto\Util\..\PublicKey\ec_ws.pyd'
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 556, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/init.py", line 517, in load_arguments
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 313, in load_arguments
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/commands.py", line 104, in load_arguments
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 367, in arguments_loader
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 70, in load_getter_op_arguments
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
File "importlib_init
.py", line 127, in import_module
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\azext_k8s_configuration\custom.py", line 12, in
from azext_k8s_configuration._validators import _validate_known_hosts, _validate_url_with_params,
File "C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\azext_k8s_configuration_validators.py", line 18, in
from Crypto.PublicKey import RSA, ECC, DSA
File "C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\Crypto\PublicKey\ECC.py", line 58, in
_ec_lib = load_pycryptodome_raw_lib("Crypto.PublicKey._ec_ws", """
File "C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\Crypto\Util_raw_api.py", line 308, in load_pycryptodome_raw_lib
raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'Crypto.PublicKey._ec_ws': Trying '_ec_ws.cp38-win32.pyd': cannot load library 'C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\Crypto\Util..\PublicKey_ec_ws.cp38-win32.pyd': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\Users\nithinkadumberi\.azure\cliextensions\k8s-configuration\Crypto\Util\..\PublicKey\_ec_ws.cp38-win32.pyd', Trying '_ec_ws.pyd': cannot load library 'C:\Users\nithinkadumberi.azure\cliextensions\k8s-configuration\Crypto\Util..\PublicKey_ec_ws.pyd': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\Users\nithinkadumberi\.azure\cliextensions\k8s-configuration\Crypto\Util\..\PublicKey\_ec_ws.pyd'

Expected behavior
az k8s-configuration show command runs successfully

Environment summary
Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.27.0 *

Extensions:
aks-preview 0.5.29
azure-devops 0.20.0
blueprint 0.3.1
connectedk8s 1.1.7
k8s-configuration 1.1.0
resource-graph 2.1.0

Additional context

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 19, 2021
@zhoxing-ms
Copy link
Contributor

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
azure-cli-core 2.30.0.post20211112091047 requires requests[socks]~=2.25.1, but you have requests 2.26.0 which is incompatible.

This issue is caused by the dependency conflicts introduced by PR #18931. And we already have a PR #19801 can solve this issue
We plan to release the fix PR on 12-07

@jiasli jiasli removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants