I can't login to any homeserver at all: "We couldn't reach this homeserver"
Steps to reproduce
- I download latest version from GitHub Releases
- Opened the app, click continue
- Why not matrix org, continue
Outcome
What did you expect?
Login and password prompt
What happened instead?
We couldn't reach this homeserver. Please check that you have entered the homeserver USL correctly. If the URL is correct, contact your homeserver administrator for further help.
No matter what homeserver I try to login, it always gives this error
Your phone model
POCO X5 Pro 5G
Operating system version
Android 14
Application version and app store
Element X 0.5.3
Homeserver
I tried a lot of homeserver, none worked, even matrix.org
Will you send logs?
Yes
Are you willing to provide a PR?
No
You have an invalid global HTTP proxy set on your phone according to those logs. Try disabling it
You have an invalid global HTTP proxy set on your phone according to those logs. Try disabling it
Umm? What proxy? I was connected to mobile data, no proxy is set up in Mobile APN settings. Now I'm connected to Wi-Fi. No proxy is set up in Wi-Fi network's settings. No VPNs are enabled. I also had AdAway installed, I disabled it, it didn't help, still getting same error. No issues with any other app, including Element (not x)
Specifically I'm talking about the :0 proxy here
Many others have had this same issue such that it's a reasonably well understood problem now:
2024-09-11T23:44:38.139385Z DEBUG elementx: Using global proxy |
2024-09-11T23:44:38.142840Z INFO matrix_sdk::http_client::native: Setting the proxy for the HTTP client proxy_url=":0" | crates/matrix-sdk/src/http_client/native.rs:176 | spans: build{homeserver=ServerNameOrHomeserverUrl("https://matrix.org")}
Specifically I'm talking about the
:0proxy here Many others have had this same issue such that it's a reasonably well understood problem now:2024-09-11T23:44:38.139385Z DEBUG elementx: Using global proxy | 2024-09-11T23:44:38.142840Z INFO matrix_sdk::http_client::native: Setting the proxy for the HTTP client proxy_url=":0" | crates/matrix-sdk/src/http_client/native.rs:176 | spans: build{homeserver=ServerNameOrHomeserverUrl("https://matrix.org")}
Oh, is it issue with my android settings or with element x app?
Probably your OS settings
Probably your OS settings
How do I disable that proxy?
I was connected to mobile data, no proxy is set up in Mobile APN settings. Now I'm connected to Wi-Fi. No proxy is set up in Wi-Fi network's settings. No VPNs are enabled. I also had AdAway installed, I disabled it, it didn't help
Probably your OS settings
Wait, doesn't ":0" mean "no proxy"?
Here's a discussion where several other users have had this issue beforehand https://matrix.to/#/!aCvOWKNDeXXpPgquKq:matrix.org/$omg7ZqwN8XJYoBjjUDGVtE0WMVTjij4gRn_ajJElwwE?via=nerdhouse.io&via=matrix.org&via=envs.net
can confirm this issues with SAMSUNG SM-N910T on Android 14 I believe it's not related to some proxy settings as I have not found nothing in logcat
can confirm this issues with SAMSUNG SM-N910T on Android 14 I believe it's not related to some proxy settings as I have not found nothing in logcat
open termux, enter "su" and execute commands:
settings delete global http_proxy
settings delete global global_http_proxy_host
settings delete global global_http_proxy_port
no root on that phone
that phone succesfully downloads well-known from my homeserver
not fixed, please reopen
@532910, can you try to do the same thing via adb shell from pc?
it was done from pc
@532910, maybe factory reset?...
no way
@532910, well ok i will reopen
- old element and all other apps works perfect
- element x successfully downloads well-known file from my home-server
@532910 @ImMALWARE The reason that Element X Android can download the well known is that it uses the Retrofit library to download this well known,
and here's the interesting thing:
That :0 proxy had an interesting behaviour, if set as the http proxy (for example, with adb shell settings put global http_proxy :0, I did this in an emulator), the system-wide ProxySelector will consider that we have no proxy, thus:
import java.net.ProxySelector
import java.net.URI
ProxySelector.getDefault().select(URI("http://example.com"))
# Returns a single entry [Proxy.NO_PROXY]
Retrofit uses OkHttp and by default inherits this system behaviour.
Rust isn't like that and will validate this proxy string, thus errored out.
I guess this should also applies to classic Element and other apps.
same problem, the home server works on other devices like linux and browser, and all other apps on the phone work fine, just the element x login doesn't work, neither in mobile internet, nor in wifi. pls consider fixing as the old app is not available anymore via google play.
my fix was to install the old app via f-droid.
mmh, some VPN or other firewall app was setting Android's HTTP proxy settings to ":0" which rust apparently considers an invalid proxy. So from the app's point of view nothing to be fixed, as it is debatable whether ":0" is a valid HTTP proxy entry (aka don't use any) or an invalid one (preventing connections).
The proper fix is to remove the HTTP value which could also cause problems for other applications besides EXA
The proper fix is to remove the HTTP value which could also cause problems for other applications besides EXA
No I don't think that this value would trip most other apps, as this :0 proxy also won't cause any problems in Element Android, as it's using OkHttp via Retrofit. See for example https://github.com/element-hq/element-x-android/issues/3447#issuecomment-2608921725
In some cases removing this value isn't possible as in https://github.com/element-hq/element-x-android/issues/3447#issuecomment-2604862012 and https://github.com/element-hq/element-x-android/issues/3447#issuecomment-2608920021
So from the app's point of view nothing to be fixed, as it is debatable whether ":0" is a valid HTTP proxy entry (aka don't use any) or an invalid one (preventing connections).
I have written technical details in https://github.com/element-hq/element-x-android/issues/3447#issuecomment-2841110041 but to reiterate: The :0 proxy would make system believe we have no proxy defined, therefore: At least in Android system it means "don't use any".
I had this exact issue and solved it, by adding this block to my nginx conf:
(this should be already part of it):
` listen 443 ssl http2; listen [::]:443;
listen 8448 ssl http2 default_server; listen [::]:8448 ssl http2 default_server;
server_name your.awesomematrixserver.com; `
and then this:
# Federation Discovery (.well-known for other servers) location = /.well-known/matrix/server { return 200 '{"m.server": "your.awesomematrixserver.com:8448"}'; default_type application/json; add_header Access-Control-Allow-Origin *; }
Hope that helps.
I guess this should also applies to classic Element and other apps.
classic Element works fine on that phone (where element x is unable to login)
I guess this should also applies to classic Element and other apps.
classic Element works fine on that phone (where element x is unable to login)
Have the same issue, can this be fixed on the client side or does the server configuration need to be adjusted?
I guess this should also applies to classic Element and other apps.
classic Element works fine on that phone (where element x is unable to login)
Have the same issue, can this be fixed on the client side or does the server configuration need to be adjusted?
The http proxy issue, which is the reason why this bug has been filed has been fixed. If you receive this error with EXA, you either have a very old synapse server (which does not support sliding sync), or your .well-known/client file is not set up correctly.
You might be able to work around misconfigured servers by directly entering the home server base url with a https://myhomeserver.com.
I guess this should also applies to classic Element and other apps.
classic Element works fine on that phone (where element x is unable to login)
Have the same issue, can this be fixed on the client side or does the server configuration need to be adjusted?
The http proxy issue, which is the reason why this bug has been filed has been fixed. If you receive this error with EXA, you either have a very old synapse server (which does not support sliding sync), or your .well-known/client file is not set up correctly.
You might be able to work around misconfigured servers by directly entering the home server base url with a https://myhomeserver.com.
Could you elaborate on the last part? When signing in manually, I should enter the account provider with a https prefix? This also doesn't work for me sadly
The server I'm trying to connect to is running 1.138.4 if I looked it up correctly.