Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Contact Homeserver - Element X (IOS) #17851

Closed
lucamaximilianegger opened this issue Oct 18, 2024 · 7 comments
Closed

Unable to Contact Homeserver - Element X (IOS) #17851

lucamaximilianegger opened this issue Oct 18, 2024 · 7 comments
Labels

Comments

@lucamaximilianegger
Copy link

lucamaximilianegger commented Oct 18, 2024

Description

I'm currently setting up a Matrix server, and everything seems to be running fine. I'm able to get a 200 OK response from the following URLs:

https://matrix.dreamnetwork.space/
https://matrix.dreamnetwork.space/_synapse/admin/v1/server_version
https://matrix.dreamnetwork.space/.well-known/matrix/client
https://matrix.dreamnetwork.space/_matrix/client/versions

However, when I try to log in using Element X on my iPhone 14 Pro, which is running iOS 18.0.1, I get an error saying the homeserver is unreachable. The log shows the following message:

css

2024-10-18T19:03:22.301572Z ERROR elementx: Failed configuring a server: ServerUnreachable(message: "error sending request for url (https://matrix.dreamnetwork.space/.well-known/matrix/client)") | AuthenticationService.swift:86 | spans: root

I've tried debugging the issue, but I haven't been able to resolve it. Oddly enough, when I open the URL https://matrix.dreamnetwork.space/.well-known/matrix/client in the browser on my phone, I receive a 200 OK response.

I'm running out of ideas on how to fix this and would appreciate any help in resolving the issue.

Steps to reproduce

  • list the steps
  • that reproduce the bug
  • using hyphens as bullet points

Homeserver

matrix.dreamnetwork.space

Synapse Version

v1.117.0

Installation Method

Docker (matrixdotorg/synapse)

Database

PostgreSQL v14 (New Docker Container)

Workers

Single process

Platform

ARM, Ubuntu, Docker Compose File

Configuration

No response

Relevant log output

2024-10-18T19:03:22.301572Z ERROR elementx: Failed configuring a server: ServerUnreachable(message: "error sending request for url (https://matrix.dreamnetwork.space/.well-known/matrix/client)") | AuthenticationService.swift:86 | spans: root

Anything else that would be useful to know?

No response

@daedric7
Copy link

Can you try removing that last / ??

curl -s https://matrix.dreamnetwork.space/.well-known/matrix/client | jq
{
  "m.homeserver": {
    "base_url": "https://matrix.dreamnetwork.space/" <-- here
  }
}

@lucamaximilianegger
Copy link
Author

lucamaximilianegger commented Oct 21, 2024

https://matrix.dreamnetwork.space/.well-known/matrix/client

An amusing detail is that in the homeserver.yml, there's no backslash at all. It simply states:
public_baseurl: "https://matrix.dreamnetwork.space"

@daedric7
Copy link

Wait, that .well-known is being served by synapse itself ?

@lucamaximilianegger
Copy link
Author

lucamaximilianegger commented Oct 22, 2024

Wait, that .well-known is being served by synapse itself ?

Yea it is, it takes the configuration out of the Homeserver.yml and then publish that .well-known.

@lucamaximilianegger
Copy link
Author

You mean with this?

https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#extra_well_known_client_content

I just used:

"public_baseurl

The public-facing base URL that clients use to access this Homeserver (not including _matrix/...). This is the same URL a user might enter into the 'Custom Homeserver URL' field on their client. If you use Synapse with a reverse proxy, this should be the URL to reach Synapse via the proxy. Otherwise, it should be the URL to reach Synapse's client HTTP listener (see 'listeners' below).

Defaults to https://<server_name>/.

Example configuration:

public_baseurl: https://example.com/"

This option should be everything you need to connect to your hoemserver.

@anoadragon453
Copy link
Member

A few notes:

  • I tried putting both "https://matrix.dreamnetwork.space" and "matrix.dreamnetwork.space" into my Element X Android client and had no issues getting to the sign in page. This makes me think it might be something specific to Element X iOS.
  • Technically you don't need to specify m.homeserver->base_url at all as you're not delegating from one host to another. Typically one would do that by using, e.g. dreamnetwork.space as their configured Synapse server_name, and then use the client well-known file to point clients to matrix.dreamnetwork.space for the actual requests. But it appears that matrix.dreamnetwork.space is your server_name, and thus no delegation is needed.
    • Note that Synapse will always serve a client well-known file if the public_baseurl option is set. However, you don't necessary need to route to it in your reverse proxy.
  • This is an issue tracker for bugs in Synapse. General support requests like this are best done in #synapse:matrix.org. I'd also recommend making an issue on the Element X iOS issue tracker for further discussion.

Closing since this is effectively a support request. But if it ends up being due to a bug in Synapse somewhere, please open a new issue and we'll take a look. Good luck!

@anoadragon453 anoadragon453 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants