The upgade of synapse 1.98.0~ynh1 to 104.0~ynh1 removed the app

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.2.11.2
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 ? : I did tweak a setting in synapse a long time ago, described here: The synapse user password is no longer the yunohost user password - #4 by pyrignis

app name and version: synapse 1.104.0~ynh1

Description of my issue

The upgrade of synapse 1.98.0~ynh1 to 104.0~ynh1 removed the synapse app from my server.

The folder /home/yunohost.app/matrix-synapse is now gone which prevents the automatic backup from getting restored.

What I believe to be the relevant logs are here :

2024-04-14 12:58:42,858: DEBUG - + deluser matrix-synapse
2024-04-14 12:58:43,007: DEBUG - Suppression de l'utilisateur « matrix-synapse »...
2024-04-14 12:58:43,008: DEBUG - Attention ! Le groupe « matrix-synapse » ne contient plus aucun membre.
2024-04-14 12:58:43,024: WARNING - userdel: user matrix-synapse is currently used by process 1621
2024-04-14 12:58:43,026: WARNING - /usr/sbin/deluser : « /usr/sbin/userdel matrix-synapse » a retourné le code d'erreur 8. Abandon.

The full log has been pasted here: https://paste.yunohost.org/raw/asogiwutuq

I have a /home/yunohost.app/synapse folder with a owner with numerical value. I am not sure if this indeed the new /home/yunohost.app/matrix-synapse and if new permission need to be applied.

Hello,

Hardware: small server at home
YunoHost version: 11.2.11.2
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 as far as I know

I faced the same problem. During the upgrade of synapse 1.98.0~ynh1 to 104.0~ynh1 Synapse was removed. And the backup made during the upgrade was even not possible to install again.

Hopefully, I had an not too old synapse backup to restore…

I am not sure my problem is the same as Pyrignis’ one but I share my log at https://paste.yunohost.org/raw/oraqutaqos

Hello,

The errors from @pyrignis and @croulibri should be fixed by Testing by Josue-T · Pull Request #450 · YunoHost-Apps/synapse_ynh · GitHub

3 Likes

Thank you very much for the fix. If I understand correctly this will fix future upgrades in our case. As for the situation I find myself in, is there a relatively easy fix or should I give up on the last few day’s history and roll back to a previous snapshot?

Only 5 hours after @pyrignis shared his issue, @Josue has already pushed a fix…

So quick, this is really amazing and welcomed !

You will definitively win the Lucky Luke dev Award… “The man who push a fix quicker than the one who raise the issue” :laughing:

A huge thanks to you :hugs:

Ok, my /home partition is backed up separately from the rest of the system (I know I should handeled it but the auto snapshot option won’t let me schedule it :cry: ) and has been altered by the update so the rollback to a snapshot won’t cut it.
If anyone has an idea how to save my setup i’d love to hear from you, I’ve got all the snapshots from after the issue so I can try quite a few risky move.
Otherwise I guess I’ll have to put an end to 5 years of continuous history on my matrix server and start anew (With a proper backup setup).

Well,

The most simple solution is yes to rollback, but yes there are also some other solution. I don’t know exactly the current state of your install. If the backup before update was restored or the app is as it is just after the crashed update.

So maybe if you can give more details about the history of what happen on the failed upgrade and what is the current state, I could give you more advice.

Ok, I’ll switch to French since it seems we both speak it and my personnal case is less helpful for English readers. I’ll try and summarise the solution in English if we can find one.

:fr:
Mon setup est composé d’une partition systèmes, qui bénéficie de snapshots fréquents, et de deux partition séparées, qui ne sont pas snapshotées ensemble, les partions /var et /home. J’ai fais un retour au snapshot système précédant la mise à jour problématique (snapshot du 2024-04-12) mais les sauvegardes des autres disques remontent à février et sont donc restées dans leur état post-mise-a-jour.

L’interface de mise à jour me propose actuellement de faire une mise à jour de synapse Synapse de 1.98.0~ynh1 à 1.104.0~ynh1. Seulement cette mise à jour ne peux pas fonctionner car mon /home/yunohost.app/matrix-synapse semble avoir été migré vers /home/yunohost.app/synapse.

