Server must be using .well-known to be discovered
Steps to reproduce
- Open the app for the first time
- Try to set up an account on not-matrix.org
- Enter server domain name
- No error or feedback
- Set up .well-known/matrix/client
- Update the server name field
- Results!
Outcome
What did you expect?
Either an error or something to suggest that my chosen server name might not work
What happened instead?
Your phone model
No response
Operating system version
No response
Application version and app store
No response
Homeserver
No response
Will you send logs?
No
Are you willing to provide a PR?
No
~I have the same issue. I use traefik and I can't serve .well-known~
Nevermind it's ok using serve_server_wellknown: true
hello, I have the same problem
I use Docker with Synapse 1.116 Image is matrixdotorg/synapse:latest
I have an Nginx proxy manager for the domain that does SSL/https
in the homeserver.yml it says x_forwarded: true
when I call the domain in the browser it says: It works! Synapse is running
I can log in normally in the Windows app for Elements and get no .well-known error, when I try with the Android app I get a .well-known error
when I try with the Element X app I can log in just fine
so I rule out a server issue otherwise I would have the same error in Windows as I did in the Element X app
I only noticed the error because my wife got a new phone and I had to log in to the server again, everything was fine on my phone until I logged out to test and before that there were no .well-known errors either but now there is
when I look in the docker log it says
2024-10-11 11:51:18,331 - synapse.access.http.8008 - 473 - INFO - GET-7 - 0.0.0.0 - 8008 - {None} Processed request: 0.001sec/0.000sec (0.001sec, 0.000sec) (0.000sec/0.000sec/0) 61B 404 "GET /.well-known/matrix/client HTTP/1.1" "Element/1.6.20 (samsung SM-S918B; Android 14; UP1A.231 005.007.S918BXXS6CXGA; Flavor GooglePlay; MatrixAndroidSdk2 1.6.20)" [0 dbevts] how can I fix this
I fixed it, I found a post on Reddit
I had to enter this in my homeserver YAML public_baseurl: https://your matrix domain matrix_synapse_federation_enabled: true
this allowed me to log in again with the elements app
on the https://federationtester.matrix.org/api/report?server_name=your main domain not the matrix domain
this allows you to test your server to see if it accepts the well known function
@TheMockTv I am seeing the problem even with the settings you mentioned. I can see "GET /.well-known/matrix/client HTTP/1.1" in my httpd logs and when I visit that URL in a browser, it returns the correct and expected JSON. I am able to log in fine with other clients. It is only the Android app that gives me an error.
The federation tester shows my server to be working normally.
Any ideas?
@TheMockTv I am seeing the problem even with the settings you mentioned. I can see
"GET /.well-known/matrix/client HTTP/1.1"in my httpd logs and when I visit that URL in a browser, it returns the correct and expected JSON. I am able to log in fine with other clients. It is only the Android app that gives me an error.The federation tester shows my server to be working normally.
Any ideas?
Could you add the contents of that file, redacted, if you want? Maybe there's something in the format or the fields that the SDK believes is invalid and discards the whole config.
@snex
Hi,
Before we can help you, please share more details about your setup:
Are you using Docker or a direct installation?
Do you have a reverse proxy in front (e.g., Nginx, Traefik)?
Which domains are you using (please anonymize them, e.g., matrix.example.org)?
Share the relevant part of your homeserver.yaml – without passwords, secrets, or API keys.
Show the responses from your /.well-known/matrix/client and /.well-known/matrix/server endpoints.
If you have a proxy config, please include the relevant location blocks (no private info).
Important: YAML is very sensitive to indentation and syntax. Even a single incorrect space or wrong indentation can cause Synapse to fail or block connections.
With this information, we can better diagnose if the issue is related to your configuration.
Thanks!
I figured the problem out.. the JSON I was returning in response to the .well-known/matrix/client request was
{
"base_url": "https://some.server"
}
This used to work and seems to work on some clients, but the android client will only work in this format:
{
"m.homeserver":
{
"base_url": "https://some.server"
}
}
I'm closing this since the issue is pretty old and new issues with the same behaviour should be reported separately so they're easier to track.