Element - Matrix - Synapse connection error

My YunoHost server

Hardware: Old laptop or computer
YunoHost version: 4.0.8
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen | Yes
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : Maybe? Just only changed cron.d to receive Automatic Diagnosis emails at a different times in a day. Don’t know if that was the issue that affected my problem.

Description of my issue

Hi all,

Up until yesterday when i tried to connect via web browser to my Matrix server, everything was working fine. I followed the normal procedure via Element and after I clicked the SSO button to connect to my Matrix homeserver, I got the following error.

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

Headers:

X-Firefox-Spdy	h2
access-control-allow-headers	Origin, X-Requested-With, Content-Type, Accept, Authorization
access-control-allow-methods	GET, HEAD, POST, PUT, DELETE, OPTIONS
access-control-allow-origin	*
cache-control	no-cache, no-store, must-revalidate
content-length	55
content-security-policy	upgrade-insecure-requests
content-security-policy-report-only	default-src https: data: 'unsafe-inline' 'unsafe-eval'
content-type	application/json
date	Fri, 25 Sep 2020 10:26:46 GMT
server	nginx
strict-transport-security	max-age=63072000; includeSubDomains; preload
x-content-type-options	nosniff
x-download-options	noopen
x-frame-options	SAMEORIGIN
x-permitted-cross-domain-policies	none
x-sso-wat	You've just been SSOed
x-xss-protection	1; mode=block
Accept	text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding	gzip, deflate, br
Accept-Language	en-US,en;q=0.5
Connection	keep-alive
DNT	1
Host	mat.domain.tld
TE	Trailers
Upgrade-Insecure-Requests	1
User-Agent	Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0

When I disconnected also the Android app and tried to reconnect i got the same message.

I remember 3-4 days ago, Synapse I upgraded Synapse via the normal procedure in the admin interface and also update the Element android App. I didn’t do anything else.

Matrix server (nginx) works fine when I access it via port 8448 and all ports are open.

I have installed the server in a subdomain eg mat.domain.tld and the element application in my domain.tld.

Also below some error logs from journalctl that hasve to do with CAS ?

Sep 25 13:43:23 python[641]: Traceback (most recent call last):
Sep 25 13:43:23 python[641]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/server.py", line 229, in _async_render_wrapper
Sep 25 13:43:23 python[641]:     callback_return = await self._async_render(request)
Sep 25 13:43:23 python[641]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/server.py", line 406, in _async_render
Sep 25 13:43:23 python[641]:     callback_return = await raw_callback_return
Sep 25 13:43:23 python[641]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/rest/client/v1/login.py", line 468, in on_GET
Sep 25 13:43:23 python[641]:     request, ticket, client_redirect_url, session
Sep 25 13:43:23 python[641]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/handlers/cas_handler.py", line 200, in handle_ticket
Sep 25 13:43:23 python[641]:     username, user_display_name = await self._validate_ticket(ticket, args)
Sep 25 13:43:23 python[641]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/handlers/cas_handler.py", line 83, in _validate_ticket
Sep 25 13:43:23 python[641]:     body = await self._http_client.get_raw(uri, args)
Sep 25 13:43:23 python[641]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/client.py", line 540, in get_raw
Sep 25 13:43:23 python[641]:     response = await self.request("GET", uri, headers=Headers(actual_headers))
Sep 25 13:43:23 python[641]:   File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/client.py", line 332, in request
Sep 25 13:43:23 python[641]:     response = await make_deferred_yieldable(request_deferred)
Sep 25 13:43:23 python[641]: twisted.internet.error.TimeoutError: User timeout caused connection failure.

And from matrix-synapse logs :

2020-09-25 13:43:07,282 - synapse.access.http.8008 - 311 - INFO - GET-15- 199.249.230.112 - 8008 - {None} Processed request: 0.000sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 0B 302 "GET /_matrix/client/r0/login/cas/redirect?redirectUrl=https%3A%2F%2Fdomain.tdl%2Felement%2F%23%2F HTTP/1.0" "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]
2020-09-25 13:43:23,326 - synapse.http.client - 349 - INFO - GET-16- Error sending request to  GET https://mat.domain.tdl/_matrix/cas_server.php/proxyValidate?ticket=f6a88a1b3700e99ac4adf2bc58b220b986fee81481d21809eeb407352d00c791a24e7890fd5869d0be0e7776afd6f9545bf2&service=https%3A%2F%2Fmat.domain.tdl%2F_matrix%2Fclient%2Fr0%2Flogin%2Fcas%2Fticket%3FredirectUrl%3Dhttps%253A%252F%252Fdomain.tdl%252Felement%252F%2523%252F: TimeoutError 
2020-09-25 13:43:23,326 - synapse.http.server - 84 - ERROR - GET-16- Failed handle request via 'CasTicketServlet': <XForwardedForRequest at 0x7fb80c0bc278 method='GET' uri='/_matrix/client/r0/login/cas/ticket?redirectUrl=https%3A%2F%2Fdomain.tdl%2Felement%2F%23%2F&ticket=f6a88a1b3700e99ac4adf2bc58b220b986fee81481d21809eeb407352d00c791a24e7890fd5869d0be0e7776afd6f9545bf2' 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 229, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/server.py", line 406, in _async_render
    callback_return = await raw_callback_return
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/rest/client/v1/login.py", line 468, 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 200, 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 83, in _validate_ticket
    body = await self._http_client.get_raw(uri, args)
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/client.py", line 540, in get_raw
    response = await self.request("GET", uri, headers=Headers(actual_headers))
  File "/opt/yunohost/matrix-synapse/lib/python3.7/site-packages/synapse/http/client.py", line 332, in request
    response = await make_deferred_yieldable(request_deferred)
twisted.internet.error.TimeoutError: User timeout caused connection failure.
2020-09-25 13:43:23,327 - synapse.access.http.8008 - 311 - INFO - GET-16- 199.249.230.112 - 8008 - {None} Processed request: 15.006sec/0.000sec (0.001sec, 0.002sec) (0.000sec/0.000sec/0) 55B 500 "GET /_matrix/client/r0/login/cas/ticket?redirectUrl=https%3A%2F%2Fdomain.tdl%2Felement%2F%23%2F&ticket=f6a88a1b3700e99ac4adf2bc58b220b986fee81481d21809eeb407352d00c791a24e7890fd5869d0be0e7776afd6f9545bf2 HTTP/1.0" "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0" [0 dbevts]

EDIT: Up until the log out and re log in, service was working just fine and messages were getting through etc…
Synapse Version
1.19.3~ynh1

Appreciate any help!

Thank you!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.