Problem during the synapse update

Hi everybody,

I saw the recent post about the update of the synapse app. So I try to update on the tesing branch according to post here official-app-synapse but the upgrade failed.
The app is no more available in the list of my app so I tried to reinstall it. But I get the following error message : https://paste.yunohost.org/raw/zovucuyeyi

I have a backup of my old synapse install. I precise it was an 0.33.9 version so before the migration of the app to python3. Maybe it’s why the update fail.

Thanks in advance :slight_smile:

Hello,

On which architecture are you ? And on what yunohost version are you (you can use this command to see that : yunohost -v) ?

Can you try this command (don’t accept the purpose, it’s just to see what is the problem with apt) :

apt install -s coturn build-essential python3-dev libffi-dev python3-pip python3-setuptools sqlite3 libssl-dev python3-venv libxml2-dev libxslt1-dev python3-lxml libjpeg-dev libpq-dev postgresql acl

Thanks for you reply.

After research, I found I had a problem with my sources.list resulting in the impossibility to install sqlite3. The problem is revolved now. Thanks to you :slight_smile:

The next step is to restore the pre-update backup for synapse. The problem is yunohost can only restore real backup and not backup generate with an update script. I think I have to do manually.

The problem is yunohost can only restore real backup and not backup generate with an update script. I think I have to do manually.

Normally you should be able to see the backup by yunohost backup list.

Got it. But I have some troubles :confused:

$ yunohost backup restore synapse-pre-upgrade2 --apps synapse
Warning: % Total % Received % Xferd Average Speed Time Time Time Current
Warning: Dload Upload Total Spent Left Speed
100 13 100 13 0 0 142 0 --:–:-- --:–:-- --:–:-- 142
Warning: % Total % Received % Xferd Average Speed Time Time Time Current
Warning: Dload Upload Total Spent Left Speed
100 19 100 19 0 0 205 0 --:–:-- --:–:-- --:–:-- 204
Warning: /tmp/restoreBLMkGI/restore: line 111: ynh_valide_ip6: command not found
Warning: could not change directory to “/home/yunohost.backup/tmp/synapse-pre-upgrade2/apps/synapse/backup”: Permission denied
Warning: could not change directory to “/home/yunohost.backup/tmp/synapse-pre-upgrade2/apps/synapse/backup”: Permission denied
Warning: could not change directory to “/home/yunohost.backup/tmp/synapse-pre-upgrade2/apps/synapse/backup”: Permission denied
Warning: Created symlink /etc/systemd/system/multi-user.target.wants/matrix-synapse.service → /etc/systemd/system/matrix-synapse.service.
Warning: chown: cannot access ‘/var/lib/matrix-synapse’: No such file or directory
Warning: !!
Warning: synapse’s script has encountered an error. Its execution was cancelled.
Warning: !!
Warning:
Error: Unable to restore the app ‘synapse’
Info: The operation ‘Restore ‘synapse’ from a backup archive’ has failed ! To get help, please share the full log of this operation using the command ‘yunohost log display 20190114-124842-backup_restore_app-synapse --share’
Warning: Removed /etc/systemd/system/multi-user.target.wants/matrix-synapse.service.
Warning: Port 8448 is already closed for IPv4 connections
Warning: Port 8448 is already closed for IPv6 connections
Warning: Some firewall rules commands have failed. For more information, see the log.
Warning: /var/lib/matrix-synapse wasn’t deleted because it doesn’t exist.
Warning: could not change directory to “/home/yunohost.backup/tmp/synapse-pre-upgrade2/apps/synapse/settings/scripts”: Permission denied
Warning: could not change directory to “/home/yunohost.backup/tmp/synapse-pre-upgrade2/apps/synapse/settings/scripts”: Permission denied
Warning: Remove the user matrix-synapse
Warning: Unknown service ‘matrix-synapse’
Warning: Unknown service ‘coturn-synapse’
Warning: synapse has not been properly removed
Info: The operation ‘Remove ‘synapse’ after a failed restore from a backup archive’ has failed ! To get help, please share the full log of this operation using the command ‘yunohost log display 20190114-124944-remove_on_failed_restore-synapse --share’
Error: Nothing has been restored

Obvisoulsy, I run the command as root.

Ok,

What is your Yunohost version ?

And can you run your restore script with the --debug option ?

I have the latest version of yunohost :

yunohost --version
yunohost: 
  repo: stable
  version: 3.3.3
yunohost-admin: 
  repo: stable
  version: 3.3.1
moulinette: 
  repo: stable
  version: 3.3.1
ssowat: 
  repo: stable
  version: 3.3.2

And this is the restore with --debug enable :
https://paste.yunohost.org/raw/gotuyonepa

Definitely sounds like it’s related to :

Strange that /var/lib/matrix-synapse was not restored.

Do you have the log of the backup ?

This is the log of the upgrade which failed :

