Matrix-synapse fails to install

Creating a bug report/issue

Required Information

  • DietPi version | cat /boot/dietpi/.version 8.13
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN bullseye
  • Kernel version | uname -aLinux DietPi 5.15.84-v7l+ #1613
  • SBC model | echo $G_HW_MODEL_NAME RPi 4 Model B (armv7l)
  • Power supply used | Original
  • SD card used | SanDisk ultra

Additional Information (if applicable)

  • Software title | (Matrix-synapse
  • Was the software title installed freshly or updated/migrated? fresh
  • Can this issue be replicated on a fresh installation of DietPi? don’t have another rpi to try, this one is prod
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. After installing from dietpi-software, errors appearing and can’t install synapse

Actual behaviour

writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
      /tmp/pip-build-env-jghhjt58/overlay/lib/python3.9/site-packages/setuptools                                                                                                             /command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'cryptogr                                                                                                             aphy.hazmat.bindings._rust' as data is deprecated, please list it in `packages`.
          !!


          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'cryptography.hazmat.bindings._rust' as an importabl                                                                                                             e package,
          but it is not listed in the `packages` configuration of setuptools.

          'cryptography.hazmat.bindings._rust' has been automatically added to t                                                                                                             he distribution only
          because it may contain data files, but this behavior is likely to chan                                                                                                             ge
          in future versions of setuptools (and therefore is considered deprecat                                                                                                             ed).

          Please make sure that 'cryptography.hazmat.bindings._rust' is included                                                                                                              as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" and "data files" on setupt                                                                                                             ools
          documentation page.


      !!

        check.warn(importable)
      copying src/cryptography/py.typed -> build/lib.linux-armv7l-cpython-39/cry                                                                                                             ptography
      copying src/cryptography/hazmat/bindings/_openssl.pyi -> build/lib.linux-a                                                                                                             rmv7l-cpython-39/cryptography/hazmat/bindings
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/bindings/_r                                                                                                             ust
      copying src/cryptography/hazmat/bindings/_rust/__init__.pyi -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/asn1.pyi -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/ocsp.pyi -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/pkcs7.pyi -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/x509.pyi -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      running build_ext
      running build_rust

          =============================DEBUG ASSISTANCE=========================                                                                                                             ====
          If you are seeing a compilation error please try the following steps t                                                                                                             o
          successfully install cryptography:
          1) Upgrade to the latest pip and try again. This will fix errors for m                                                                                                             ost
             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
          2) Read https://cryptography.io/en/latest/installation/ for specific
             instructions for your platform.
          3) Check our frequently asked questions for more information:
             https://cryptography.io/en/latest/faq/
          4) Ensure you have a recent Rust toolchain installed:
             https://cryptography.io/en/latest/installation/#rust

          Python: 3.9.2
          platform: Linux-5.15.84-v7l+-armv7l-with-glibc2.31
          pip: n/a
          setuptools: 67.1.0
          setuptools_rust: 1.5.2
          rustc: n/a
          =============================DEBUG ASSISTANCE=========================                                                                                                             ====

      error: can't find Rust compiler

      If you are using an outdated pip version, it is possible a prebuilt wheel                                                                                                              is available for this package but pip is not able to install from it. Installing                                                                                                              from the wheel would avoid the need for a Rust compiler.

      To update pip, run:

          pip install --upgrade pip

      and then retry package installation.

      If you did intend to build this package from source, try installing a Rust                                                                                                              compiler from your system package manager and ensure it is on the PATH during i                                                                                                             nstallation. Alternatively, rustup (available at https://rustup.rs) is the recom                                                                                                             mended way to download and update the Rust compiler toolchain.

      This package requires Rust >=1.48.0.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem wit                                                                                                             h pip.
  ERROR: Failed building wheel for cryptography
Failed to build matrix-synapse bcrypt cryptography
ERROR: Could not build wheels for matrix-synapse, bcrypt, cryptography, which is                                                                                                              required to install pyproject.toml-based projects

---------------------------------------------------------------------
[FAILED] DietPi-Software | Unable to continue, DietPi-Software will now terminate

Tried to update pip:

pip install --upgrade pip
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Requirement already satisfied: pip in /usr/local/lib/python3.9/dist-packages (23.0)
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

also installed rust without errors:

curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path

Can somebody help?
Thank you.

I don’t understand this part.
You installed something via dietpi-software and then you can’t install synapse (also via dietpi-software)?

But there was an similiar issue some days ago, with HA, python, rust and the cryptography stuff, maybe this thread can help you:

Hi Jappe, thanks for your reply.
I’m trying to install the matrix-synapse only through dietpi-software
I’ve tried the mentioned steps and this is what I am receiving, I really don’t know, what I am doing wrong.

root@DietPi:~# curl -sSfL 'https://sh.rustup.rs' -o rustup-init.sh
root@DietPi:~# chmod +x rustup-init.sh
root@DietPi:~# ./rustup-init.sh -y --profile minimal
info: downloading installer
info: profile set to 'minimal'
info: default host triple is armv7-unknown-linux-gnueabihf
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
info: default toolchain set to 'stable-armv7-unknown-linux-gnueabihf'

  stable-armv7-unknown-linux-gnueabihf unchanged - rustc 1.67.0 (fc594f156 2023-                                                                                                             01-24)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, run:
source "$HOME/.cargo/env"
root@DietPi:~# rm rustup-init.sh
root@DietPi:~# source "$HOME/.cargo/env"
root@DietPi:~# pip3 install cryptography
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Collecting cryptography
  Using cached cryptography-39.0.0.tar.gz (603 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cffi>=1.12
  Using cached https://www.piwheels.org/simple/cffi/cffi-1.15.1-cp39-cp39-linux_                                                                                                             armv7l.whl (364 kB)
Collecting pycparser
  Using cached https://www.piwheels.org/simple/pycparser/pycparser-2.21-py2.py3-                                                                                                             none-any.whl (119 kB)
Building wheels for collected packages: cryptography
  Building wheel for cryptography (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for cryptography (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [248 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-cpython-39
      creating build/lib.linux-armv7l-cpython-39/cryptography
      copying src/cryptography/utils.py -> build/lib.linux-armv7l-cpython-39/cry                                                                                                             ptography
      copying src/cryptography/fernet.py -> build/lib.linux-armv7l-cpython-39/cr                                                                                                             yptography
      copying src/cryptography/exceptions.py -> build/lib.linux-armv7l-cpython-3                                                                                                             9/cryptography
      copying src/cryptography/__init__.py -> build/lib.linux-armv7l-cpython-39/                                                                                                             cryptography
      copying src/cryptography/__about__.py -> build/lib.linux-armv7l-cpython-39                                                                                                             /cryptography
      creating build/lib.linux-armv7l-cpython-39/cryptography/x509
      copying src/cryptography/x509/oid.py -> build/lib.linux-armv7l-cpython-39/                                                                                                             cryptography/x509
      copying src/cryptography/x509/ocsp.py -> build/lib.linux-armv7l-cpython-39                                                                                                             /cryptography/x509
      copying src/cryptography/x509/name.py -> build/lib.linux-armv7l-cpython-39                                                                                                             /cryptography/x509
      copying src/cryptography/x509/general_name.py -> build/lib.linux-armv7l-cp                                                                                                             ython-39/cryptography/x509
      copying src/cryptography/x509/extensions.py -> build/lib.linux-armv7l-cpyt                                                                                                             hon-39/cryptography/x509
      copying src/cryptography/x509/certificate_transparency.py -> build/lib.lin                                                                                                             ux-armv7l-cpython-39/cryptography/x509
      copying src/cryptography/x509/base.py -> build/lib.linux-armv7l-cpython-39                                                                                                             /cryptography/x509
      copying src/cryptography/x509/__init__.py -> build/lib.linux-armv7l-cpytho                                                                                                             n-39/cryptography/x509
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat
      copying src/cryptography/hazmat/_oid.py -> build/lib.linux-armv7l-cpython-                                                                                                             39/cryptography/hazmat
      copying src/cryptography/hazmat/__init__.py -> build/lib.linux-armv7l-cpyt                                                                                                             hon-39/cryptography/hazmat
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-                                                                                                             armv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-a                                                                                                             rmv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-a                                                                                                             rmv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-armv                                                                                                             7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-ar                                                                                                             mv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-armv                                                                                                             7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/_serialization.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/_cipheralgorithm.py -> build/li                                                                                                             b.linux-armv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/_asymmetric.py -> build/lib.lin                                                                                                             ux-armv7l-cpython-39/cryptography/hazmat/primitives
      copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-                                                                                                             armv7l-cpython-39/cryptography/hazmat/primitives
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/bindings
      copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-ar                                                                                                             mv7l-cpython-39/cryptography/hazmat/bindings
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/backends
      copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-ar                                                                                                             mv7l-cpython-39/cryptography/hazmat/backends
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/                                                                                                             twofactor
      copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/primitives/twofactor
      copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/primitives/twofactor
      copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/                                                                                                             lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/twofactor
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/                                                                                                             serialization
      copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/l                                                                                                             ib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/serialization
      copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build                                                                                                             /lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/serialization
      copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> buil                                                                                                             d/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/serialization
      copying src/cryptography/hazmat/primitives/serialization/base.py -> build/                                                                                                             lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/serialization
      copying src/cryptography/hazmat/primitives/serialization/__init__.py -> bu                                                                                                             ild/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/serialization
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/                                                                                                             kdf
      copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.lin                                                                                                             ux-armv7l-cpython-39/cryptography/hazmat/primitives/kdf
      copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/primitives/kdf
      copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/primitives/kdf
      copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/primitives/kdf
      copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-                                                                                                             armv7l-cpython-39/cryptography/hazmat/primitives/kdf
      copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/primitives/kdf
      copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.li                                                                                                             nux-armv7l-cpython-39/cryptography/hazmat/primitives/kdf
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/                                                                                                             ciphers
      copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/primitives/ciphers
      copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.li                                                                                                             nux-armv7l-cpython-39/cryptography/hazmat/primitives/ciphers
      copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/                                                                                                             lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/ciphers
      copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.li                                                                                                             nux-armv7l-cpython-39/cryptography/hazmat/primitives/ciphers
      copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/li                                                                                                             b.linux-armv7l-cpython-39/cryptography/hazmat/primitives/ciphers
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/                                                                                                             asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib                                                                                                             .linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/l                                                                                                             ib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/li                                                                                                             b.linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/types.py -> build/li                                                                                                             b.linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/                                                                                                             lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/li                                                                                                             b.linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/                                                                                                             lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build                                                                                                             /lib.linux-armv7l-cpython-39/cryptography/hazmat/primitives/asymmetric
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/bindings/op                                                                                                             enssl
      copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/bindings/openssl
      copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/                                                                                                             lib.linux-armv7l-cpython-39/cryptography/hazmat/bindings/openssl
      copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/bindings/openssl
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/backends/op                                                                                                             enssl
      copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.li                                                                                                             nux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.lin                                                                                                             ux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.li                                                                                                             nux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.lin                                                                                                             ux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-                                                                                                             armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-                                                                                                             armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/l                                                                                                             ib.linux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.                                                                                                             linux-armv7l-cpython-39/cryptography/hazmat/backends/openssl
      running egg_info
      writing src/cryptography.egg-info/PKG-INFO
      writing dependency_links to src/cryptography.egg-info/dependency_links.txt
      writing requirements to src/cryptography.egg-info/requires.txt
      writing top-level names to src/cryptography.egg-info/top_level.txt
      reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'docs/_build'
      warning: no previously-included files found matching 'vectors'
      warning: no previously-included files matching '*' found under directory '                                                                                                             vectors'
      warning: no previously-included files matching '*' found under directory '                                                                                                             .github'
      warning: no previously-included files found matching 'release.py'
      warning: no previously-included files found matching '.readthedocs.yml'
      warning: no previously-included files found matching 'dev-requirements.txt                                                                                                             '
      warning: no previously-included files found matching 'tox.ini'
      warning: no previously-included files found matching 'mypy.ini'
      warning: no previously-included files matching '*' found under directory '                                                                                                             .circleci'
      adding license file 'LICENSE'
      adding license file 'LICENSE.APACHE'
      adding license file 'LICENSE.BSD'
      adding license file 'LICENSE.PSF'
      writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
      /tmp/pip-build-env-w4581y3c/overlay/lib/python3.9/site-packages/setuptools                                                                                                             /command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'cryptogr                                                                                                             aphy.hazmat.bindings._rust' as data is deprecated, please list it in `packages`.
          !!


          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'cryptography.hazmat.bindings._rust' as an importabl                                                                                                             e package,
          but it is not listed in the `packages` configuration of setuptools.

          'cryptography.hazmat.bindings._rust' has been automatically added to t                                                                                                             he distribution only
          because it may contain data files, but this behavior is likely to chan                                                                                                             ge
          in future versions of setuptools (and therefore is considered deprecat                                                                                                             ed).

          Please make sure that 'cryptography.hazmat.bindings._rust' is included                                                                                                              as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" and "data files" on setupt                                                                                                             ools
          documentation page.


      !!

        check.warn(importable)
      copying src/cryptography/py.typed -> build/lib.linux-armv7l-cpython-39/cry                                                                                                             ptography
      copying src/cryptography/hazmat/bindings/_openssl.pyi -> build/lib.linux-a                                                                                                             rmv7l-cpython-39/cryptography/hazmat/bindings
      creating build/lib.linux-armv7l-cpython-39/cryptography/hazmat/bindings/_r                                                                                                             ust
      copying src/cryptography/hazmat/bindings/_rust/__init__.pyi -> build/lib.l                                                                                                             inux-armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/asn1.pyi -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/ocsp.pyi -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/pkcs7.pyi -> build/lib.linu                                                                                                             x-armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      copying src/cryptography/hazmat/bindings/_rust/x509.pyi -> build/lib.linux                                                                                                             -armv7l-cpython-39/cryptography/hazmat/bindings/_rust
      running build_ext
      running build_rust
      cargo rustc --lib --message-format=json-render-diagnostics --manifest-path                                                                                                              src/rust/Cargo.toml --release -v --features pyo3/abi3-py36 pyo3/extension-modul                                                                                                             e -- --crate-type cdylib
          Updating crates.io index
       Downloading crates ...
        Downloaded asn1_derive v0.13.0
        Downloaded ouroboros_macro v0.15.5
        Downloaded proc-macro2 v1.0.49
        Downloaded pyo3-build-config v0.15.2
        Downloaded proc-macro-hack v0.5.20+deprecated
        Downloaded indoc-impl v0.3.6
        Downloaded aliasable v0.1.3
        Downloaded Inflector v0.11.4
        Downloaded pyo3-macros-backend v0.15.2
        Downloaded once_cell v1.14.0
        Downloaded unindent v0.1.11
        Downloaded proc-macro-error v1.0.4
        Downloaded parking_lot_core v0.8.6
        Downloaded unicode-ident v1.0.6
        Downloaded paste v0.1.18
        Downloaded autocfg v1.1.0
        Downloaded smallvec v1.10.0
        Downloaded num-integer v0.1.45
        Downloaded lock_api v0.4.9
        Downloaded iana-time-zone v0.1.53
        Downloaded num-traits v0.2.15
        Downloaded base64 v0.13.1
        Downloaded chrono v0.4.23
        Downloaded version_check v0.9.4
        Downloaded quote v1.0.23
        Downloaded syn v1.0.107
        Downloaded scopeguard v1.1.0
        Downloaded pyo3 v0.15.2
        Downloaded libc v0.2.139
        Downloaded proc-macro-error-attr v1.0.4
        Downloaded parking_lot v0.11.2
        Downloaded instant v0.1.12
        Downloaded cfg-if v1.0.0
        Downloaded pyo3-macros v0.15.2
        Downloaded pem v1.1.0
        Downloaded paste-impl v0.1.18
        Downloaded asn1 v0.13.0
        Downloaded ouroboros v0.15.5
        Downloaded indoc v0.3.6
         Compiling proc-macro2 v1.0.49
         Compiling unicode-ident v1.0.6
         Compiling quote v1.0.23
         Compiling autocfg v1.1.0
           Running `rustc --crate-name build_script_build --edition=2018 /root/.                                                                                                             cargo/registry/src/github.com-1285ae84e5963aae/proc-macro2-1.0.49/build.rs --err                                                                                                             or-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate                                                                                                             -type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off -C ov                                                                                                             erflow-checks=on --cfg 'feature="default"' --cfg 'feature="proc-macro"' --cfg 'f                                                                                                             eature="span-locations"' -C metadata=ee116ae294158a49 -C extra-filename=-ee116ae                                                                                                             294158a49 --out-dir /tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa004d508196e                                                                                                             536231c6211/src/rust/target/release/build/proc-macro2-ee116ae294158a49 -L depend                                                                                                             ency=/tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa004d508196e536231c6211/src                                                                                                             /rust/target/release/deps --cap-lints allow`
           Running `rustc --crate-name unicode_ident --edition=2018 /root/.cargo                                                                                                             /registry/src/github.com-1285ae84e5963aae/unicode-ident-1.0.6/src/lib.rs --error                                                                                                             -format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-t                                                                                                             ype lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=of                                                                                                             f -C overflow-checks=on -C metadata=5674c03ab2362159 -C extra-filename=-5674c03a                                                                                                             b2362159 --out-dir /tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa004d508196e5                                                                                                             36231c6211/src/rust/target/release/deps -L dependency=/tmp/pip-install-6fg691fl/                                                                                                             cryptography_7bbb5faaaa004d508196e536231c6211/src/rust/target/release/deps --cap                                                                                                             -lints allow`
           Running `rustc --crate-name build_script_build --edition=2018 /root/.                                                                                                             cargo/registry/src/github.com-1285ae84e5963aae/quote-1.0.23/build.rs --error-for                                                                                                             mat=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type                                                                                                              bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off -C overflow                                                                                                             -checks=on --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=8e                                                                                                             2b0768a5388e6f -C extra-filename=-8e2b0768a5388e6f --out-dir /tmp/pip-install-6f                                                                                                             g691fl/cryptography_7bbb5faaaa004d508196e536231c6211/src/rust/target/release/bui                                                                                                             ld/quote-8e2b0768a5388e6f -L dependency=/tmp/pip-install-6fg691fl/cryptography_7                                                                                                             bbb5faaaa004d508196e536231c6211/src/rust/target/release/deps --cap-lints allow`
           Running `rustc --crate-name autocfg /root/.cargo/registry/src/github.                                                                                                             com-1285ae84e5963aae/autocfg-1.1.0/src/lib.rs --error-format=json --json=diagnos                                                                                                             tic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,met                                                                                                             adata,link -C embed-bitcode=no -C debug-assertions=off -C overflow-checks=on -C                                                                                                              metadata=541c5c4f57f32571 -C extra-filename=-541c5c4f57f32571 --out-dir /tmp/pip                                                                                                             -install-6fg691fl/cryptography_7bbb5faaaa004d508196e536231c6211/src/rust/target/                                                                                                             release/deps -L dependency=/tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa004d                                                                                                             508196e536231c6211/src/rust/target/release/deps --cap-lints allow`
         Compiling syn v1.0.107
           Running `rustc --crate-name build_script_build --edition=2018 /root/.                                                                                                             cargo/registry/src/github.com-1285ae84e5963aae/syn-1.0.107/build.rs --error-form                                                                                                             at=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type b                                                                                                             in --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off -C overflow-                                                                                                             checks=on --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature                                                                                                             ="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature=                                                                                                             "parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'featur                                                                                                             e="quote"' --cfg 'feature="visit"' -C metadata=26326bb815a0bd19 -C extra-filenam                                                                                                             e=-26326bb815a0bd19 --out-dir /tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa0                                                                                                             04d508196e536231c6211/src/rust/target/release/build/syn-26326bb815a0bd19 -L depe                                                                                                             ndency=/tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa004d508196e536231c6211/s                                                                                                             rc/rust/target/release/deps --cap-lints allow`
      error: linker `cc` not found
        |
        = note: No such file or directory (os error 2)

      error: could not compile `quote` due to previous error

      Caused by:
        process didn't exit successfully: `rustc --crate-name build_script_build                                                                                                              --edition=2018 /root/.cargo/registry/src/github.com-1285ae84e5963aae/quote-1.0.                                                                                                             23/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future                                                                                                             -incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-ass                                                                                                             ertions=off -C overflow-checks=on --cfg 'feature="default"' --cfg 'feature="proc                                                                                                             -macro"' -C metadata=8e2b0768a5388e6f -C extra-filename=-8e2b0768a5388e6f --out-                                                                                                             dir /tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa004d508196e536231c6211/src/                                                                                                             rust/target/release/build/quote-8e2b0768a5388e6f -L dependency=/tmp/pip-install-                                                                                                             6fg691fl/cryptography_7bbb5faaaa004d508196e536231c6211/src/rust/target/release/d                                                                                                             eps --cap-lints allow` (exit status: 1)
      warning: build failed, waiting for other jobs to finish...
      error: could not compile `proc-macro2` due to previous error

      Caused by:
        process didn't exit successfully: `rustc --crate-name build_script_build                                                                                                              --edition=2018 /root/.cargo/registry/src/github.com-1285ae84e5963aae/proc-macro                                                                                                             2-1.0.49/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,                                                                                                             future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C deb                                                                                                             ug-assertions=off -C overflow-checks=on --cfg 'feature="default"' --cfg 'feature                                                                                                             ="proc-macro"' --cfg 'feature="span-locations"' -C metadata=ee116ae294158a49 -C                                                                                                              extra-filename=-ee116ae294158a49 --out-dir /tmp/pip-install-6fg691fl/cryptograph                                                                                                             y_7bbb5faaaa004d508196e536231c6211/src/rust/target/release/build/proc-macro2-ee1                                                                                                             16ae294158a49 -L dependency=/tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa004                                                                                                             d508196e536231c6211/src/rust/target/release/deps --cap-lints allow` (exit status   
: 1)
      error: could not compile `syn` due to previous error

      Caused by:
        process didn't exit successfully: `rustc --crate-name build_script_build                                                                                                              --edition=2018 /root/.cargo/registry/src/github.com-1285ae84e5963aae/syn-1.0.10                                                                                                             7/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-                                                                                                             incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-asse                                                                                                             rtions=off -C overflow-checks=on --cfg 'feature="clone-impls"' --cfg 'feature="d                                                                                                             efault"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature=                                                                                                             "full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="pro                                                                                                             c-macro"' --cfg 'feature="quote"' --cfg 'feature="visit"' -C metadata=26326bb815                                                                                                             a0bd19 -C extra-filename=-26326bb815a0bd19 --out-dir /tmp/pip-install-6fg691fl/c                                                                                                             ryptography_7bbb5faaaa004d508196e536231c6211/src/rust/target/release/build/syn-2                                                                                                             6326bb815a0bd19 -L dependency=/tmp/pip-install-6fg691fl/cryptography_7bbb5faaaa0                                                                                                             04d508196e536231c6211/src/rust/target/release/deps --cap-lints allow` (exit stat                                                                                                             us: 1)

          =============================DEBUG ASSISTANCE=========================                                                                                                             ====
          If you are seeing a compilation error please try the following steps t                                                                                                             o
          successfully install cryptography:
          1) Upgrade to the latest pip and try again. This will fix errors for m                                                                                                             ost
             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
          2) Read https://cryptography.io/en/latest/installation/ for specific
             instructions for your platform.
          3) Check our frequently asked questions for more information:
             https://cryptography.io/en/latest/faq/
          4) Ensure you have a recent Rust toolchain installed:
             https://cryptography.io/en/latest/installation/#rust

          Python: 3.9.2
          platform: Linux-5.15.84-v7l+-armv7l-with-glibc2.31
          pip: n/a
          setuptools: 67.1.0
          setuptools_rust: 1.5.2
          rustc: 1.67.0 (fc594f156 2023-01-24)
          =============================DEBUG ASSISTANCE=========================                                                                                                             ====

      error: `cargo rustc --lib --message-format=json-render-diagnostics --manif                                                                                                             est-path src/rust/Cargo.toml --release -v --features 'pyo3/abi3-py36 pyo3/extens                                                                                                             ion-module' -- --crate-type cdylib` failed with code 101
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem wit                                                                                                             h pip.
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyp                                                                                                             roject.toml-based projects

Nothing.

Matrix is a Python application that needs to be compiled first. To save time and resource, we use piwheels.org as data source on 32bit systems. This should provide pre-compiled wheels for matrix-synapse as well. However, last builds are failing piwheels - matrix-synapse. It’s the same issue you have, the missing Rust compiler.

I will need to have a look what is needed to get this working.

as workaround you can try following (assuming Rust has been installed already)

apt install libssl-dev
dietpi-software install 16 125

Hello Joulinar,

Unfortunately it is not working… I’ve spent already too much hours with it and I think I will go with docker solution. The rust compiler is a complete mess.

Thanks 4 your support, appreciate

without error message we are not able to assist. If you are still interest, I could push a temp workaround to GitHub you could use.

Hi Joulinar,

The error was same as last time.
I can try the temporary solution.
Thank you

You can try following. This will bring you to a special development branch.

G_DEV_BRANCH matrix
dietpi-software install 125

It will take some time to compile all modules if all goes well.

Thank you very much, it works now!

ok one last point. You can stay on this DietPi dev version for now as we will release a new public version soon. But let’s set back branch to master. This way you will get all necessary DietPi code update.

G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=master' /boot/dietpi.txt

Adjusted. Thanks again!

Hi Joulinar,

One more question.
I’m not quite sure, how to get the matrix-synapse server behind reverse-proxy. (http://mydomain:8008)
Fot another web-servers, I am using apache2, where it is working through .configs, but this seems a little strange to me and cannot find the way, how.

I can’t find any tips here on the forum.
Thanks for your support.

can’t believe this :smiley:

  1. Nginx Synapse (Matrix) via dynDNS - #6 by Joulinar
  2. Generall Matrix Synapse homeserver - #11 by Joulinar
  3. Matrix org. docs synapse/docs/reverse_proxy.md at d0fed7a37b8b6ce166cae856fe243757aa7c7294 · matrix-org/synapse · GitHub

Ok, sorry for that, I was searching for this and only 3 forums appeared :smiley:
image

root@DietPi:/etc/ssl# a2ensite [mydomain].conf 
Enabling site [mydomain].
To activate the new configuration, you need to run:
  systemctl reload apache2
root@DietPi:/etc/ssl# systemctl reload apache2
root@DietPi:/etc/ssl#
Broadcast message from systemd-journald@DietPi (Tue 2023-02-07 12:43:51 CET):

apache2[25205]: [ssl:emerg] [pid 25205:tid 3069575616] AH02572: Failed to configure at least one certificate and key for [mydomain]:443


Broadcast message from systemd-journald@DietPi (Tue 2023-02-07 12:43:51 CET):

apache2[25205]: [ssl:emerg] [pid 25205:tid 3069575616] SSL Library Error: error:0909006C:PEM routines:get_name:no start line (Expecti                            ng: DH PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?


Broadcast message from systemd-journald@DietPi (Tue 2023-02-07 12:43:51 CET):

apache2[25205]: [ssl:emerg] [pid 25205:tid 3069575616] SSL Library Error: error:0909006C:PEM routines:get_name:no start line (Expecti                            ng: EC PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?


Broadcast message from systemd-journald@DietPi (Tue 2023-02-07 12:43:51 CET):

apache2[25205]: [ssl:emerg] [pid 25205:tid 3069575616] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no ce                            rtificate assigned

I’m using this apache2 configuration:

<VirtualHost *:443>
    SSLEngine on
    ServerName [mydomain]

    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
    AllowEncodedSlashes NoDecode
    ProxyPreserveHost on
    ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
    ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
    ProxyPass /_synapse/client http://127.0.0.1:8008/_synapse/client nocanon
    ProxyPassReverse /_synapse/client http://127.0.0.1:8008/_synapse/client
</VirtualHost>

<VirtualHost *:8448>
    SSLEngine on
    ServerName [mydomain]

    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
    AllowEncodedSlashes NoDecode
    ProxyPass /_matrix http://127.0.0.1:8008/_matrix/static nocanon
    ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
</VirtualHost>

[mydomain] is set to my own domain.com ofc :slight_smile:

You need to include SSL certificate information. Did you already created SSL certificates using dietpi-letsencrypt? If yes, you should find the configuration within /etc/apache2/sites-available/000-default-le-ssl.conf

I tried, but this is what happens:

 DietPi-LetsEncrypt
─────────────────────────────────────────────────────
 Mode: Running Certbot

[  OK  ] DietPi-LetsEncrypt | Apache webserver detected
[  OK  ] DietPi-LetsEncrypt | Desired setting in /etc/apache2/sites-available/000-default.conf was already set:         ServerName chat.[mydomain].com
[  OK  ] DietPi-LetsEncrypt | systemctl restart apache2
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Requesting a certificate for chat.[mydomain].com
Performing the following challenges:
http-01 challenge for chat.[mydomain].com
Cleaning up challenges
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.
[FAILED] DietPi-LetsEncrypt | Certbot failed, please check its above terminal output. Aborting...

When I am firstly trying to enable the config this is what I get:

DietPi-LetsEncrypt
─────────────────────────────────────────────────────
 Mode: Running Certbot

[  OK  ] DietPi-LetsEncrypt | Apache webserver detected
[  OK  ] DietPi-LetsEncrypt | Setting in /etc/apache2/sites-available/000-default.conf adjusted:        ServerName chat.[mydomain].com
[FAILED] DietPi-LetsEncrypt | systemctl restart apache2
[FAILED] DietPi-LetsEncrypt | systemctl restart apache2
[FAILED] DietPi-LetsEncrypt | systemctl restart apache2

I am clueless what is wrong, I am using .conf file mentioned above - but apache is failing.

Feb 07 15:43:30 DietPi apache2[7930]: [ssl:emerg] [pid 7930:tid 3069751744] AH02572: Failed to configure at least one certificate and key for chat.[mydomain].com:              443
Feb 07 15:43:30 DietPi apache2[7930]: [ssl:emerg] [pid 7930:tid 3069751744] SSL Library Error: error:0909006C:PEM routines:get_name:no start line (Expecting: DH               PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?
Feb 07 15:43:30 DietPi apache2[7930]: [ssl:emerg] [pid 7930:tid 3069751744] SSL Library Error: error:0909006C:PEM routines:get_name:no start line (Expecting: EC               PARAMETERS) -- Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?
Feb 07 15:43:30 DietPi apache2[7930]: [ssl:emerg] [pid 7930:tid 3069751744] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certifica              te assigned
Feb 07 15:43:30 DietPi apachectl[7927]: Action 'start' failed.
Feb 07 15:43:30 DietPi apachectl[7927]: The Apache error log may have more information.
Feb 07 15:43:30 DietPi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

I am able to reach the website through http://chat.[mydomain].com:8008

Your problem, Apache needs to be up and running to be able to create SSL certificate. But Apache is not starting because of missing SSL certificate. :roll_eyes:

pls remove/disable your configuration file your create, restart Apache and create SSL certificate afterwards.

a2dissite chat.[mydomain].com.conf - .conf disabled, but the error message is same
I renamed .confs for my other websites and still same error

apache2[15312]: [ssl:emerg] [pid 15312:tid 3069256128] AH02572: Failed to configure at least one certificate and key for chat.[mydomain].com:443


Broadcast message from systemd-journald@DietPi (Tue 2023-02-07 18:01:19 CET):

apache2[15312]: [ssl:emerg] [pid 15312:tid 3069256128] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned