Synapse impossible à utiliser

Mon serveur YunoHost

Matériel: ordinateur
Version de YunoHost: 4.0.3
J’ai accès à mon serveur : En SSH + Par la webadmin + En direct avec un clavier/écran
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non

Description du problème

J’avais lu de 2 personnes que la mise à jour vers YunoHost 4 avait cassé synapse, mais qu’une ré-install permettait de relancer.
Du coup, j’ai fait la mise à jour, et Synapse marchait parfaitement.

Cependant, ce soir j’ai été forcé de rebooter mon serveur, et au démarrage, impossible de lancer Synapse.
J’ai essayé un reboot, de sauvegarder/restaurer, la version testing, supprimer et installer, le tout sans succès.

Le chargement de la sauvegarde passe en échec, (et vu que la sauvegarde fait 6Go, c’est très long, pour rien).
L’installation a l’air de fonctionner, mais il m’est impossible de me connecter depuis Riot/Element, au moment de demander un token à mon serveur j’ai cette réponse :

{"errcode":"M_UNKNOWN","error":"Internal server error"}

Et dans les logs du service :

journalctl

août 01 01:02:06 python[6848]: 2020-08-01 01:02:06,966 - root - 257 - WARNING - None- ***** STARTING SERVER *****
août 01 01:02:06 python[6848]: 2020-08-01 01:02:06,967 - root - 258 - WARNING - None- Server /opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/app/homeserver.py version 1.15.2
août 01 01:02:10 python[6848]: 2020-08-01 01:02:10,590 - synapse.app - 48 - WARNING - - Failed to listen on 0.0.0.0, continuing because listening on [::]
août 01 01:02:42 python[6848]: 2020-08-01 01:02:42,045 - synapse.handlers.device - 603 - WARNING - PUT-1- Got device list update edu for '@richard:converser.eu'/'QLLRQIAAOR', but don't share a room
août 01 01:02:42 python[6848]: 2020-08-01 01:02:42,047 - synapse.handlers.device - 603 - WARNING - PUT-1- Got device list update edu for '@richard:converser.eu'/'XBNFIUJHMB', but don't share a room
août 01 01:04:23 python[6848]: 2020-08-01 01:04:23,685 - synapse.http.server - 113 - ERROR - GET-13- Failed handle request via 'CasTicketServlet': <XForwardedForRequest at 0x7f5995e45828 method='GET' uri='/_matrix/client/r0/login/cas/ticket?redirectUrl=https%3A%2F%2Friot.myserver.fr%2F&ticket=aa4de6992056a636bef9fa6e00fbf5227944ba2694a097da48016e9bfe08a9f1f9ba832793470209b84eb7f6ead28b1982f1' clientproto='HTTP/1.0' site=8008>
août 01 01:04:23 python[6848]: Traceback (most recent call last):
août 01 01:04:23 python[6848]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/server.py", line 81, in wrapped_request_handler
août 01 01:04:23 python[6848]:     await h(self, request)
août 01 01:04:23 python[6848]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/server.py", line 345, in _async_render
août 01 01:04:23 python[6848]:     callback_return = await callback_return
août 01 01:04:23 python[6848]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/rest/client/v1/login.py", line 436, in on_GET
août 01 01:04:23 python[6848]:     request, ticket, client_redirect_url, session
août 01 01:04:23 python[6848]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/handlers/cas_handler.py", line 202, in handle_ticket
août 01 01:04:23 python[6848]:     username, user_display_name = await self._validate_ticket(ticket, args)
août 01 01:04:23 python[6848]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/handlers/cas_handler.py", line 85, in _validate_ticket
août 01 01:04:23 python[6848]:     body = await self._http_client.get_raw(uri, args)
août 01 01:04:23 python[6848]: twisted.internet.error.TimeoutError: User timeout caused connection failure.

/var/log/matrix-synapse/homeserver.log

2020-08-01 01:03:42,070 - twisted - 192 - INFO - - Timing out client: IPv6Address(type='TCP', host='::ffff:51.159.70.121', port=39888, flowInfo=0, scopeID=0)
2020-08-01 01:03:54,538 - synapse.access.http.8008 - 311 - INFO - GET-4- 192.168.1.254 - 8008 - {None} Processed request: 0.001sec/0.001sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 215B 200 "GET /_matrix/client/versions HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:03:54,651 - synapse.access.http.8008 - 311 - INFO - OPTIONS-5- 192.168.1.254 - 8008 - {None} Processed request: 0.002sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/register?kind=guest HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:03:54,671 - synapse.http.server - 84 - INFO - POST-6- <XForwardedForRequest at 0x7f5999633080 method='POST' uri='/_matrix/client/r0/register?kind=guest' clientproto='HTTP/1.0' site=8008> SynapseError: 403 - Guest access is disabled
2020-08-01 01:03:54,675 - synapse.access.http.8008 - 311 - INFO - POST-6- 192.168.1.254 - 8008 - {None} Processed request: 0.005sec/0.001sec (0.005sec, 0.000sec) (0.000sec/0.000sec/0) 58B 403 "POST /_matrix/client/r0/register?kind=guest HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:04:00,233 - synapse.metrics - 541 - INFO - - Collecting gc 1
2020-08-01 01:04:03,482 - synapse.access.http.8008 - 311 - INFO - GET-7- 192.168.1.254 - 8008 - {None} Processed request: 0.001sec/0.001sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 215B 200 "GET /_matrix/client/versions HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:04:04,047 - synapse.access.http.8008 - 311 - INFO - OPTIONS-8- 192.168.1.254 - 8008 - {None} Processed request: 0.002sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "OPTIONS /_matrix/client/r0/register?kind=guest HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:04:04,103 - synapse.http.server - 84 - INFO - POST-9- <XForwardedForRequest at 0x7f5999603588 method='POST' uri='/_matrix/client/r0/register?kind=guest' clientproto='HTTP/1.0' site=8008> SynapseError: 403 - Guest access is disabled
2020-08-01 01:04:04,105 - synapse.access.http.8008 - 311 - INFO - POST-9- 192.168.1.254 - 8008 - {None} Processed request: 0.002sec/0.001sec (0.003sec, 0.000sec) (0.000sec/0.000sec/0) 58B 403 "POST /_matrix/client/r0/register?kind=guest HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:04:05,013 - twisted - 192 - INFO - - Timing out client: IPv6Address(type='TCP', host='::ffff:78.46.251.132', port=56294, flowInfo=0, scopeID=0)
2020-08-01 01:04:06,218 - synapse.access.http.8008 - 311 - INFO - GET-10- 192.168.1.254 - 8008 - {None} Processed request: 0.001sec/0.001sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 215B 200 "GET /_matrix/client/versions HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:04:06,397 - synapse.access.http.8008 - 311 - INFO - GET-11- 192.168.1.254 - 8008 - {None} Processed request: 0.001sec/0.001sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 118B 200 "GET /_matrix/client/r0/login HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:04:08,496 - synapse.access.http.8008 - 311 - INFO - GET-12- 192.168.1.254 - 8008 - {None} Processed request: 0.001sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 0B 302 "GET /_matrix/client/r0/login/cas/redirect?redirectUrl=https%3A%2F%2Friot.myserver.fr%2F HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:04:08,656 - synapse.http.client - 283 - INFO - GET-13- Sending request GET https://matrix.myserver.fr/_matrix/cas_server.php/proxyValidate?ticket=aa4de6992056a636bef9fa6e00fbf5227944ba2694a097da48016e9bfe08a9f1f9ba832793470209b84eb7f6ead28b1982f1&service=https%3A%2F%2Fmatrix.myserver.fr%2F_matrix%2Fclient%2Fr0%2Flogin%2Fcas%2Fticket%3FredirectUrl%3Dhttps%253A%252F%252Friot.myserver.fr%252F
2020-08-01 01:04:10,391 - synapse.handlers.presence - 350 - INFO - persist_presence_changes-0- Persisting 1 unpersisted presence updates
2020-08-01 01:04:23,683 - synapse.http.client - 330 - INFO - GET-13- Error sending request to  GET https://matrix.myserver.fr/_matrix/cas_server.php/proxyValidate?ticket=aa4de6992056a636bef9fa6e00fbf5227944ba2694a097da48016e9bfe08a9f1f9ba832793470209b84eb7f6ead28b1982f1&service=https%3A%2F%2Fmatrix.myserver.fr%2F_matrix%2Fclient%2Fr0%2Flogin%2Fcas%2Fticket%3FredirectUrl%3Dhttps%253A%252F%252Friot.myserver.fr%252F: TimeoutError 
2020-08-01 01:04:23,685 - synapse.http.server - 113 - ERROR - GET-13- Failed handle request via 'CasTicketServlet': <XForwardedForRequest at 0x7f5995e45828 method='GET' uri='/_matrix/client/r0/login/cas/ticket?redirectUrl=https%3A%2F%2Friot.myserver.fr%2F&ticket=aa4de6992056a636bef9fa6e00fbf5227944ba2694a097da48016e9bfe08a9f1f9ba832793470209b84eb7f6ead28b1982f1' clientproto='HTTP/1.0' site=8008>
Traceback (most recent call last):
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/server.py", line 81, in wrapped_request_handler
    await h(self, request)
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/server.py", line 345, in _async_render
    callback_return = await callback_return
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/rest/client/v1/login.py", line 436, in on_GET
    request, ticket, client_redirect_url, session
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/handlers/cas_handler.py", line 202, in handle_ticket
    username, user_display_name = await self._validate_ticket(ticket, args)
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/handlers/cas_handler.py", line 85, in _validate_ticket
    body = await self._http_client.get_raw(uri, args)