$ yunohost log display /var/log/yunohost/categories/operation/20190112-191630-app_upgrade-synapse
description: Upgrade 'synapse' application
log_path: /var/log/yunohost/categories/operation/20190112-191630-app_upgrade-synapse.log
logs: 
  - 2019-01-12 19:17:32,770: WARNING - /var/lib/matrix-synapse will not be saved, because backup_core_only is set.
  - 2019-01-12 19:17:33,558: DEBUG - + set +eu
  - 2019-01-12 19:17:33,558: DEBUG - + echo -e '!!\n  synapse'\''s script has encountered an error. Its execution was cancelled.\n!!'
  - 2019-01-12 19:17:33,558: DEBUG - + type -t ynh_clean_setup
  - 2019-01-12 19:17:33,558: DEBUG - + ynh_clean_setup
  - 2019-01-12 19:17:33,558: DEBUG - + ynh_restore_upgradebackup
  - 2019-01-12 19:17:33,558: DEBUG - + echo 'Upgrade failed.'
  - 2019-01-12 19:17:33,559: DEBUG - + local app_bck=synapse
  - 2019-01-12 19:17:33,559: DEBUG - + NO_BACKUP_UPGRADE=0
  - 2019-01-12 19:17:33,559: DEBUG - + '[' 0 -eq 0 ']'
  - 2019-01-12 19:17:33,559: DEBUG - + sudo yunohost backup list
  - 2019-01-12 19:17:33,559: DEBUG - + grep -q synapse-pre-upgrade2
  - 2019-01-12 19:17:33,860: DEBUG - + sudo yunohost app remove synapse
  - 2019-01-12 19:17:35,664: WARNING - Removed /etc/systemd/system/multi-user.target.wants/matrix-synapse.service.
  - 2019-01-12 19:17:36,266: WARNING - Removed /etc/systemd/system/multi-user.target.wants/coturn-synapse.service.
  - 2019-01-12 19:17:37,268: WARNING - Port 8448 is already closed for IPv4 connections
  - 2019-01-12 19:17:37,269: WARNING - Port 8448 is already closed for IPv6 connections
  - 2019-01-12 19:18:10,555: WARNING - could not change directory to "/tmp/yunohost_remove/scripts": Permission denied
  - 2019-01-12 19:18:10,956: WARNING - could not change directory to "/tmp/yunohost_remove/scripts": Permission denied
  - 2019-01-12 19:18:10,956: WARNING - Remove the user matrix-synapse
  - 2019-01-12 19:18:11,859: DEBUG - synapse has been removed
  - 2019-01-12 19:18:12,160: DEBUG - The SSOwat configuration has been generated
  - 2019-01-12 19:18:12,160: DEBUG - + sudo yunohost backup restore synapse-pre-upgrade2 --apps synapse --force
  - 2019-01-12 19:18:48,531: WARNING - E: Packages need to be removed but remove is disabled.
  - 2019-01-12 19:18:48,531: WARNING - Unable to install dependencies
  - 2019-01-12 19:18:48,532: WARNING - !!
  - 2019-01-12 19:18:48,532: WARNING -   synapse's script has encountered an error. Its execution was cancelled.
  - 2019-01-12 19:18:48,533: WARNING - !!
  - 2019-01-12 19:18:48,533: WARNING - 
  - 2019-01-12 19:18:48,634: DEBUG - The operation 'Restore 'synapse' from a backup archive' has failed ! To get help, please share the full log of this operation using the command 'yunohost log display 20190112-191838-backup_restore_app-synapse --share'
  - 2019-01-12 19:18:48,634: WARNING - Unable to restore the app 'synapse'
  - 2019-01-12 19:18:52,542: WARNING - Traceback (most recent call last):
  - 2019-01-12 19:18:52,543: WARNING -   File "/opt/yunohost/matrix-synapse/remove_sso_conf.py", line 5, in <module>
  - 2019-01-12 19:18:52,543: WARNING -     data["skipped_urls"].remove("/_matrix")
  - 2019-01-12 19:18:52,543: WARNING - ValueError: list.remove(x): x not in list
  - 2019-01-12 19:18:54,047: WARNING - /var/lib/matrix-synapse wasn't deleted because it doesn't exist.
  - 2019-01-12 19:18:54,749: WARNING - could not change directory to "/home/yunohost.backup/tmp/synapse-pre-upgrade2/apps/synapse/settings/scripts": Permission denied
  - 2019-01-12 19:18:54,749: WARNING - dropdb: database removal failed: ERROR:  database "matrix_synapse" does not exist
  - 2019-01-12 19:18:54,850: WARNING - could not change directory to "/home/yunohost.backup/tmp/synapse-pre-upgrade2/apps/synapse/settings/scripts": Permission denied
  - 2019-01-12 19:18:54,850: WARNING - dropuser: removal of role "matrix_synapse" failed: ERROR:  role "matrix_synapse" does not exist
  - 2019-01-12 19:18:54,850: WARNING - The user matrix-synapse was not found
  - 2019-01-12 19:18:55,051: WARNING - Unknown service 'matrix-synapse'
  - 2019-01-12 19:18:55,352: DEBUG - The operation 'Remove 'synapse' after a failed restore from a backup archive' has failed ! To get help, please share the full log of this operation using the command 'yunohost log display 20190112-191848-remove_on_failed_restore-synapse --share'
  - 2019-01-12 19:18:55,352: WARNING - Unknown service 'coturn-synapse'
  - 2019-01-12 19:18:55,353: DEBUG - + ynh_die 'The app was restored to the way it was before the failed upgrade.'
  - 2019-01-12 19:18:55,353: WARNING - synapse has not been properly removed
  - 2019-01-12 19:18:55,354: DEBUG - + echo 'The app was restored to the way it was before the failed upgrade.'
  - 2019-01-12 19:18:55,354: WARNING - Nothing has been restored
  - 2019-01-12 19:18:55,354: DEBUG - + exit 1
  - 2019-01-12 19:18:55,355: WARNING - The app was restored to the way it was before the failed upgrade.
  - 2019-01-12 19:18:55,474: ERROR - Unable to upgrade synapse
