question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORS Errors when trying to talk to homeserver on Element Desktop

See original GitHub issue

Description

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
darnircommented, Sep 1, 2021

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:

@darnir https://github.com/darnir, can you still see this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vector-im/element-web/issues/18248#issuecomment-909414018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMVJNPMREPWNZ2Q53JSVMDT7UCT3ANCNFSM5BBBSZCA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

1reaction
darnircommented, Nov 1, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Cannot reach homeserver" after homeserver restart #15241
Workaround: deleting .config/Element solves the problem. Steps to reproduce. Connect to a homeserver with Element-desktop; Have the homeserver ...
Read more >
Frequently Asked Quest... - Element Knowledge
Frequently Asked Questions · Can spaces be deleted? · How do I enable guest users in a room? · How do I link...
Read more >
[HELP/BUG] "Homeserver URL does not appear to be a valid ...
I just can't choose my homeserver on the login page, it only says "Homeserver URL does not appear to be a valid Matrix...
Read more >
Fix CORS Error Permanently Regardless of Your Web App
By the end of this section, you'll know how to get rid of the ugly CORS error permanently no matter what type of...
Read more >
This Week in Matrix 2022-08-12 - Matrix.org
Synapse is a Matrix homeserver implementation developed by the matrix.org core team ... Come talk with us in #element-android:matrix.org!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found