Fehler bei linuxmuster-setup 7.1 (fehlendes cryptography-Modul)

Hallo zusammen,

ich versuche mich gerade an einer Neuinstallation von 7.1 (auf Proxmox) und bekomme eine Fehlermeldung beim Start und insbesondere beim Aufruf von linuxmuster-setup:

/usr/lib/python3/dist-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
/usr/lib/python3/dist-packages/paramiko/transport.py:154: CryptographyDeprecationWarning: Blowfish has been deprecated
  'class': algorithms.Blowfish,
Traceback (most recent call last):
  File "/usr/sbin/linuxmuster-setup", line 13, in <module>
    from functions import modIni
  File "/usr/lib/linuxmuster/functions.py", line 27, in <module>
    import requests
  File "/usr/lib/python3/dist-packages/requests/__init__.py", line 84, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/crypto.py", line 1517, in <module>
    class X509StoreFlags(object):
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/crypto.py", line 1537, in X509StoreFlags
    CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

Hat jemand eine Idee, wie man das umschifft? Ich habe mich - denke ich - penibel an die Anleitung gehalten.

Viele Grüße
Thomas

Hallo Thomas,
wie genau sieht die Fehlermeldung beim Start des v7.1 Servers aus ? Hinweise auf python ?
Kannst Du trotz o.g. Fehlermeldung linuxmuster-setup durchführen ?
Als ich die v7.1 Doku erstellt hatte, lief dies einwandfrei durch, ich meine aber, dass ich auch bei python etwas auf dem Server aktualisieren musste …
Was steht denn in der log - Datei des Setup ?
LG
Chris

Also im Moment (nach der Installation und den Updates und linuxmuster-prepare) kommt das copy&pastete direkt und immer nach dem Aufruf von linuxmuster-setup.

Ich meine aber, dass ich das vorher schon mal vorbeihuschen sah - ich installiere gerade nochmal und achte genauer darauf.

Oder es sind Python-Pfade, die falsch gesetzt sind?
Mal schauen, ob das reproduzierbar ist.

Ansonsten finde ich die Anleitung sehr gelungen - ich notiere mir wieder, was mir so auffällt und lasse es dem Doku-Team zukommen.

2 „Gefällt mir“

Der Fehler bleibt.

linuxmuster-prepare scheint mir fehlerfrei durchzulaufen. In Sachen pyOpenSSL passiert folgendes:

  Attempting uninstall: cryptography
    Found existing installation: cryptography 2.1.4
    Uninstalling cryptography-2.1.4:
      Successfully uninstalled cryptography-2.1.4
  Attempting uninstall: pyOpenSSL
    Found existing installation: pyOpenSSL 17.5.0
    Uninstalling pyOpenSSL-17.5.0:
      Successfully uninstalled pyOpenSSL-17.5.0

Wenn ich direkt im Anschluss (oder nach einem Neustart) linuxmuster-setup aufrufe, kommt es zur genannten Fehlermeldung:

linuxmuster-setup
/usr/lib/python3/dist-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
/usr/lib/python3/dist-packages/paramiko/transport.py:154: CryptographyDeprecationWarning: Blowfish has been deprecated
  'class': algorithms.Blowfish,
Traceback (most recent call last):
  File "/usr/sbin/linuxmuster-setup", line 13, in <module>
    from functions import modIni
  File "/usr/lib/linuxmuster/functions.py", line 27, in <module>
    import requests
  File "/usr/lib/python3/dist-packages/requests/__init__.py", line 84, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/crypto.py", line 1517, in <module>
    class X509StoreFlags(object):
  File "/usr/local/lib/python3.6/dist-packages/OpenSSL/crypto.py", line 1537, in X509StoreFlags
    CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

Ein Aufruf als linuxadmin (mit oder ohne sudo) funktioniert nicht - hier lautet der Fehler

Traceback (most recent call last):
  File "/usr/sbin/linuxmuster-setup", line 8, in <module>
    import constants
ModuleNotFoundError: No module named 'constants'

Das ist aber ja vermutlich richtig so.

Viele Grüße
Thomas

Kleine Ergänzung: auch die WebUI ist zu diesem Zeitpunkt nicht erreichbar:

linuxmuster-webui.service - linuxmuster.net WebUI
   Loaded: loaded (/lib/systemd/system/linuxmuster-webui.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2022-04-27 11:56:37 CEST; 3min 51s ago
 Main PID: 2165 (code=exited, status=1/FAILURE)

Apr 27 11:56:37 server.linuxmuster.lan systemd[1]: Starting linuxmuster.net WebUI...
Apr 27 11:56:37 server.linuxmuster.lan systemd[1]: linuxmuster-webui.service: Can't open PID file /var/run/ajenti.pid (yet?) after start: No such file or directory
Apr 27 11:56:37 server.linuxmuster.lan systemd[1]: Started linuxmuster.net WebUI.
Apr 27 11:56:37 server.linuxmuster.lan systemd[1]: linuxmuster-webui.service: Main process exited, code=exited, status=1/FAILURE
Apr 27 11:56:37 server.linuxmuster.lan systemd[1]: linuxmuster-webui.service: Failed with result 'exit-code'.

Der Aufruf von ajenti-panel führt ebenfalls zum beschriebenen Fehler.

Ich vermute ja, das ist etwas für @Arnaud

Hallo @thoschi,

Probier mal bitte ob ein :

pip3 install pyOpenSSL==19.1.0

hilft.

Gruß

Arnaud

Hallo Arnaud,

pip3 install pyOpenSSL==19.1.0
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.utils import int_from_bytes
Requirement already satisfied: pyOpenSSL==19.1.0 in /usr/local/lib/python3.6/dist-packages (19.1.0)
Requirement already satisfied: cryptography>=2.8 in /usr/local/lib/python3.6/dist-packages (from pyOpenSSL==19.1.0) (37.0.0)
Requirement already satisfied: six>=1.5.2 in /usr/lib/python3/dist-packages (from pyOpenSSL==19.1.0) (1.11.0)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.6/dist-packages (from cryptography>=2.8->pyOpenSSL==19.1.0) (1.15.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi>=1.12->cryptography>=2.8->pyOpenSSL==19.1.0) (2.21)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Ändert leider nichts.

Viele Grüße
Thomas

Hallo Thomas,

Was hast du genau auf dem Server installiert :

pip3 list | grep 'crypt\|SSL'
dpkg -l | grep 'python3-'

?

Gruß

Arnaud

Hallo Arnaud,

ich habe nach der Grundinstallation nur linuxmuster-prepare aufgerufen (wie in der 7.1-Anleitung dokumentiert).

#pip3 list | grep 'crypt\|SSL'
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.utils import int_from_bytes
asn1crypto                 0.24.0
bcrypt                     3.1.4
cryptography               37.0.0
pycrypto                   2.6.1
pyOpenSSL                  19.1.0
scrypt                     0.8.20
#dpkg -l | grep 'python3-'
ii  libpython3-dev:amd64                   3.6.7-1~18.04                                   amd64        header files and a static library for Python (default)
ii  libpython3-stdlib:amd64                3.6.7-1~18.04                                   amd64        interactive high-level object-oriented language (default python3 version)
ii  python3-apport                         2.20.9-0ubuntu7.27                              all          Python 3 library for Apport crash report handling
ii  python3-apt                            1.6.5ubuntu0.7                                  amd64        Python 3 interface to libapt-pkg
ii  python3-asn1crypto                     0.24.0-1                                        all          Fast ASN.1 parser and serializer (Python 3)
ii  python3-attr                           17.4.0-2                                        all          Attributes without boilerplate (Python 3)
ii  python3-augeas                         0.5.0-1                                         all          Python3 bindings for Augeas
ii  python3-automat                        0.6.0-1                                         all          Self-service finite-state machines for the programmer on the go
ii  python3-bcrypt                         3.1.4-2                                         amd64        password hashing library for Python 3
ii  python3-blinker                        1.4+dfsg1-0.1                                   all          fast, simple object-to-object and broadcast signaling library
ii  python3-bs4                            4.6.0-1                                         all          error-tolerant HTML parser for Python 3
ii  python3-certifi                        2018.1.18-2                                     all          root certificates for validating SSL certs and verifying TLS hosts (python3)
ii  python3-cffi-backend                   1.11.5-1                                        amd64        Foreign Function Interface for Python 3 calling C code - runtime
ii  python3-chardet                        3.0.4-1                                         all          universal character encoding detector for Python3
ii  python3-click                          6.7-3                                           all          Simple wrapper around optparse for powerful command line utilities - Python 3.x
ii  python3-colorama                       0.3.7-1                                         all          Cross-platform colored terminal text in Python - Python 3.x
ii  python3-commandnotfound                18.04.6                                         all          Python 3 bindings for command-not-found.
ii  python3-configobj                      5.0.6-2                                         all          simple but powerful config file reader and writer for Python 3
ii  python3-constantly                     15.1.0-1                                        all          Symbolic constants in Python
ii  python3-crypto                         2.6.1-8ubuntu2                                  amd64        cryptographic algorithms and protocols for Python 3
ii  python3-cryptography                   2.1.4-1ubuntu1.4                                amd64        Python library exposing cryptographic recipes and primitives (Python 3)
ii  python3-dbus                           1.2.6-1                                         amd64        simple interprocess messaging system (Python 3 interface)
ii  python3-debconf                        1.5.66ubuntu1                                   all          interact with debconf from Python 3
ii  python3-debian                         0.1.32                                          all          Python 3 modules to work with Debian-related data formats
ii  python3-dev                            3.6.7-1~18.04                                   amd64        header files and a static library for Python (default)
ii  python3-dialog                         3.4.0-1                                         all          Python module for making simple terminal-based user interfaces
ii  python3-distro-info                    0.18ubuntu0.18.04.1                             all          information about distributions' releases (Python 3 module)
ii  python3-distupgrade                    1:18.04.45                                      all          manage release upgrades
ii  python3-distutils                      3.6.9-1~18.04                                   all          distutils package for Python 3.x
ii  python3-gdbm:amd64                     3.6.9-1~18.04                                   amd64        GNU dbm database support for Python 3.x
ii  python3-gi                             3.26.1-2ubuntu1                                 amd64        Python 3 bindings for gobject-introspection libraries
ii  python3-html5lib                       0.999999999-1                                   all          HTML parser/tokenizer based on the WHATWG HTML5 specification
ii  python3-httplib2                       0.9.2+dfsg-1ubuntu0.3                           all          comprehensive HTTP client library written for Python3
ii  python3-hyperlink                      17.3.1-2                                        all          Immutable, Pythonic, correct URLs.
ii  python3-idna                           2.6-1                                           all          Python IDNA2008 (RFC 5891) handling (Python 3)
ii  python3-incremental                    16.10.1-3                                       all          Library for versioning Python projects.
ii  python3-iniparse                       0.4-2.2                                         all          access and modify configuration data in INI files (Python 3)
ii  python3-ipy                            1:0.83-1                                        all          Python3 module for handling IPv4 and IPv6 addresses and networks
ii  python3-jinja2                         2.10-1ubuntu0.18.04.1                           all          small but fast and easy to use stand-alone template engine
ii  python3-json-pointer                   1.10-1                                          all          resolve JSON pointers - Python 3.x
ii  python3-jsonpatch                      1.19+really1.16-1fakesync1                      all          library to apply JSON patches - Python 3.x
ii  python3-jsonschema                     2.6.0-2                                         all          An(other) implementation of JSON Schema (Draft 3 and 4) - Python 3.x
ii  python3-jwt                            1.5.3+ds1-1                                     all          Python 3 implementation of JSON Web Token
ii  python3-keyring                        10.6.0-1                                        all          store and access your passwords safely - Python 3 version of the package
ii  python3-keyrings.alt                   3.0-1                                           all          alternate backend implementations for python3-keyring
ii  python3-ldap                           3.0.0-1ubuntu0.1                                amd64        LDAP interface module for Python3
ii  python3-ldap3                          2.4.1-1                                         all          Pure Python LDAP client library
ii  python3-lib2to3                        3.6.9-1~18.04                                   all          Interactive high-level object-oriented language (2to3, version 3.6)
ii  python3-lxml:amd64                     4.2.1-1ubuntu0.6                                amd64        pythonic binding for the libxml2 and libxslt libraries
ii  python3-markupsafe                     1.0-1build1                                     amd64        HTML/XHTML/XML string library for Python 3
ii  python3-minimal                        3.6.7-1~18.04                                   amd64        minimal subset of the Python language (default python3 version)
ii  python3-netaddr                        0.7.19-1                                        all          manipulation of various common network address notations (Python 3)
ii  python3-netifaces                      0.10.4-0.1build4                                amd64        portable network interface information - Python 3.x
ii  python3-newt:amd64                     0.52.20-1ubuntu1                                amd64        NEWT module for Python3
ii  python3-oauthlib                       2.0.6-1                                         all          generic, spec-compliant implementation of OAuth for Python3
ii  python3-openssl                        17.5.0-1ubuntu1                                 all          Python 3 wrapper around the OpenSSL library
ii  python3-pam                            0.4.2-13.2ubuntu4                               amd64        Python interface to the PAM library
ii  python3-paramiko                       2.0.0-1ubuntu1.3                                all          Make ssh v2 connections (Python 3)
ii  python3-pexpect                        4.2.1-1                                         all          Python 3 module for automating interactive applications
ii  python3-pip                            9.0.1-2.3~ubuntu1.18.04.5                       all          Python package installer
ii  python3-pkg-resources                  39.0.1-2                                        all          Package Discovery and Resource Access using pkg_resources
ii  python3-problem-report                 2.20.9-0ubuntu7.27                              all          Python 3 library to handle problem reports
ii  python3-ptyprocess                     0.5.2-1                                         all          Run a subprocess in a pseudo terminal from Python 3
ii  python3-pyasn1                         0.4.2-3                                         all          ASN.1 library for Python (Python 3 module)
ii  python3-pyasn1-modules                 0.2.1-0.2                                       all          Collection of protocols modules written in ASN.1 language (Python 3)
ii  python3-reconfigure                    0.1.74+git49a20890-3                            all          simple config file management library (Python 3)
ii  python3-requests                       2.18.4-2ubuntu0.1                               all          elegant and simple HTTP library for Python3, built for human beings
ii  python3-requests-unixsocket            0.1.5-3                                         all          Use requests to talk HTTP via a UNIX domain socket - Python 3.x
ii  python3-secretstorage                  2.3.1-2                                         all          Python module for storing secrets - Python 3.x version
ii  python3-serial                         3.4-2                                           all          pyserial - module encapsulating access for the serial port
ii  python3-service-identity               16.0.0-2                                        all          Service identity verification for pyOpenSSL (Python 3 module)
ii  python3-setuptools                     39.0.1-2                                        all          Python3 Distutils Enhancements
ii  python3-six                            1.11.0-2                                        all          Python 2 and 3 compatibility library (Python 3 interface)
ii  python3-software-properties            0.96.24.32.18                                   all          manage the repositories that you install software from
ii  python3-systemd                        234-1build1                                     amd64        Python 3 bindings for systemd
ii  python3-twisted                        17.9.0-2ubuntu0.3                               all          Event-based framework for internet applications
ii  python3-twisted-bin:amd64              17.9.0-2ubuntu0.3                               amd64        Event-based framework for internet applications
ii  python3-update-manager                 1:18.04.11.13                                   all          python 3.x module for update-manager
ii  python3-urllib3                        1.22-1ubuntu0.18.04.2                           all          HTTP library with thread-safe connection pooling for Python3
ii  python3-webencodings                   0.5-2                                           all          Python implementation of the WHATWG Encoding standard
ii  python3-wheel                          0.30.0-0.2                                      all          built-package format for Python
ii  python3-xdg                            0.25-4ubuntu1.1                                 all          Python 3 library to access freedesktop.org standards
ii  python3-yaml                           3.12-1build2                                    amd64        YAML parser and emitter for Python3
ii  python3-zope.interface                 4.3.2-1build2                                   amd64        Interfaces for Python3

Viele Grüße
Thomas

Ok Thomas, jetzt sehe ich das Problem.

Probier mal bitte :

pip3 install cryptography==3.4.6

Gruß

Arnaud

1 „Gefällt mir“

Et voilà - das war es! Sowohl auf der Konsole als auch die WebUI laufen nach einem Neustart.

Die Python-Abhängigkeits-Hölle :slight_smile:

Danke für die schnelle Hilfe.
Thomas

Für’s Protokoll:

pip3 install cryptography==3.4.6
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.utils import int_from_bytes
Collecting cryptography==3.4.6
  Downloading cryptography-3.4.6-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB)
     |████████████████████████████████| 3.2 MB 6.0 MB/s            
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.6/dist-packages (from cryptography==3.4.6) (1.15.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi>=1.12->cryptography==3.4.6) (2.21)
Installing collected packages: cryptography
  Attempting uninstall: cryptography
    Found existing installation: cryptography 37.0.0
    Uninstalling cryptography-37.0.0:
      Successfully uninstalled cryptography-37.0.0
