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

Sync failed because of TypeError: Failed to fetch #52

Open
bwindels opened this issue Aug 18, 2020 · 9 comments
Open

Sync failed because of TypeError: Failed to fetch #52

bwindels opened this issue Aug 18, 2020 · 9 comments
Labels
bug Something isn't working hard-to-reproduce

Comments

@bwindels
Copy link
Contributor

should have been converted to a ConnectionError?
This is in Chromium Version 83.0.4103.116 (Developer Build) Fedora Project (64-bit)

@bwindels bwindels added bug Something isn't working hard-to-reproduce labels Aug 18, 2020
@bwindels
Copy link
Contributor Author

fwiw, this is expected in the service worker and can show up in the logs like this.

@bwindels
Copy link
Contributor Author

I wonder if this can be caused by there being a network but CORS failing, (or even a non 2xx response?)

Seeing this:

The FetchEvent for "https://matrix.org/_matrix/client/r0/sync?since=...&timeout=30000&filter=..." resulted in a network error response: the promise was rejected.
sw.js:1 Uncaught (in promise) TypeError: Failed to fetch
matrix.org/_matrix/client/r0/sync?since=...&timeout=30000&filter=...:1 Failed to load resource: net::ERR_FAILED

@bwindels
Copy link
Contributor Author

bwindels commented Nov 26, 2020

Matthew saw this as well on Tuesday:
image

@bwindels
Copy link
Contributor Author

Wild ideas as to what could cause this that may or may not make sense:

  • Unlikely: some usage of request outside of HomeServerApi, like for downloading attachments is causing this, and somehow it ends up in the promise for sync.

We should test while being offline (simulated, real) and see if we can reproduce.

@luke2m
Copy link

luke2m commented Mar 5, 2021

I have this on iOS safari 14, it shows up in a green bar at the top of the screen. (Not sure if this helps or even is related)
Sync failed because of TypeError: null is not an object (evaluating 'this._roomEncryption.getEventIdsForMissingKey') will test on Linux tomorrow

@luke2m
Copy link

luke2m commented Mar 5, 2021

No issue on Gnome Web 3.38.2 and Chrome 88.0.4324.182 (Both on Arch Linux x86_64)

@bwindels
Copy link
Contributor Author

bwindels commented Mar 8, 2021

@luke2m You were hitting a bug that got introduced with 0.1.33 and fixed in 0.1.34

@bwindels
Copy link
Contributor Author

bwindels commented Mar 16, 2021

just ran into this again on chrome 88, the status bar in the app said Sync failed because of TypeError: Failed to fetch, and the logs showed the same:

{
          "s": 0,
          "d": 659,
          "v": {
            "t": "network",
            "url": "https://matrix.org/_matrix/client/r0/sync?since=m1881256857~1.1881256861_redacted&timeout=30000&filter=5",
            "method": "GET"
          },
          "l": 6,
          "e": {
            "stack": "TypeError: Failed to fetch",
            "name": "TypeError",
            "message": "Failed to fetch"
          }
        }

I'm not sure if the server actually went offline as the client had stopped syncing for at least 30 min

@bwindels
Copy link
Contributor Author

bwindels commented Apr 5, 2022

Just hit this, it happened just after the homeserver was restarted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hard-to-reproduce
Projects
None yet
Development

No branches or pull requests

2 participants