metadata: 
  ended_at: 2019-01-12 19:18:55.474780
  env: 
    YNH_APP_ID: synapse
    YNH_APP_INSTANCE_NAME: synapse
    YNH_APP_INSTANCE_NUMBER: 1
    YNH_CWD: /var/cache/yunohost/from_file/synapse_ynh-testing/scripts
    YNH_STDINFO: /tmp/tmpTJdGpq/stdinfo
  error: Unable to upgrade synapse
  operation: app_upgrade
  related_to: 
    - app
    - synapse
  started_at: 2019-01-12 19:16:30.025496
  success: False
metadata_path: /var/log/yunohost/categories/operation/20190112-191630-app_upgrade-synapse.yml
name: 20190112-191630-app_upgrade-synapse

Oups. Refer to the first WARNING, it seem the file was not saved

I am not opening a new thread since I faced problems on the newest ‘upgrade’ of Synapse.

Unfortunately it failed and also removed completely my app, which makes me furious!! :triumph:

I mean I dont get it why the app has to be removed completely if the upgrade fails. Not only that, but I cannot restore the back up copy. This is the second time an app is removed, last week it was Jellyfin…I mean what is going on??

Here’s the link to the log:

https://paste.yunohost.org/raw/unusijaraj

I don’t know how to fix the situation, but the app shouldn’t be removed. Yet, it can happen because: the upgrade fails, which means the app is in a partially-upgraded-state and probably just won’t work. Therefore Yunohost tries to restore the pre-upgrade backup. And sometimes, depending on how the app works, the restore may fail too because computers are complicated and software design practices are bad for many complex reasons. Therefore Yunohost has no choice except removing the app (otherwise it would just leave a partially-upgraded or partially-restored app, which would just be broken and you’d have to fix yourself)

1 Like

I understand the logic behind app removal, I find it unacceptable though to even reach to that point without any fail safe in place (testings etc) prior to release for upgrade to the users.
So any help on what should I do now? How can i restore my app to previous state? Do i install the new version and restore the back up? My media folders are intact since the app does not remove them, but everything else is gone?

Also, addition to this, I am getting many redirects requests to the domain i used to have the synapse server? Is this because the clients (Element for Android eg) are pinging the domain?

@Josue

Dear all,

I got the same error, and the same problem (synapse is gone), it may make sense to remove the availibility of the update as it may avoid the replication to many users.
I have a full backup of my server not too old that i transfered to an external drive, I guess without other solutions I will move it back to the right place and hope the backup does the job. Is there a way to backup my other app and fuse it to my full bakup to avoid loosing things ?

Note: I also updated yunohost system packages first and then synapse.
https://paste.yunohost.org/raw/itogezobeb
Note2: I also cannot restore the app from pre-upgrade backup.
https://paste.yunohost.org/raw/omezetizaf

Thanks for your help,

Best,

I encountered the same problem with synapse. Keeping a close eye on the topic )

1 Like

I should have read the forum BEFORE starting the upgrade :cry:
Upgrade working for 50min now, with a load of 28 on the server, I’m quite afraid :scream:

And as feared : upgrade failed, restoration failed, impossible to restore a backup manually

The same problem, the app was removed and can’t be restored from backup

In addition to above, I tried restoring the whole backup (just the app backup failed) but it failed too… and then tried reinstall the app and failed again.

Any idea what to do ?

https://paste.yunohost.org/raw/wixugezeze

Aleks hi. Is there at least a way to migrate users from a backup to a newly installed synapse?

I just tested this fix to be able to restore the backup :

It is long, take your time, but it works :smiley:

Synapse is up and running !

2 Likes