L’interface Outils/Service indique quant à elle les services suivant comme HS:

Voici Ă©galement les journaux de la tentative de restoration de la sauvegarde.

Le reste du système est fonctionnel mais j’ai préféré ne pas faire les mises à jour php pour le moment. Je peux également accéder à mon serveur en ssh.

En espérant que ces informations permettent de trouver une piste et sinon pas de problème pour donner des informations complémentaires.

Normalement lors de la mise a jours si le dossier à déjà été renommé il devrait le détecter et ca devrais just marcher. Mais après ca dépends tellement des cas de figure que bon c’est difficile à dire…

Ce que je recommanderais c’est de faire un snapshot avant, puis faire la mise à jours avec l’option -b (qui déactive le backup et surtout évite le mechanise de suppression et restauration si la mise à jours échoue) puis si ca échoue traiter le problème puis retenter la mise à jours jusqu’à que ca passe.

I understood the patch for our problem was already merged to Master so I tried the upgrade unsuccessfuly.
The log is at https://paste.yunohost.org/raw/eqezeqahic

I have the feeling the problem is now at:

2024-04-19 22:53:01,769: WARNING - mv: impossible de déplacer '/home/yunohost.app/matrix-synapse/media' vers '/home/yunohost.app/synapse/media': Le dossier n'est pas vide
2024-04-19 22:53:01,771: DEBUG - + ynh_exit_properly
2024-04-19 22:53:01,772: DEBUG - + [[ upgrade =~ ^install$|^upgrade$|^restore$ ]]
2024-04-19 22:53:03,277: ERROR - Could not upgrade synapse: An error occurred inside the app upgrade script

What should I do to be able to upgrade my 7 years old synapse install?

Thanks in advance for your advices :hugs:

Bon, je crois que je vais devenir fou, cette fois c’est la version de YunoHost qui pose problème:

user@server~$ sudo yunohost tools upgrade system
Info: Nothing to do. Everything is already up-to-date.
Info: Upgrading packages...
Info: Upgrading system packages
Info: + Reading package lists...
Info: + Building dependency tree...
Info: + Reading state information...
Info: + Calculating upgrade...
Info: + 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Success! System upgraded
user@server:~$ sudo yunohost --version
yunohost: 
  repo: stable
  version: 11.2.10.3
yunohost-admin: 
  repo: stable
  version: 11.2.4.1
moulinette: 
  repo: stable
  version: 11.2
ssowat: 
  repo: stable
  version: 11.2
user@server:~$ sudo yunohost app upgrade synapse
Info: Now upgrading synapse...
Warning: Failed to get label for app synapse ?
Error: This app requires YunoHost >= 11.2.11 but current installed version is 11.2.10.3
user@server:~$sudo apt-cache policy yunohost
yunohost:
  Installed: 11.2.11.2
  Candidate: 11.2.11.2
  Version table:
 *** 11.2.11.2 500
        500 http://forge.yunohost.org/debian bullseye/stable amd64 Packages
        100 /var/lib/dpkg/status

Bon, il faut que je trouve une solution pour que yunohost re-charge la version à laquelle il est installé

The synapse server is back up.

What I did is:

  • rename the /home/yunohost.app/synapse directory to /home/yunohost.app/matrix-synapse
  • change owner of the new /home/yunohost.app/matrix-synapse directory to the owner matrix-synapse
  • remove the synapse app
  • restore the synapse app from the backup

I still have issues with upgrading synapse to a new version but I guess I cans wait for a yunohost minor upgrade to get my yunohost version number bumped up.

The question is why do you have folder matrix-synapse and synapse which one have the data. The upgrade script expect to have only one. Ether you have the legacy folder matrix-synapse and it will be moved to synapse or the data was already migrated and in this case you shouldn’t have a folder matrix-synapse

Well, I think you probably have an issue about your Yunohost update as synapse just require the last Yunohost version available on stable so you should be able to update.

I think I do have the latest stable version as that’s what apt-cache policy yunohost says but yunohost --version gives an incorrect answer and I don’t really know where it looks.

And if you just try apt update && apt full-upgrade what is your result ?

[...]
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

