Firefox experiences Network Protocol Violation on Discourse based Websites

@sloxy, please wrap the code/logs in code blocks, not quotes. Add 3 backticks on their own line above and below the code:

```
code goes here
more code
code
```
3 Likes

I attempted to debug the service worker in FF by setting breakpoints in it to see if I could dig deeper.
I gave up after 2 straight hours.
Debugging service workers in Firefox is horribly broken…

1 Like

After some more testing, I am confident the issue I’m seeing is caused by the firefox extension ‘uMatrix’ just being enabled(even with clojureverse on whitelist).

In same session, have enabled & disabled the extension all the while loading google.com, then clojureverse.org

Without fail, I get that error everytime when uMatrix is enabled and never when it’s disabled.
i can also consistently repro it against https://elixirforum.com

@OvermindDL1 you mentioned you had disabled uMatrix and still got message? is this 100%? i’ve been enabling & disabling it in same session(no browser restart needed) and only get that message when uMatrix is enabled (never when it’s disabled)

4 Likes

I have uMatrix too and it still happens when I disable it entirely (both with that “Power” looking button in it, and when I disable the extension from the Firefox Extension List), every time I check back on this Page to see how the Bug is being treated I have to spam click the bookmark just to get here because of the Corrupted Content Issue.

1 Like

i’m stepping through the uMatrix extension now - it’s net code will get called regardless of that power button switch.

@GregoriusTech just to humour me, can you do the exact following:

  1. only have 1 firefox window with 2 tabs open (1 will be the ‘Add-Ons’ FF page, the other will be the tab we load pages in)
  2. in tab1, open the firefox add-ons page (about:addons)
    in tab2, open up google.com
  3. in tab1, ensure ‘uMatrix’ is enabled
    in tab2, go to whatever url causes issue (from here on, urlX)
  4. in tab1, disable uMatrix
    in tab2, go to google.com
  5. in tab2, go to urlX

does it load?
if yes, repeat steps 2 to 5 to confirm.

you can use clojureverse.org as urlX (issue happens with no login needed)

3 Likes

Interesting, it actually loads both that Site and meta.discourse when i disable uMatrix again. Now I’m confused as to why…

I wonder if it is for the same reason the whole Issue fixed itself on my own Discourse Site out of nowhere (without even updating Discourse since then), yet I still had it here on meta.

Maybe uMatrix updated in the meantime and that fixed a part of this Issue, but I dont get how my first uMatrix disabling Test (that also did the about:addons Stuff) did not fix the Issue when I did that a few weeks ago…

Well, right now it seems to be a pure uMatrix Issue, but a few weeks ago it wasn’t. You’re stepping through the whole code right now so I guess you will find something that can be fixed somehow to make it work again.

i’m not sure - just back from a rabbit hole. it may be either:
a) uMatrix
b) Firefox (uMatrix may be innocent - see https://github.com/gorhill/uMatrix/issues/912 which unearthed Chromium bug itself 801237 - chromium - An open-source project to help move the web forward. - Monorail)
d) the SSL setup for certain discourse sites that have multiple SANs (cloudflare?)
e) discourse service worker

here’s a screencast for ref for non windows/FF people(can safely be watched at 2x speed): umatrix discourse firefox - YouTube

debugging FF extension is pretty easy: go to about:debugging, then for uMatrix, select ‘debug’. accept prompts. set breakpoints etc. and visit something. haven’t seen anything obvious.

3 Likes

to add another data point: all those sites behave fine in Chrome with uMatrix.

edit:
added bug to FF: 1502606 - Failed to load . A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘Error: TypeError: NetworkError when attempting to fetch resource.’.
added bug to uMatrix: https://github.com/uBlockOrigin/uMatrix-issues/issues/79 which ended up being dupe of https://github.com/uBlockOrigin/uMatrix-issues/issues/72 which is set to be included in next release of uMatrix
uploaded video of new FF profile with just uMatrix add on installed: https://youtu.be/1ap_Fx3IK_8

edit2:
just tried the [1.3.15rc1] RC for uMatrix (https://github.com/gorhill/uMatrix/releases) and cannot repro issue. looks solved for me for now.

6 Likes

I guess I have to wait until uMatrix auto-updates the extension? It does auto-update, right? I really hope it does and I dont have to re-install it to get it, because that would mean that a lot of people with older versions of it would continue to get the same Issue.

Well, once the Update is out proper, and it works as described, I will come back and mark that Post as Solution.

Edit: Or not, I can wait regardless. :wink:

1 Like

No. That uMatrix extension might be a cause, but it’s not the only thing that is causing this.

2 Likes

I also managed to repro this issue by setting Firefox to use a SOCKS 4 proxy while the proxy service is off, so it’s impossible to load the page. I get the same corrupted content error. So one more point to:

7 Likes

Despite this not being our bug, I still feel our failure mode has regressed in the application for no real benefit.

I took steps now to only have fetch interception (where requests goes out via service worker) enabled only on Android which was the reason we built this in the first place.

Over the past 6 months or so this has generated way too much support so feel it is time to kill off the pain.

https://github.com/discourse/discourse/commit/f8305f53c787ad0b6cd865d56a7b8b0f77f9dcc2

5 Likes

yes, extensions, by default, are set to auto update.

from about:addons

image

entries with default value are not bolded in about:config

1 Like

Either that or just update Discourse which bypassed Firefox for this feature

1 Like

Yay it works now, and it wasn’t uMatrix that fixed it, because the first time I opened the Page it still errored (since it was the old Serviceworker from yesterday), but so far nothing broke after that, even after restarting Firefox just to make sure.

I guess this is safe to be marked as solved now, but since I got vetoed last time, I will leave it to the Moderators. :wink:

5 Likes