CORS Errors when trying to talk to homeserver on Element Desktop
See original GitHub issueDescription
On Element Desktop, I cannot communicate with my homeserver https://talk.go7box.xyz. It consistently complains about connection errors. However, from the same machine, I can use Element Web, nheko, fractal, Wget and curl to login and communicate with the homeserver without any troubles. Element Desktop is the only client that is unable to talk to the homeserver.
Steps to reproduce
- Start Element Desktop
- Change Homeserver to “talk.go7box.xyz”
- Try to Login
This should log the user in successfully. However, it throws an error instead:
There was a problem communicating with the homeserver, please try again later.
I don’t have such an issue on my Element Android that is running on the same network. So I tried using nheko, fractal and Matrix Shell Suite. All of them could successfully login and send messages. Some on #element-web:matrix.org asked me to try with Element Web. So I ran Element Web on Firefox and even from there, I could log in successfully. Only on Element Desktop do I have this issue.
Next, in order to debug, I took a look at the network activity. The only difference I could see was that Element Web sends a:
origin: app.element.io header whereas Element Desktop sends a origin: vector://vector header. On Element Desktop I also see a lot of errors in the console complaining that the CORS request had been rejected. I copied the failing POST request as cURL and ran it on the command line. That also succeeded without any issues. I received back a 200 response with a access_token in the JSON.
So, literally only Element Desktop is unable to communicate with the server. The exact same HTTP request when sent via Curl works just fine.
Logs being sent: Can’t
Version information
-
Homeserver: Synapse 1.38.1
-
Platform: Desktop
For the desktop app:
- OS: Arch Linux
- Version: 1.7.33
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:18 (12 by maintainers)

Top Related StackOverflow Question
I’m going to upgrade synapse tonight and try it again. I should get back to you within 24 hours with something.
On Tue, Aug 31, 2021, at 18:56, Šimon Brandner wrote:
The issue seems to have disappeared entirely on its own. I haven’t changed anything, but I don’t see it anymore. So I’m going to close this issue. Thanks everyone that tried to help. If something shows up again, I’ll re-open here