twisted.internet.error.TimeoutError: User timeout caused connection failure.
2020-08-01 01:04:23,691 - synapse.access.http.8008 - 311 - INFO - GET-13- 192.168.1.254 - 8008 - {None} Processed request: 15.037sec/0.001sec (0.026sec, 0.003sec) (0.000sec/0.000sec/0) 55B 500 "GET /_matrix/client/r0/login/cas/ticket?redirectUrl=https%3A%2F%2Friot.myserver.fr%2F&ticket=aa4de6992056a636bef9fa6e00fbf5227944ba2694a097da48016e9bfe08a9f1f9ba832793470209b84eb7f6ead28b1982f1 HTTP/1.0" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" [0 dbevts]
2020-08-01 01:05:51,931 - synapse.crypto.keyring - 633 - INFO - PUT-14- Requesting keys dict_items([('mailtrix.app', {'ed25519:a_wVuf': 1596236751924})]) from notary server matrix.org
2020-08-01 01:05:51,934 - synapse.http.matrixfederationclient - 409 - INFO - PUT-14- {POST-O-4} [matrix.org] Sending request: POST matrix://matrix.org/_matrix/key/v2/query; timeout 60.000000s
2020-08-01 01:05:51,937 - synapse.http.federation.matrix_federation_agent - 242 - INFO - PUT-14- Connecting to matrix-federation.matrix.org:443
2020-08-01 01:05:52,169 - synapse.http.matrixfederationclient - 165 - INFO - PUT-14- {POST-O-4} [matrix.org] Completed: 200 OK
2020-08-01 01:05:52,298 - synapse.federation.transport.server - 406 - INFO - PUT-14- Received txn 1596200884806 from mailtrix.app. (PDUs: 0, EDUs: 2)
2020-08-01 01:05:52,378 - synapse.access.https.8448 - 311 - INFO - PUT-14- ::ffff:82.65.59.221 - 8448 - {mailtrix.app} Processed request: 0.454sec/0.001sec (0.044sec, 0.008sec) (0.024sec/0.172sec/15) 12B 200 "PUT /_matrix/federation/v1/send/1596200884806 HTTP/1.1" "Synapse/1.15.1" [0 dbevts]
2020-08-01 01:06:10,231 - synapse.metrics - 541 - INFO - - Collecting gc 1
2020-08-01 01:06:35,710 - synapse.federation.transport.server - 406 - INFO - PUT-15- Received txn 1596200884927 from mailtrix.app. (PDUs: 0, EDUs: 1)
2020-08-01 01:06:35,737 - synapse.access.https.8448 - 311 - INFO - PUT-15- ::ffff:82.65.59.221 - 8448 - {mailtrix.app} Processed request: 0.042sec/0.001sec (0.016sec, 0.002sec) (0.007sec/0.019sec/3) 12B 200 "PUT /_matrix/federation/v1/send/1596200884927 HTTP/1.1" "Synapse/1.15.1" [0 dbevts]
2020-08-01 01:07:10,343 - synapse.storage.data_stores.main - 424 - INFO - generate_user_daily_visits-0- Calling _generate_user_daily_visits
2020-08-01 01:07:10,391 - synapse.handlers.presence - 350 - INFO - persist_presence_changes-3- Persisting 1 unpersisted presence updates
2020-08-01 01:07:35,738 - twisted - 192 - INFO - - Timing out client: IPv6Address(type='TCP', host='::ffff:82.65.59.221', port=58364, flowInfo=0, scopeID=0)
2020-08-01 01:08:11,209 - synapse.federation.transport.server - 406 - INFO - PUT-16- Received txn 1596110064239 from noemis.me. (PDUs: 0, EDUs: 1)
2020-08-01 01:08:11,245 - synapse.access.https.8448 - 311 - INFO - PUT-16- ::ffff:78.46.251.132 - 8448 - {noemis.me} Processed request: 0.040sec/0.001sec (0.014sec, 0.003sec) (0.008sec/0.015sec/3) 12B 200 "PUT /_matrix/federation/v1/send/1596110064239 HTTP/1.1" "Synapse/1.18.0" [0 dbevts]
2020-08-01 01:08:27,053 - synapse.federation.transport.server - 406 - INFO - PUT-17- Received txn 1596200885046 from mailtrix.app. (PDUs: 0, EDUs: 1)
2020-08-01 01:08:27,093 - synapse.access.https.8448 - 311 - INFO - PUT-17- ::ffff:82.65.59.221 - 8448 - {mailtrix.app} Processed request: 0.044sec/0.001sec (0.015sec, 0.001sec) (0.006sec/0.025sec/3) 12B 200 "PUT /_matrix/federation/v1/send/1596200885046 HTTP/1.1" "Synapse/1.15.1" [0 dbevts]
2020-08-01 01:09:00,231 - synapse.metrics - 541 - INFO - - Collecting gc 1
2020-08-01 01:09:11,248 - twisted - 192 - INFO - - Timing out client: IPv6Address(type='TCP', host='::ffff:78.46.251.132', port=60066, flowInfo=0, scopeID=0)
2020-08-01 01:09:27,095 - twisted - 192 - INFO - - Timing out client: IPv6Address(type='TCP', host='::ffff:82.65.59.221', port=58890, flowInfo=0, scopeID=0)

