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

Change url break installation and don't restore properly if it failed #299

Closed tr1p0p closed 1 year ago

tr1p0p commented 2 years ago

Describe the bug

When i want to change the url of my synapse from chat.nullmoon.host to chat.nullmoon.fr it seem first, the script don't get the right information from my installation (and that's weird) and also it leave the synapse installation on a non-functioning state.

I can have matrix-synapse service restart by doing chmod 644 and chown matrix-synapse:matrix-synapse on homeserver.yaml and synapse_server_name.conf but synapse still not working.

Context

Steps to reproduce

  1. Have synapse install on a sub-domain type sub.domain.tld
  2. Change to another sub on a another domain sub.domain.xvf
  3. Error at change - logs : https://paste.yunohost.org/raw/iyuwobuwaq
  4. Synapse not working after.

-Same on CLI. Also, i should precise it leave a synapse_server_name.conf in ngnix and it's don't seem to work for change_url script after this change.

Expected behavior

Should change the url. And if it's not working, should restore a functioning synapse.

Logs

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

applecargo commented 2 years ago

Here is same situation !

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

applecargo commented 2 years ago

I have managed to pass over change_url's permission stage

changing... : additional_urls --> add_url at https://github.com/YunoHost-Apps/synapse_ynh/blob/master/scripts/change_url#L123

before ynh_permission_url --permission=server_api --url=$domain/_matrix --additional_urls=$server_name/.well-known/matrix \

after ynh_permission_url --permission=server_api --url=$domain/_matrix --add_url=$server_name/.well-known/matrix

but, for me, I was also upgrading synapse... now I cannot start the services.. I don't know this failure of start-up also relates to this issue or not.

PS: if you want to re-run the change-url script.. then probably you want to make up some nginx conf files that is removed from last run. otherwise new run fails.

my new log

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

applecargo commented 2 years ago

I have also dirty fixed this permission problem.

appending these 2 lines to: https://github.com/YunoHost-Apps/synapse_ynh/blob/master/scripts/change_url#L116

chown matrix-synapse:root /etc/matrix-synapse/homeserver.yaml
chown matrix-synapse:root /etc/matrix-synapse/log.yaml

then, trigger change_url again -> finally recovered!

Josue-T commented 1 year ago

Closing as inactive