Matrix-synapse fails to update

Creating a bug report/issue

Required Information

  • DietPi version:

G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=9
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’

Kernel version:

Linux 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux

  • SBC model: RPi 4

Hi!

I’ve been running a synapse server for ~6 months now, and it’s been pretty much smooth sailing. But today when I tried to upgrade matrix-synapse from 1.67 to 1.68 with “pip3 install -U matrix-synapse” I ran into an error: “ModuleNotFoundError: No module named ‘setuptools’”
so setuptools has been uninstalled at some point I guess? I installed it again with pip, and now I get “error: can’t find Rust compiler” (when building wheel for matrix-synapse)

I tried reinstalling with “dietpi-software reinstall 125” but it results in the same error…

I don’t know how I would proceed. I tried installing Rust with rustup but that didn’t help. Between last update and this update I have only installed and uninstalled dietpi-dashboard and webmin (just trying them out) and installed (and kept) netdata. Otherwise I haven’t fiddled around (at least I think)

Any suggestions where I could look into?

uhhh that’s extremely bad that it requires rust to compile matrix-synapse now :frowning:

We would need to adjust our install procedure complete to include rust.

Yeah I found out from here that it indeed requires rust from now on, however they state that installing with pip should not be affected: Upgrading between Synapse Versions - Synapse

Seems not to be true anymore. Or at least not for the moment.

Can you try following

curl -sSfL 'https://sh.rustup.rs' -o rustup-init.sh
chmod +x rustup-init.sh
./rustup-init.sh -y --profile minimal
rm rustup-init.sh
. /root/.cargo/env
dietpi-software reinstall 125
rustup self uninstall -y

Unofrtunately it seems pip is still unable to find Rust compiler. So same error. :confused:

login as root user

curl -sSfL 'https://sh.rustup.rs' -o rustup-init.sh
chmod +x rustup-init.sh
./rustup-init.sh -y --profile minimal
rm rustup-init.sh
. /root/.cargo/env

does following return a version??

rustc -V

Yes it does: rustc 1.64.0 (a55dd71d5 2022-09-19)

ok let’s try following

# login as user root
curl -sSfL 'https://sh.rustup.rs' -o rustup-init.sh
chmod +x rustup-init.sh
./rustup-init.sh -y --profile minimal
rm rustup-init.sh
. /root/.cargo/env
pip3 install --no-cache-dir -U matrix-synapse psycopg2
dietpi-software reinstall 125
rustup self uninstall -y

The Rust binaries need to be loaded into PATH within the script. Indeed installing the module manually first should work as well.

I hope the install does not take ages and consumes tons of RAM now… Else we need to provide pre-compiled wheels ourselves or so :smile:.

I tested it using my GitHub PR on a R5S without issues. Installation was done in a couple of minutes. However, it would require at least 2GB ram due to the Rust installation done inside /tmp. Not the same drama as we had on Vaultwarden :roll_eyes:

Thank you, this worked!

So I should probably use this method for now I guess?

Usually there is no needed for as we think on a solution for next release.

In parallel we ask piwheels and matrix-org to provide precompiled python wheels. This would be best as we don’t need to implement rust.

1 Like

To add as info: I did not see any obscene RAM usage, and the install took maybe 7-10 minutes.

I’m running DietPi on RPi 4 2G model and I had about 1-0,5G available RAM for the whole install process.

The thing is, if we would install rust, we would store it on a tmpfs inside. Means the rust installation would be located in memory. Therefore, we need to ensure to have enough ram available. Especially on smaller SBC like RP2 or 3 :wink:

1 Like

Or we implement a persistent Rust install option to use. It’s anyway on the wish list somewhere. But with some luck the pre-compiled matrix-synapse wheels are implemented before our next release, at least replies are promising.

yeah we could do that, maybe for user root as this is the one we use to install our software title??