Au cas où ça puisse servir, le reboot a été pendant un changement de box, la nouvelle sait parler ipv6 contrairement à l’ancienne.

Si quelqu’un a une idée, je suis preneur !

J’ai essayé avec Riot.im (la vieille version de l’app android, que j’avais gardé sur mon tel), et par elle j’ai pu me connecter, elle proposait de passer par l’authentification unique OU par login/mot-de-passe.
Avec le login/mdp ça passe.

Bon par contre, l’historique est entièrement disparu et c’est tout triste (j’ai un backup d’il y a 6 jours, je ne sais pas pourquoi mais celui d’aujourd’hui a disparu)

Du coup, une fois que ça fonctionnera, il faudra trouver comment restaurer les données :scream:

Problème contourné :
Vu qu’une ré-installation ne me permettait pas de me connecter, j’ai fait une ré-installation en changeant de domaine.
Et la, ça marche.
Bon par contre, tout a été remis à zéro.

Bonjour,

Je crois que c’est lié à ça https://github.com/YunoHost-Apps/synapse_ynh/issues/207

Un fix est disponible sur la branche testing

Pour je ne sais quelle raison, le backup post-upgrade a disparru, j’ai juste une sauvegarde antérieur à YNH4 :worried:
Je me suis fait une raison :worried:

Salut,

Est-ce que tu pourrais expliquer comment restorer une sauvegarde en passant par la branche testing stp ?

Merci ! :slight_smile: