YunoHost-Apps / synapse_ynh

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

Latest update completely broke the server and the ability to restore... #352

Closed jukefr closed 1 year ago

jukefr commented 1 year ago
  1. press upate to latest
  2. crashes
    2022-12-03 16:54:41,743: DEBUG - + auth_header=,auth_header=False
    2022-12-03 16:54:41,745: DEBUG - + yunohost tools shell -c 'from yunohost.permission import permission_url; permission_url('\''synapse.server_client_infos'\'' ,url='\''maindomain.tld/.well-known/matrix'\''   ,auth_header=False )'
    2022-12-03 16:54:43,263: WARNING - This URL is either unavailable, or conflicts with the already installed app(s):
    2022-12-03 16:54:43,266: WARNING -  * maindomain.tld/ → Perso (my_webapp)

    (the app is configured to run on chat.domain.tld but with the option to let you add the base domain, like intended by the configuration panel of this app.........)

  3. fails to restore
ended_at: 2022-12-04 05:19:39.920334
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 1453, in _restore_app\n    permission_create(\n  File \"/usr/lib/python3/dist-packages/yunohost/log.py\"\
  , line 419, in func_wrapper\n    result = func(*args, **kwargs)\n  File \"/usr/lib/python3/dist-packages/yunohost/permission.py\"\
  , line 410, in permission_create\n    raise YunohostValidationError(\"permission_already_exist\"\
  , permission=permission)\nyunohost.utils.error.YunohostValidationError: Permission\
  \ 'synapse.admin_api' already exists\n"
interface: api
operation: backup_restore_app
parent: null
related_to:
- - app
  - synapse
started_at: 2022-12-04 05:19:39.458553
success: false
yunohost_version: 11.0.10.2

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

2022-12-04 05:19:39,534: INFO - Restoring synapse...
2022-12-04 05:19:39,918: ERROR - Could not restore synapse: Something unexpected went wrong: 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/backup.py", line 1453, in _restore_app
    permission_create(
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 419, in func_wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/yunohost/permission.py", line 410, in permission_create
    raise YunohostValidationError("permission_already_exist", permission=permission)
yunohost.utils.error.YunohostValidationError: Permission 'synapse.admin_api' already exists
jukefr commented 1 year ago

Removed the app running on basedomain.tld same restore issue with the permission is there any way im getting back my server without loosing absolutely everything ?

jukefr commented 1 year ago

Seems like this is an issue that happens often.... https://forum.yunohost.org/t/solved-solution-synapse-upgrade-from-1-38-to-1-42-failed-backup-restore-failed-too/17406 I feel like there should be some sort of way to handle having an app running on the base domain without making every thing break on updates ? At the very least there could be warning before making the install a completely unusable state (for most users that will not know how to fix this)

jukefr commented 1 year ago

fyi the way to fix this

  1. remove any synapse install leftovers
  2. reinstall fresh synapse (it will fail immediatly)
  3. delete this fresh install (it should see the leftovers from previous install now)
  4. now apparently you can restore the backup..............................
jukefr commented 1 year ago

also this entire process seems to have broken mautrix_whatsapp...

rizzek commented 1 year ago

fyi the way to fix this

1. remove any synapse install leftovers

2. reinstall fresh synapse (it will fail immediatly)

3. delete this fresh install (it should see the leftovers from previous install now)

4. now apparently you can restore the backup..............................

I just ran into the same problem.

@jukefr What "install leftovers" did you remove to get it up and running again?

rizzek commented 1 year ago

Actually, my issue was not linked to any permissions but to some python OpenSSL libs being included in the backup as reported here (also, their fix worked for me!): https://github.com/YunoHost-Apps/synapse_ynh/issues/355