All looks fine, just a value that wasn’t update with the rollback process

so maybe in this case just try apt install --reinstall yunohost

1 Like

Thank you for pointing the fact that 2 directory seems to be currently used by Synapse.
How can I ensure only one is used, and only one contains all data from my server?
I have not made any modification to my synapse install. I had to reinstall fully from backup 2 or 3 times, but I never touched any path of the official config.

You can see the two path seems in used if i look at

root@nos:/home/yunohost.app/synapse/media/url_cache# dir
2018-04-17  2019-03-29  2021-01-08  2021-10-06  2022-02-19  2022-07-09  2023-06-04  2023-12-06  2024-01-19
2018-04-19  2019-04-02  2021-01-09  2021-10-07  2022-03-05  2022-07-12  2023-07-06  2023-12-09  2024-01-23
2018-07-19  2019-04-16  2021-02-21  2021-10-09  2022-03-22  2022-07-24  2023-08-18  2023-12-10  2024-01-25
2018-07-29  2019-04-18  2021-02-22  2021-10-12  2022-04-06  2022-08-25  2023-08-28  2023-12-11  2024-01-26
2019-02-06  2019-04-22  2021-03-05  2021-11-27  2022-04-08  2022-10-19  2023-09-12  2023-12-12  2024-02-01
2019-02-15  2019-04-23  2021-06-25  2021-11-29  2022-05-03  2022-10-27  2023-09-13  2023-12-14  2024-02-06
2019-02-21  2019-05-17  2021-07-05  2021-11-30  2022-05-09  2023-01-17  2023-09-18  2023-12-15  2024-02-17
2019-02-23  2019-05-29  2021-08-16  2021-12-01  2022-05-10  2023-03-03  2023-09-20  2023-12-16  2024-02-28
2019-02-25  2019-06-02  2021-08-17  2021-12-03  2022-06-07  2023-03-13  2023-10-08  2023-12-17  2024-03-31
2019-03-04  2019-06-08  2021-08-23  2021-12-14  2022-06-11  2023-04-09  2023-11-11  2023-12-25  2024-04-10
2019-03-23  2020-02-17  2021-09-27  2022-01-19  2022-06-20  2023-05-27  2023-11-20  2024-01-14  2024-04-11

And

root@nos:/home/yunohost.app/matrix-synapse/media/url_cache# dir
2018-04-17  2019-04-02  2021-02-21  2021-10-12  2022-04-08  2022-10-27  2023-09-18  2023-12-16  2024-03-31
2018-04-19  2019-04-16  2021-02-22  2021-11-27  2022-05-03  2023-01-17  2023-09-20  2023-12-17  2024-04-18
2018-07-19  2019-04-18  2021-03-05  2021-11-29  2022-05-09  2023-03-03  2023-10-08  2023-12-25  2024-04-19
2018-07-29  2019-04-22  2021-06-25  2021-11-30  2022-05-10  2023-03-13  2023-11-11  2024-01-14  2024-04-20
2019-02-06  2019-04-23  2021-07-05  2021-12-01  2022-06-07  2023-04-09  2023-11-20  2024-01-19
2019-02-15  2019-05-17  2021-08-16  2021-12-03  2022-06-11  2023-05-27  2023-12-06  2024-01-23
2019-02-21  2019-05-29  2021-08-17  2021-12-14  2022-06-20  2023-06-04  2023-12-09  2024-01-25
2019-02-23  2019-06-02  2021-08-23  2022-01-19  2022-07-09  2023-07-06  2023-12-10  2024-01-26
2019-02-25  2019-06-08  2021-09-27  2022-02-19  2022-07-12  2023-08-18  2023-12-11  2024-02-01
2019-03-04  2020-02-17  2021-10-06  2022-03-05  2022-07-24  2023-08-28  2023-12-12  2024-02-06
2019-03-23  2021-01-08  2021-10-07  2022-03-22  2022-08-25  2023-09-12  2023-12-14  2024-02-17
2019-03-29  2021-01-09  2021-10-09  2022-04-06  2022-10-19  2023-09-13  2023-12-15  2024-02-28

This looks very strange :frowning:

and if you run du -sh /home/yunohost.app/*synapse ?