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

Registration for custom homeserver works on app.element.io but not the Android app

Open bonsairobo opened this issue 1 year ago • 8 comments

Steps to reproduce

  1. I confirmed that I can register new accounts on my custom homeserver from app.element.io.
  2. Then I tried the same from the Android app.
  3. I replaced "matrix.org" with my homeserver URL ("matrix.example.com", the same one I used on app.element.io).
  4. I get a pop-up saying "The application is not able to create an account on this homeserver. Do you want to signup using a web client?"
  5. I select "yes".
  6. I am sent to a browser with the URL "http://matrix.example.com/_matrix/static/client/register" and the response is:
{"errcode":"M_UNRECOGNIZED","error":"M_UNRECOGNIZED: Not Found"}

To be clear, I'm not certain that URL is actually what's being requested, because the URL bar is truncated and only shows: "http://matrix.example.com/_matrix/static/client/registe...". I'm not able to interact with this browser in any way to get the complete URL. I can't even rotate my phone to get a landscape UI.

Outcome

What did you expect?

I expected to be able to successfully register a new account.

What happened instead?

Failure.

Your phone model

Google Pixel 7

Operating system version

Android 14

Application version and app store

1.6.22 from Play Store

Homeserver

conduwuit 0.4.6

Will you send logs?

No

Are you willing to provide a PR?

Yes

bonsairobo avatar Nov 10 '24 23:11 bonsairobo

I am having the same issue.

Using conduwuit as homeserver, @bonsairobo what do you use?

ololiuhqui avatar Jan 20 '25 18:01 ololiuhqui

@ololiuhqui Yep, conduwuit as well.

bonsairobo avatar Jan 21 '25 02:01 bonsairobo

@bonsairobo

I tried with synapse as well, still no results..

Do you have some form of network filtering on? What does https://<your_istance>/_matrix/static/ shows you on the same phone where Element didn't work?

Could it be possible that the filtering is blocking just the registration part?

Even if that's the case it puzzles me up that at the same time login goes without issues..

Federation tester still shows everything is fine, and registration works from desktop clients.

This is fedding me up, I spent two days trying to set everything up.

ololiuhqui avatar Jan 21 '25 17:01 ololiuhqui

What does https://<your_istance>/_matrix/static/ shows you on the same phone where Element didn't work?

{"errcode":"M_UNRECOGNIZED","error":"M_UNRECOGNIZED: Not found"}

bonsairobo avatar Jan 21 '25 21:01 bonsairobo

What does https://<your_istance>/_matrix/static/ shows you on the same phone where Element didn't work?

{"errcode":"M_UNRECOGNIZED","error":"M_UNRECOGNIZED: Not found"}

Did you setup delegation? I have it enabled too.

# matrix
https://<my_istance>.cc {

## matrix client/server delegation
handle_path /.well-known/matrix/* {

    header Access-Control-Allow-Origin *

    ## `Content-Type: application/json` isn't required by the matrix spec
    ## but some browsers (firefox) and some other tooling might preview json 
    ## content prettier when they are made aware via Content-Type
    header Content-Type application/json

    respond /client `{ "m.homeserver": { "base_url": "https://matrix.<my_istance>.cc" } }`

    respond /server `{ "m.server": "matrix.<my_istance>.cc:443" }`

    ## return http/404 if nothing matches 
    respond 404
}

}

# Matrix synapse
https://matrix.<my_istance>.cc {
	reverse_proxy /_matrix/* :6167
}

If I visit: https://<my_istance>/_matrix/static/ I get nothing.

If I visit https://matrix.rhiannon.cc/_matrix/static/ I get:

Image

Maybe can be due to delegation? Do you have it set it up as well?

ololiuhqui avatar Jan 22 '25 12:01 ololiuhqui

I'm also getting issues in trying to participate in rooms of other istances.

homeserver.log is saying:

2025-01-23 15:34:30,018 - synapse.http.federation.matrix_federation_agent - 371 - INFO - federation_transaction_transmission_loop-211 - Failed to connect to matrix.dev.trustgrid.com:8448: User timeout caused connection failure.
                                                                                     2025-01-23 15:34:30,019 - synapse.http.matrixfederationclient - 810 - INFO - federation_transaction_transmission_loop-211 - {PUT-O-590} [matrix.dev.trustgrid.com] Request failed: PUT matrix-federation://matrix.dev.trustgrid.com/_matrix/federation/v1/send/1737478447644: TimeoutError('')                          

2025-01-23 15:34:33,221 - synapse.access.http.6167 - 508 - INFO - GET-4702 - <REDACTED>- 6167 - {None} Processed request: 0.000sec/0.001sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 1038B 200 "GET /_matrix/client/versions HTTP/1.1" "Element/1.6.24 (unknown TrebleDroid vanilla; Android 14; lineage_arm64_bvN-userdebug 14 UQ1A.240205.004 eng.crossg.20240217.114959 test-keys; Flavour FDroid; MatrixAndroidSdk2 1.6.24)" [0 dbevts] 

When trying to register a new user from Android.

Idk if it's relevant but looks like other people from other istances can't join rooms or spaces in mine:

MatrixError: [403] You are not invited to this room.

After following an invite.

ololiuhqui avatar Jan 23 '25 15:01 ololiuhqui

Solved thanks to https://github.com/element-hq/synapse/issues/17738.

Changing registration_requires_token to false solved it. I really really think there should be some specification somewhere that "not all clients support every type of registration", this would have saved me 2 days of troubleshooting.

@bonsairobo

ololiuhqui avatar Jan 24 '25 09:01 ololiuhqui

On the IOS app this manifests a little differently, a web browser appears with no warning when the "Register" button is pressed, and "No Resource Found" appears as a result of the web request. Giving my users a token and having them register on their phone would have been convenient.

WilliamSease avatar Feb 24 '25 04:02 WilliamSease