element-hq / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://element-hq.github.io/synapse
GNU Affero General Public License v3.0
963 stars 109 forks source link

Unable to federate between synapse servers within local network. #17366

Open serverhoge opened 4 days ago

serverhoge commented 4 days ago

Description

I set up Synapse servers on two PCs running Rocky Linux 8.6, set up Element-web as the client (Google-Chrome browser), and set up the web server Nginx. The IP address segments of each PC are matched, mDNS name resolution is functioning, and ping is also passing between PCs. Element uses a self-certificate (openssl) for SSL communication, so no warning screen will appear when you access Element-web with a browser.

When I federated between Synapse servers in my local network and tried to invite users from other servers using Element-web, the following error occurred. ・_matrix/client/v3/pr…t%3Ahoge2.local:1   Failed to load resource: the server responded with a status of 502 ()

・rageshake.ts:77 M_UNKNOWN: MatrixError: [502] Failed to fetch profile (https://hoge1.local/_matrix/client/v3/profile/%40isfroot%3Ahoge2.local) at p (https://hoge1.local/element-new/bundles/6843bc7…/bundle.js:2:844765) at A.requestOtherUrl (https://hoge1.local/element-new/bundles/6843bc7…/bundle.js:2:849078) at async A.authedRequest (https://hoge1.local/element-new/bundles/6843bc7…/bundle.js:2:846904) at async v.inviteToRoom (https://hoge1.local/element-new/bundles/6843bc7…/bundle.js:2:3020198) e. @ rageshake.ts:77

At the same time as this error occurs, "Unknown server error" will be displayed on the Element-web screen.

In addition, the Synapse configuration file (homeserver.yaml) and Nginx configuration file (nginx.conf) are as follows. ・homeserver.yaml.txtnginx.conf.txt (The configuration files for the two PCs have the same settings except for the server name.)

Could you please tell me how to solve it?

Steps to reproduce

Homeserver

another home server

Synapse Version

1.98.0

Installation Method

pip (from PyPI)

Database

SQLite3

Workers

Single process

Platform

Before starting Synapse, enter the "env" virtual environment(source ./synapse/env/bin/activate)

Configuration

The download URL for Synapse and Nginx configuration files is listed in the description section.

Relevant log output

2024-06-27 11:03:53,868 - synapse.http.federation.well_known_resolver - 253 - INFO - GET-135 - Fetching https://hoge2.local/.well-known/matrix/server
2024-06-27 11:03:53,970 - synapse.http.client - 194 - INFO - sentinel - Blocked 192.168.10.22 from DNS resolution to hoge2.local
2024-06-27 11:03:53,971 - synapse.http.federation.well_known_resolver - 284 - INFO - GET-135 - Error fetching https://hoge2.local/.well-known/matrix/server: DNS lookup failed: no results for hostname lookup: hoge2.local.
2024-06-27 11:03:53,971 - twisted - 275 - INFO - GET-135 - b'/etc/resolv.conf' changed, reparsing
2024-06-27 11:04:03,870 - synapse.http.matrixfederationclient - 792 - INFO - GET-135 - {GET-O-1} [hoge2.local] Request failed: GET matrix-federation://hoge2.local/_matrix/federation/v1/query/profile?user_id=%40isfroot%3Ahoge2.local&field=displayname: TimeoutError('Timed out after 10s')
2024-06-27 11:04:03,870 - synapse.http.server - 124 - INFO - GET-135 - <XForwardedForRequest at 0x7f57006e9730 method='GET' uri='/_matrix/client/v3/profile/%40isfroot%3Ahoge2.local' clientproto='HTTP/1.0' site='8008'> SynapseError: 502 - Failed to fetch profile

2024-06-27 11:04:52,056 - synapse.http.server - 124 - INFO - GET-141 - <XForwardedForRequest at 0x7f57006fdf40 method='GET' uri='/_matrix/client/v3/room_keys/version' clientproto='HTTP/1.0' site='8008'> SynapseError: 403 - Guest access not allowed
2024-06-27 11:04:52,057 - synapse.access.http.8008 - 465 - INFO - GET-141 - 192.168.10.21 - 8008 - {None} Processed request: 0.001sec/0.000sec (0.001sec, 0.000sec) (0.000sec/0.000sec/0) 73B 403 "GET /_matrix/client/v3/room_keys/version HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" [0 dbevts]

2024-06-27 11:05:00,456 - synapse.http.server - 124 - INFO - GET-169 - <XForwardedForRequest at 0x7f5700546430 method='GET' uri='/_matrix/client/unstable/org.matrix.msc2697.v2/dehydrated_device' clientproto='HTTP/1.0' site='8008'> SynapseError: 404 - No dehydrated device available

Anything else that would be useful to know?

No response