Successfully installed cryptography-3.4.6
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

1 „Gefällt mir“

Hallo @Arnaud ,
ich habe das ebenfalls gemacht. Und zwar hatte ich gedacht, dass ich das Modul vielleicht schon unter 7.0 installieren kann, damit es später beim 7.1-Update nicht zu Fehlermeldungen kommt. Da es zu folgender Meldung kam, habe ich es aber gerade wieder auf 2.9.2 zurückgesetzt.

Jedenfalls wurde gemeldet:

pip3 install cryptography==3.4.6
Collecting cryptography==3.4.6
  Downloading cryptography-3.4.6-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB)
     |████████████████████████████████| 3.2 MB 2.4 MB/s            
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.6/dist-packages (from cryptography==3.4.6) (1.14.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi>=1.12->cryptography==3.4.6) (2.20)
Installing collected packages: cryptography
  Attempting uninstall: cryptography
    Found existing installation: cryptography 2.9.2
    Uninstalling cryptography-2.9.2:
      Successfully uninstalled cryptography-2.9.2
Successfully installed cryptography-3.4.6

Nun ist es aber so:

/usr/bin/python3 -m pip install --upgrade pip
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
Requirement already satisfied: pip in /usr/local/lib/python3.6/dist-packages (21.3.1)

Da passt also nun etwas nicht mehr zusammen, wie es aussieht. Hast Du eine gute Idee?
Danke und viele Grüße,
Michael

Hallo Michael,

Das ist nur eine Warnung von einer Funktion die bald gelöscht wird, kein Problem in sich.

In diesem Fall sollte es kein Problem sein, aber ich rate davon ab : die Versionen von Ajenti zwischen 7.0 und 7.1 sich weit weg und haben anderen Abhängigkeiten.

Gruß

Arnaud

Ok, danke. Dann warte ich noch etwas mit dem Upgrade.

Hallo zusammen,

das Problem besteht leider nach wie vor. linuxmuster-setup bricht ab, wenn man nicht vorher obigen Befehl ansetzt. Das müsste wohl noch in linuxmuster-prepare gefixt werden.

Beste Grüße

Jörg