Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Failed to join room' dialog still shows 'CORS request rejected' on timeout #7526

Closed
uhoreg opened this issue Oct 20, 2018 · 13 comments
Closed
Assignees
Labels
P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@uhoreg
Copy link
Member

uhoreg commented Oct 20, 2018

which is not the most friendly error message, and they were all supposed to be eradicated. See https://matrix.to/#/!QtykxKocfZaZOUrTwp:matrix.org/$1540049084858VhyjG:fam-ribbers.com

@lampholder
Copy link
Member

I've added this to the first impressions project, but it's hard to know whether it really qualifies without knowing what triggers it.

Do we have any idea?

@turt2live turt2live self-assigned this Nov 7, 2018
@turt2live
Copy link
Member

I'm not able to reproduce this. Was it possibly a legitimate CORS error?

image

(although the error still isn't great)

@turt2live turt2live removed their assignment Nov 8, 2018
@turt2live
Copy link
Member

... and of course now I've managed to reproduce it. It happens at least when the connection is reset from under the client.

@ghost
Copy link

ghost commented Nov 26, 2018

I am able to reproduce and willing to help however I can.

@turt2live
Copy link
Member

Exact and specific steps including the error code would be hugely appreciated.

@ghost
Copy link

ghost commented Nov 26, 2018

Sure.

I was able to reproduce this with

Then either type /join #matrix:matrix.org or click on "Matrix HQ" from the Home screen.

When clicking on "Matrix HQ" from the Home screen I am able to see other people joining and leaving and typing messages.

Otherwise all that seems to happen is the "Joining room..." status and the spinning loading icon stay there.

In the console I see:

Number of consecutive failed sync requests: 1
Starting keep-alive
MatrixClient sync state => RECONNECTING
MatrixClient sync state => SYNCING
index.js:218 GET https://matrix.org/_matrix/client/r0/sync?filter=3&timeout=30000&since=s754346046_624149755_1352930_201555888_93339220_519487_13585874_10274235_24539 net::ERR_NETWORK_CHANGED
rageshake.js:99 /sync error Error: CORS request rejected: https://matrix.org/_matrix/client/r0/sync?filter=3&timeout=30000&since=s754346046_624149755_1352930_201555888_93339220_519487_13585874_10274235_24539
    at c (file:///usr/lib/riot/webapp/bundles/7d178a862b1d188cf096/bundle.js:23:48825)
    at XMLHttpRequest.o.onreadystatechange (file:///usr/lib/riot/webapp/bundles/7d178a862b1d188cf096/bundle.js:23:48351)
rageshake.js:99 Error: CORS request rejected: https://matrix.org/_matrix/client/r0/sync?filter=3&timeout=30000&since=s754346046_624149755_1352930_201555888_93339220_519487_13585874_10274235_24539
    at c (index.js:259)
    at XMLHttpRequest.o.onreadystatechange (index.js:242)
Number of consecutive failed sync requests: 1

it just loops over and over doing that.

@turt2live
Copy link
Member

ERR_NETWORK_CHANGED is not really something we can really do anything about, and it looks like your failing request is unrelated to joining a room.

The discussion about ERR_NETWORK_CHANGED is best held elsewhere (new issue if one doesn't already exist), however for the sake of providing a quick answer: if you're seeing it often, check your proxy settings, VPN software, and network connection stability. Sometimes VPN software can interfere with the connection and cause ERR_NETWORK_CHANGED errors due to rapidly trying to establish a connection with whatever endpoint. The same can apply on unstable networks where things like physical issues with the network and routing problems cause some operating systems to change between network devices rapidly.

@ghost
Copy link

ghost commented Nov 26, 2018

Right. I am on a VPN. I do agree that it's probably not related to why I am unable to join Matrix HQ. The VPN is OpenVPN and it's running on the router. All traffic goes into the VPN because of the VLAN that I am on - those routing decisions are made by the router. That setup has been working flawless for me for about 3 years now.

I should also mention every other room seems to work but #matrix

cause some operating systems to change between network devices rapidly

I am using ArchLinux with 4.19.4.a-1-hardened

@turt2live
Copy link
Member

Honestly this sounds like a great thing to discuss in #riot:matrix.org as it seems like a problem on your end, not so much with the client. I see that there's a related issue (#7745) which is probably the place to keep discussion about the top-level issue of not being able to join HQ for unknown reasons.

@ghost
Copy link

ghost commented Nov 26, 2018

So I ruled out the network errors as being related to this problem.

  • Direct connection (VLAN2) via Ethernet
  • VPN tunnel (VLAN3) via Ethernet
  • To nearest LTE tower via tethered phone
  • On a different computer

As soon as I tried with a different account it worked.

It turned out that the server still thought I was in the #matrix:matrix.org room. Other users would see my name in the members list despite me not actually being in that room. Ie not showing under "Rooms". I think I had joined it in the past and left.

@tulir made a suggestion that seemed to solve the issue for me, send a HTTP POST request to the server forcing a leave. Using the "room_id": "!QtykxKocfZaZOUrTwp:matrix.org" inspected from the raw source option and the access token from user settings I tried this curl command.

ie curl -XPOST 'https://matrix.org/_matrix/client/r0/rooms/!QtykxKocfZaZOUrTwp:matrix.org/leave' -H 'Authorization: Bearer <access token>'

It resulted in people in the room 'seeing me leave' and I was then able to rejoin.

turt2live added a commit to matrix-org/matrix-react-sdk that referenced this issue Nov 27, 2018
This isn't pretty, but it does address element-hq/element-web#7526

Tested with Chrome and Firefox to ensure the message is stable enough to parse.
@lampholder
Copy link
Member

Would I be right in saying then that:

  • Riot's local state was wrong (thinking the user was not in the room when they were)
  • Either:
    • Synapse doesn't handle a user's request to join a room they're already in well, or
    • Riot doesn't handle whatever error response Synapse provides to represent a user is trying to join a room they're already in

My guess would be that a 'clear cache and refresh' on the client would have fixed this, but (if Synapse is providing enough information at least) Riot should be able to recover from this.

@lampholder lampholder added the S-Major Severely degrades major functionality or product features, with no satisfactory workaround label Nov 30, 2018
@ghost
Copy link

ghost commented Nov 30, 2018

My guess would be that a 'clear cache and refresh' on the client would have fixed this, but (if Synapse is providing enough information at least) Riot should be able to recover from this.

I forgot to mention during my testing I was noticing this in the electron riot-desktop app. I tried it in my Firefox browser and that didn't fix it either. I also tried it in Firefox from a livecd. The issue was not fixed until I issued that curl command.

@turt2live
Copy link
Member

Fixed by matrix-org/matrix-react-sdk#2306 although the real fix would be #7785. We'll use #7785 to track the bad error experience in the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

3 participants