strongswan / strongMan

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

Errors while installing strongMan on macOS #142

Closed matteocarnelos closed 11 months ago

matteocarnelos commented 11 months ago

Hi, I'm trying to install strongMan on macOS Ventura, but when I run:

sudo ./setup.py install

I get the following errors:

Start strongMan installation
    - Virtualenv
    - Requirements
WARNING: The directory '/Users/matteocarnelos/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
    - Database migration
        Delete strongMan/db.sqlite3
[Errno 2] No such file or directory: '/Users/matteocarnelos/strongMan/strongMan/db.sqlite3'
Traceback (most recent call last):
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/_openssl/_libcrypto_ctypes.py", line 304, in <module>
    libcrypto.EVP_PKEY_size.argtypes = [
  File "/opt/miniconda3/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/opt/miniconda3/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x7ff9139b99f0, EVP_PKEY_size): symbol not found. Did you mean: 'EVP_PKEY_free'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/matteocarnelos/strongMan/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/opt/miniconda3/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/matteocarnelos/strongMan/strongMan/apps/connections/models/__init__.py", line 1, in <module>
    from .connections import *
  File "/Users/matteocarnelos/strongMan/strongMan/apps/connections/models/connections.py", line 10, in <module>
    from strongMan.apps.connections.models.common import State
  File "/Users/matteocarnelos/strongMan/strongMan/apps/connections/models/common.py", line 3, in <module>
    from strongMan.apps.certificates.models import MessageObj
  File "/Users/matteocarnelos/strongMan/strongMan/apps/certificates/models/__init__.py", line 1, in <module>
    from .certificates import *
  File "/Users/matteocarnelos/strongMan/strongMan/apps/certificates/models/certificates.py", line 8, in <module>
    from ..container_reader import X509Reader
  File "/Users/matteocarnelos/strongMan/strongMan/apps/certificates/container_reader.py", line 7, in <module>
    from oscrypto import keys as k
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/keys.py", line 5, in <module>
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/_asymmetric.py", line 27, in <module>
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/util.py", line 10, in <module>
    from ._mac.util import rand_bytes
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/_mac/util.py", line 208, in <module>
    from .._openssl._libcrypto import libcrypto
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/_openssl/_libcrypto.py", line 15, in <module>
    from ._libcrypto_ctypes import (
  File "/Users/matteocarnelos/strongMan/env/lib/python3.10/site-packages/oscrypto/_openssl/_libcrypto_ctypes.py", line 688, in <module>
    raise FFIEngineError('Error initializing ctypes')
oscrypto._ffi.FFIEngineError: Error initializing ctypes
Command '['/Users/matteocarnelos/strongMan/env/bin/python', '/Users/matteocarnelos/strongMan/manage.py', 'makemigrations', 'certificates', '--settings=strongMan.settings.local']' returned non-zero exit status 1.

Context

tobiasbrunner commented 11 months ago

Please try changing this: https://github.com/strongswan/strongMan/blob/3934ad3bf53da0d70b1ad52f44db5a9fc7742073/requirements.txt#L2

to oscrypto==1.3.0.

matteocarnelos commented 11 months ago

Unfortunately it results in dependency conflicts:

Start strongMan installation
    - Virtualenv
    - Requirements
WARNING: The directory '/Users/matteocarnelos/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
ERROR: Cannot install -r requirements.txt (line 2) and asn1crypto==1.4.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Command '['/Users/matteocarnelos/strongMan/env/bin/pip', 'install', '-r', 'requirements.txt']' returned non-zero exit status 1.

Update

Bumping asn1crypto version to 1.5.0 in requirements.txt solves the dependency conflict but results in the original error messages.

tobiasbrunner commented 11 months ago

Which original error message are you referring to?

matteocarnelos commented 11 months ago

I meant the one posted at the beginning.

However, I managed to solve the issue by bumping the version number of oscrypto to 1.3.0 and asn1crypto to 1.5.1. Now the installation goes through successfully, thanks!

tobiasbrunner commented 11 months ago

OK, great, I'll push that to master soon.