strongswan / strongMan

Management UI for strongSwan
https://www.strongswan.org/
Other
117 stars 39 forks source link

Error detecting the version of libcrypto #148

Closed TelDragon closed 1 year ago

TelDragon commented 1 year ago
cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

python3 --version
Python 3.11.2

pip3 --version
pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)

sqlite3 --version
3.40.1 2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f3alt1

virtualenv --version
virtualenv 20.17.1+ds from /usr/lib/python3/dist-packages/virtualenv/__init__.py

install log:

sudo python3 setup.py install
Start strongMan installation
        - Virtualenv
        - Requirements
        - Database migration
                Delete strongMan/db.sqlite3
[Errno 2] No such file or directory: '/usr/local/strongMan/strongMan/db.sqlite3'
Traceback (most recent call last):
  File "/usr/local/strongMan/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/strongMan/strongMan/apps/connections/models/__init__.py", line 1, in <module>
    from .connections import *
  File "/usr/local/strongMan/strongMan/apps/connections/models/connections.py", line 10, in <module>
    from strongMan.apps.connections.models.common import State
  File "/usr/local/strongMan/strongMan/apps/connections/models/common.py", line 3, in <module>
    from strongMan.apps.certificates.models import MessageObj
  File "/usr/local/strongMan/strongMan/apps/certificates/models/__init__.py", line 1, in <module>
    from .certificates import *
  File "/usr/local/strongMan/strongMan/apps/certificates/models/certificates.py", line 8, in <module>
    from ..container_reader import X509Reader
  File "/usr/local/strongMan/strongMan/apps/certificates/container_reader.py", line 7, in <module>
    from oscrypto import keys as k
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/oscrypto/keys.py", line 5, in <module>
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/oscrypto/_asymmetric.py", line 27, in <module>
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/oscrypto/util.py", line 14, in <module>
    from ._openssl.util import rand_bytes
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/oscrypto/_openssl/util.py", line 6, in <module>
    from ._libcrypto import libcrypto, libcrypto_version_info, handle_openssl_error
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/oscrypto/_openssl/_libcrypto.py", line 15, in <module>
    from ._libcrypto_ctypes import (
  File "/usr/local/strongMan/env/lib/python3.11/site-packages/oscrypto/_openssl/_libcrypto_ctypes.py", line 47, in <module>
    raise LibraryNotFoundError('Error detecting the version of libcrypto')
oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto
Command '['/usr/local/strongMan/env/bin/python', '/usr/local/strongMan/manage.py', 'makemigrations', 'certificates', '--settings=strongMan.settings.local']' returned non-zero exit status 1.
tobiasbrunner commented 1 year ago

This is due to a problem in oscrypto. Until there is a new release, there are only hacks (like installing oscrypto from a specific commit that includes the fix or changing the OpenSSL version).

TelDragon commented 1 year ago

This is due to a problem in oscrypto. Until there is a new release, there are only hacks (like installing from a specific commit that includes the fix or changing the OpenSSL version).oscrypto

Thank you~ It is now running with other repairs Installation command

sudo /usr/local/strongMan/env/bin/python -m pip install git+https://github.com/wbond/oscrypto.git@1547f535001ba568b239b8797465536759c742a3
Collecting git+https://github.com/wbond/oscrypto.git@1547f535001ba568b239b8797465536759c742a3
  Cloning https://github.com/wbond/oscrypto.git (to revision 1547f535001ba568b239b8797465536759c742a3) to /tmp/pip-req-build-efcdcum5
  Running command git clone --filter=blob:none --quiet https://github.com/wbond/oscrypto.git /tmp/pip-req-build-efcdcum5
  Running command git rev-parse -q --verify 'sha^1547f535001ba568b239b8797465536759c742a3'
  Running command git fetch -q https://github.com/wbond/oscrypto.git 1547f535001ba568b239b8797465536759c742a3
  Resolved https://github.com/wbond/oscrypto.git to commit 1547f535001ba568b239b8797465536759c742a3
  Preparing metadata (setup.py) ... done
Requirement already satisfied: asn1crypto>=1.5.1 in /usr/local/strongMan/env/lib/python3.11/site-packages (from oscrypto==1.3.0) (1.5.1)
Building wheels for collected packages: oscrypto
  Building wheel for oscrypto (setup.py) ... done
  Created wheel for oscrypto: filename=oscrypto-1.3.0-py3-none-any.whl size=195213 sha256=5dfa7f25de6c61cabe0b34b199f99d421c3517aec5351dd6066915e0f63f41ac
  Stored in directory: /root/.cache/pip/wheels/80/db/e6/421dd0d1c3637fca9c751909ae266207df863edb0fe9ae98e5
Successfully built oscrypto
Installing collected packages: oscrypto
Successfully installed oscrypto-1.3.0
$ sudo /usr/local/strongMan/env/bin/python -m pip list
Package        Version
-------------- ------------
asgiref        3.7.2
asn1crypto     1.5.1
dj-static      0.0.6
Django         3.1.14
django-tables2 2.3.4
gunicorn       20.0.4
oscrypto       1.3.0
pip            23.0.1
pyaes          1.6.1
pytz           2023.3.post1
setuptools     66.1.1
sqlparse       0.4.4
static3        0.7.0
vici           5.8.4
wheel          0.38.4
$ sudo /usr/local/strongMan/env/bin/python /usr/local/strongMan/run.py 
/usr/local/strongMan
Press CTRL + C to stop strongMan

[2023-11-13 16:26:41 +0000] [5781] [INFO] Starting gunicorn 20.0.4
[2023-11-13 16:26:41 +0000] [5781] [INFO] Listening at: http://0.0.0.0:1515 (5781)
[2023-11-13 16:26:41 +0000] [5781] [INFO] Using worker: sync
[2023-11-13 16:26:41 +0000] [5782] [INFO] Booting worker with pid: 5782
[2023-11-13 16:26:41 +0000] [5783] [INFO] Booting worker with pid: 5783
[2023-11-13 16:26:41 +0000] [5784] [INFO] Booting worker with pid: 5784
[2023-11-13 16:26:41 +0000] [5785] [INFO] Booting worker with pid: 5785
[2023-11-13 16:26:41 +0000] [5786] [INFO] Booting worker with pid: 5786
[2023-11-13 16:26:41 +0000] [5787] [INFO] Booting worker with pid: 5787