element-android icon indicating copy to clipboard operation
element-android copied to clipboard

this is not a valid matrix server address

Open MeiRos opened this issue 4 years ago • 8 comments

Describe the bug

There is red text at settings -> general -> home server. Last line. Below is retry button. "this is not a valid matrix server address" I have no idea what is wrong. Pretty much everything is working. Except some voice call problems. Can't receive calls with some phones if the screen is closed. But that's different thing. If I hit the retry button, it does something and text comes back.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'settings, general, home server'
  2. See error

Expected behavior

It would be nice to know what is wrong. We need a better error description.

Smartphone (please complete the following information):

  • Device: Samsung S10+
  • OS: Android 11

Additional context

  • Element 1.1.6 - F-Droid
  • Homeserver installed with this guide. spantaleev/matrix-docker-ansible-deploy

MeiRos avatar Apr 30 '21 18:04 MeiRos

Strange that the request does not works the first time and work the second. This request is using the federation API. Is the federation activated on your homeserver?

Also can you provide the url of your homeserver, or a screenshot of this screen, thanks

bmarty avatar Apr 30 '21 19:04 bmarty

I haven't disabled the federation. This is how the federation tester sees it. Screenshot_20210430-230053_Brave

Here's the error. Screenshot_20210430-230455_Element

What do you mean about not working first and then working? If it's about after hitting retry, the error text is the text which comeback back.

MeiRos avatar Apr 30 '21 20:04 MeiRos

Ok, I see.

Can you try to run the following command in a console, and see what happens?

curl -X GET 'https://<HOMESERVER>/_matrix/federation/v1/version'

(replace <HOMESERVER> by your homeserver base url of course)

For instance on matrix.org we get:

curl -X GET 'https://matrix.org/_matrix/federation/v1/version'
{"server":{"name":"Synapse","version":"1.33.0rc1 (b=matrix-org-hotfixes,696e7df2e)"}}

bmarty avatar May 01 '21 06:05 bmarty

If I use just domain.name

<html>                                                                          <head><title>404 Not Found</title></head>                                       <body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

With matrix.domain.name I get

<html>
  <head><title>404 - No Such Resource</title></head>
  <body>
    <h1>No Such Resource</h1>
    <p>Sorry. No luck finding that resource.</p>
  </body>
</html>

MeiRos avatar May 01 '21 19:05 MeiRos

This issue still exists, just came across it today.

DC7IA avatar Mar 17 '22 22:03 DC7IA

I'm seeing this issue, but at a different location: some room -> settings -> advanced -> room addresses -> local addresses, and my homeserver is dendrite 0.7.0 if that makes a difference.

NickCao avatar Mar 26 '22 07:03 NickCao

Does any of you affected by this issue have the homeserver's federation listener on different port than client listener? I do, and it seems that Element doesn't respect the custom port set in https://domain.tld/.well-known/matrix/server for those requests, which also happen when I'm trying to log in using domain.tld, not actual server URL (matrix.domain.tld).

Curling https://<HOMESERVER>:federationport/_matrix/federation/v1/version gives me correct response, while the same request to port 443 (where client listener is, in my case) gives me a 404 as expected.

rom4nik avatar Jun 03 '22 23:06 rom4nik

Poking around codebase leads me to believe that this is the culprit:

https://github.com/vector-im/element-android/blob/166d2a3ba0a5729a721ca74ae9fc34e4e953b239/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/federation/FederationModule.kt#L42

https://github.com/vector-im/element-android/blob/166d2a3ba0a5729a721ca74ae9fc34e4e953b239/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SessionParams.kt#L58-L62

rom4nik avatar Jun 04 '22 00:06 rom4nik