YunoHost-Apps / synapse_ynh

Matrix server (synapse) package for YunoHost
https://matrix.org/
GNU General Public License v3.0
79 stars 43 forks source link

synapse restore failed after failed upgrade from 1.84 to 1.85 #391

Closed jorge-vitrubio closed 1 year ago

jorge-vitrubio commented 1 year ago

having installed and running synapse 1.84.1 i was proposed with upgrade to 1.85.

i did apply yunohost tools upgrade apps but the upgrade went wrong.

No I can not restore from backup yunohost backup restore synapse-pre-upgrade1 throws this errors

ended_at: 2023-06-16 10:59:15.646469
error: "Could not restore synapse: Something unexpected went wrong: \nTraceback (most\
  \ recent call last):\n  File \"/usr/lib/python3/dist-packages/yunohost/backup.py\"\
  , line 1465, in _restore_app\n    permission_create(\n  File \"/usr/lib/python3/dist-packages/yunohost/log.py\"\
  , line 410, in func_wrapper\n    result = func(*args, **kwargs)\n  File \"/usr/lib/python3/dist-packages/yunohost/permission.py\"\
  , line 401, in permission_create\n    raise YunohostValidationError(\"permission_already_exist\"\
  , permission=permission)\nyunohost.utils.error.YunohostValidationError: Permission\
  \ 'synapse.admin_api' already exists\n"
interface: cli
operation: backup_restore_app
parent: null
related_to:
- - app
  - synapse
started_at: 2023-06-16 10:59:15.360502
success: false
yunohost_version: 11.1.21.4

============

2023-06-16 12:59:15,400: INFO - Restoring synapse...
2023-06-16 12:59:15,637: DEBUG - initializing ldap interface
2023-06-16 12:59:15,645: ERROR - Could not restore synapse: Something unexpected went wrong: 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/backup.py", line 1465, in _restore_app
    permission_create(
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 410, in func_wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/yunohost/permission.py", line 401, in permission_create
    raise YunohostValidationError("permission_already_exist", permission=permission)
yunohost.utils.error.YunohostValidationError: Permission 'synapse.admin_api' already exists

seems it is stucked with previous install or something, I do not know howto proceed.

jorge-vitrubio commented 1 year ago

UPDATE: if I try to do a clean install also fails, it looks like it has some pending/hanging apps

yunohost app install synapse
Choose the domain where this app should be installed [domain.tdl | matrix.domain.tdl]: matrix.domain.tdl
If your Synapse domain is a subdomain, you can choose a name for your Synapse server to have your Matrix user-ids looking like @user:domain.org instead of @user:synapse.domain.org: domain.tdl
Is it a server with free registration? [yes | no]: no
Jitsi server address for conferencing?: jitsi.riot.im
Info: Installing synapse...
Info: The operation 'Install the 'synapse' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20230616-110707-app_install-synapse' to get help
Error: Permission 'synapse.main' already exists

this is the yunohost log share

args:
  app: synapse
  force: false
  label: null
  no_remove_on_failure: false
ended_at: 2023-06-16 11:07:07.327064
error: Permission 'synapse.main' already exists
interface: cli
operation: app_install
parent: null
related_to:
- - app
  - synapse
started_at: 2023-06-16 11:07:07.291142
success: false
yunohost_version: 11.1.21.4

============

2023-06-16 13:07:07,309: INFO - Installing synapse...

then again, it seems that @SIM have already run into this issue and was solved as he explains here:

https://forum.yunohost.org/t/solved-solution-synapse-upgrade-from-1-38-to-1-42-failed-backup-restore-failed-too/17406/4

it is about hanging permissions.

so to solve i did: