I ran into trouble while updating synapse 1.71.0~ynh1.
My YunoHost server
Hardware: VM bought online YunoHost version: 18.104.22.168 I have access to my server : Through SSH | through the webadmin Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
Description of my issue
I clicked to update my YNH and after a while I noticed synapse is not running.
It even is not listed in the installed apps any more:
$ sudo yunohost app list | grep -i syna
$ systemctl status matrix-synapse.service
Loaded: not-found (Reason: Unit matrix-synapse.service not found.)
Active: failed (Result: exit-code) since Mon 2023-01-02 10:19:15 CET; 6h ago
I found some tips about modifying the archive, but this does not seem to work for me:
$ sudo tar --delete --file synapse-pre-upgrade2.tar apps/synapse/backup/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/attrs-20.3.0.dist-info/
tar: apps/synapse/backup/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/attrs-20.3.0.dist-info: Not found in archive
tar: Exiting with failure status due to previous errors
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
So, I’m not familiar with those virtual environments and it didn’t change anything.
The solution was to adopt the path to the archive to the correct file:
$ sudo tar --delete --file /home/yunohost.backup/archives/synapse-pre-upgrade1.tar apps/synapse/backup/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/pyOpenSSL-22.0.0.dist-info/
$ sudo tar --delete --file /home/yunohost.backup/archives/synapse-pre-upgrade1.tar apps/synapse/backup/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/OpenSSL/
So I lost my crypto keys and my verification (and all the encrypted messages), but at least the contacts seems to be there.
no, I had no luck with that.
Obviously there is a “virtual environment” for each Yunohost-App.
Updating systems pip (and other programs) does not affect this virtual environment.
Since I got my Synapse back (and updating it after this worked, too), I lost interest in figuring out how to update this virtual environment.
I guess, YNH will update it, when everything is ready to do so.
Glad to hear that it helped for you, too.
When I understand you correctly, then you’re still looking for a way to update Synapse.
Just try to update it the usual YNH-way with the web-GUI. For me this worked after the procedure described above, even with the old environment.
$ cd /home/yunohost.backup/archives/
$ ls -l synapse-pre-upgrade* # This is to double check the name of the backup, adjust the file name accordingly later, and take the latest
$ cp synapse-pre-upgrade1.tar synapse-pre-upgrade1.tar.bak # Make a backup of the existing backup before modifying, just in case
$ sudo tar --delete --file synapse-pre-upgrade1.tar apps/synapse/backup/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/pyOpenSSL-22.0.0.dist-info/ apps/synapse/backup/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/OpenSSL/
$ yunohost backup restore synapse-pre-upgrade1 --apps synapse # start restoring the backup, it took around two hours for my big DB on a ssd
(slightlyt adjusted from the one quoted above: I merged the two tar commands in one, and tried to make the process clearer)
@chmeyer I think you should be able to update the synapse environment by doing:
sudo -u matrix-synapse /opt/yunohost/matrix-synapse/bin/python -m pip list
Or by activating the environment from the dedicated user’s home directory:
sudo -u matrix-synapse bash # be careful about multi-instance, also not completely sure it works when executing as that user
(of course, replace list by your upgrade commands)
my synapse runs now again, but I see now a few little errors on the element now. May be you can help me again to update the pip, pyopenssl, setuptools and setuptools-rust. I think when I done this it should be run without errors, right?
this list the packages ok but which are the next steps to update the pip and so on?