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

libcrypto or libeay32 cannot be loaded on Python 3.8 x86 #34

Closed
ader1990 opened this issue Feb 3, 2020 · 0 comments
Closed

libcrypto or libeay32 cannot be loaded on Python 3.8 x86 #34

ader1990 opened this issue Feb 3, 2020 · 0 comments

Comments

@ader1990
Copy link
Member

ader1990 commented Feb 3, 2020

When testing cloudbase-init using GitHub actions, there is a problem to find / load the necessary libraries for password encryption. This happens on Python 3.8 x86 environment.

Potential fix: use cryptography Python module instead of the flaky openssl library loading on Windows.

Error log:

2020-02-03T15:53:57.4616886Z 2020-02-03 15:53:57.451 1508 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin' load_class C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\utils\classloader.py:27�[00m
2020-02-03T15:53:57.5144330Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell [-] Could not find module 'libcrypto'. Try using the full path with constructor syntax.: FileNotFoundError: Could not find module 'libcrypto'. Try using the full path with constructor syntax.
2020-02-03T15:53:57.5146619Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell Traceback (most recent call last):
2020-02-03T15:53:57.5185814Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\utils\crypt.py", line 32, in <module>
2020-02-03T15:53:57.5186173Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     openssl = ctypes.cdll.libeay32
2020-02-03T15:53:57.5186519Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 443, in __getattr__
2020-02-03T15:53:57.5186783Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     dll = self._dlltype(name)
2020-02-03T15:53:57.5187379Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 373, in __init__
2020-02-03T15:53:57.5187632Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     self._handle = _dlopen(self._name, mode)
2020-02-03T15:53:57.5187892Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell FileNotFoundError: Could not find module 'libeay32'. Try using the full path with constructor syntax.
2020-02-03T15:53:57.5188126Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell 
2020-02-03T15:53:57.5188366Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell During handling of the above exception, another exception occurred:
2020-02-03T15:53:57.5188576Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell 
2020-02-03T15:53:57.5188804Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell Traceback (most recent call last):
2020-02-03T15:53:57.5189616Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\shell.py", line 33, in main
2020-02-03T15:53:57.5189974Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     init.InitManager().configure_host()
2020-02-03T15:53:57.5190242Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\init.py", line 177, in configure_host
2020-02-03T15:53:57.5190502Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     stage_success, reboot_required = self._handle_plugins_stage(
2020-02-03T15:53:57.5190817Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\init.py", line 109, in _handle_plugins_stage
2020-02-03T15:53:57.5191042Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     plugins = plugins_factory.load_plugins(stage)
2020-02-03T15:53:57.5191310Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\plugins\factory.py", line 68, in load_plugins
2020-02-03T15:53:57.5192203Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     plugin_cls = cl.load_class(class_path)
2020-02-03T15:53:57.5192574Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\utils\classloader.py", line 29, in load_class
2020-02-03T15:53:57.5192833Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     module = __import__(parts[0], fromlist=parts[1])
2020-02-03T15:53:57.5193103Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\plugins\common\setuserpassword.py", line 24, in <module>
2020-02-03T15:53:57.5193355Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     from cloudbaseinit.utils import crypt
2020-02-03T15:53:57.5193696Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\utils\crypt.py", line 34, in <module>
2020-02-03T15:53:57.5193926Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     openssl = ctypes.cdll.libcrypto
2020-02-03T15:53:57.5194178Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 443, in __getattr__
2020-02-03T15:53:57.5194418Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     dll = self._dlltype(name)
2020-02-03T15:53:57.5194667Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 373, in __init__
2020-02-03T15:53:57.5194906Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell     self._handle = _dlopen(self._name, mode)
2020-02-03T15:53:57.5195226Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell FileNotFoundError: Could not find module 'libcrypto'. Try using the full path with constructor syntax.
2020-02-03T15:53:57.5195655Z 2020-02-03 15:53:57.483 1508 ERROR cloudbaseinit.shell �[00m
2020-02-03T15:53:57.5197741Z 2020-02-03 15:53:57.498 1508 CRITICAL cloudbaseinit [-] Unhandled error: FileNotFoundError: Could not find module 'libcrypto'. Try using the full path with constructor syntax.
2020-02-03T15:53:57.5200108Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit Traceback (most recent call last):
2020-02-03T15:53:57.5200459Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\utils\crypt.py", line 32, in <module>
2020-02-03T15:53:57.5200729Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     openssl = ctypes.cdll.libeay32
2020-02-03T15:53:57.5201022Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 443, in __getattr__
2020-02-03T15:53:57.5201281Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     dll = self._dlltype(name)
2020-02-03T15:53:57.5201698Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 373, in __init__
2020-02-03T15:53:57.5201969Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     self._handle = _dlopen(self._name, mode)
2020-02-03T15:53:57.5202238Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit FileNotFoundError: Could not find module 'libeay32'. Try using the full path with constructor syntax.
2020-02-03T15:53:57.5202484Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit 
2020-02-03T15:53:57.5202733Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit During handling of the above exception, another exception occurred:
2020-02-03T15:53:57.5202969Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit 
2020-02-03T15:53:57.5203200Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit Traceback (most recent call last):
2020-02-03T15:53:57.5203448Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\Scripts\cloudbase-init-script.py", line 11, in <module>
2020-02-03T15:53:57.5203734Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     load_entry_point('cloudbase-init==0.9.12.dev607', 'console_scripts', 'cloudbase-init')()
2020-02-03T15:53:57.5204016Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\shell.py", line 33, in main
2020-02-03T15:53:57.5204277Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     init.InitManager().configure_host()
2020-02-03T15:53:57.5204548Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\init.py", line 177, in configure_host
2020-02-03T15:53:57.5204811Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     stage_success, reboot_required = self._handle_plugins_stage(
2020-02-03T15:53:57.5205087Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\init.py", line 109, in _handle_plugins_stage
2020-02-03T15:53:57.5205335Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     plugins = plugins_factory.load_plugins(stage)
2020-02-03T15:53:57.5205604Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\plugins\factory.py", line 68, in load_plugins
2020-02-03T15:53:57.5205937Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     plugin_cls = cl.load_class(class_path)
2020-02-03T15:53:57.5206198Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\utils\classloader.py", line 29, in load_class
2020-02-03T15:53:57.5206445Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     module = __import__(parts[0], fromlist=parts[1])
2020-02-03T15:53:57.5206710Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\plugins\common\setuserpassword.py", line 24, in <module>
2020-02-03T15:53:57.5207092Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     from cloudbaseinit.utils import crypt
2020-02-03T15:53:57.5207348Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\site-packages\cloudbaseinit\utils\crypt.py", line 34, in <module>
2020-02-03T15:53:57.5207593Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     openssl = ctypes.cdll.libcrypto
2020-02-03T15:53:57.5207890Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 443, in __getattr__
2020-02-03T15:53:57.5208140Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     dll = self._dlltype(name)
2020-02-03T15:53:57.5208407Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit   File "C:\hostedtoolcache\windows\Python\3.8.1\x86\lib\ctypes\__init__.py", line 373, in __init__
2020-02-03T15:53:57.5208836Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit     self._handle = _dlopen(self._name, mode)
2020-02-03T15:53:57.5209132Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit FileNotFoundError: Could not find module 'libcrypto'. Try using the full path with constructor syntax.
2020-02-03T15:53:57.5209345Z 2020-02-03 15:53:57.498 1508 ERROR cloudbaseinit �[00m
ader1990 added a commit to ader1990/cloudbase-init-1 that referenced this issue Dec 9, 2022
Use cryptography instead of the flaky openssl libraries loading.
If the libssl DLLs were not present or were present in another order
then the required one, there could be errors when securing the password
before sending it to the metadata service.

Fixes: cloudbase#34

Change-Id: I1a2245e199f65f4665071ada9576dcae77a3a432
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

1 participant