Closed
Bug 1479209
Opened 7 years ago
Closed 6 years ago
Frequently getting "You're offline" when performing Google searches
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox63+ fixed)
RESOLVED
FIXED
Firefox 63
People
(Reporter: marcia, Assigned: wisniewskit)
References
(Depends on 1 open bug)
Details
(Whiteboard: [webcompat:p1])
Attachments
(4 files)
While using the latest nightly on my Pixel 2 running Android P (now Friday's build), I have been received the attached screenshot.
STR:
1. Type a Google search in the URL bar or in Google search bar on a page
2. Receive the attached screenshot
I am definitely not offline, as I can surf websites using other browsers as well as loading other websites on the same nightly. It seems I only get the message when performing a Google search for now.
Reporter | ||
Comment 1•7 years ago
|
||
Still getting this in the latest nightly. Will look in the console for errors.
OS: Unspecified → Android
Comment 3•7 years ago
|
||
We're seeing lots of reports here on webcompat.com, but sadly, I am unable to reproduce... For context: This is probably related to an experiment we're running right now (see bug 1453691) where we spoof as Chrome in Fennec Nightly to discover breakage with Google's Tier 1 experience.
I'd like to debug this, but as I am not able to reproduce, this is hard... Marcia, can you also reproduce after clearing caches and cookies? Can you try in a private tab? Do you see any console errors?
Tom, do you have any idea what may cause this?
Flags: needinfo?(mozillamarcia.knous)
Whiteboard: [webcompat]
Updated•7 years ago
|
See Also: → https://webcompat.com/issues/17919
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Comment 5•7 years ago
|
||
I wonder if it's related to any ServiceWorkers... some users of my Google Search Fixer addon have had weird issues due to Google's ServiceWorker having webcompat issues, but they were not related to them "being offline".
However, I don't see any ServiceWorkers in about:serviceworkers, and this issue isn't reproducing for me. Perhaps there's some A/B test going on at Google, and others do have a ServiceWorker installed that's causing issues?
Flags: needinfo?(twisniewski)
Updated•7 years ago
|
Updated•7 years ago
|
Comment 6•7 years ago
|
||
(In reply to Dennis Schubert [:denschub] from comment #3)
> Marcia, can you also reproduce after clearing caches and cookies? Can you
> try in a private tab? Do you see any console errors?
Also, marcia, do you see any service workers related to google.com in about:serviceworkers, and if so, take a screenshot?
Comment 7•7 years ago
|
||
Also, do you have any addons installed in Fennec Nightly?
Comment 9•7 years ago
|
||
(In reply to Pascal Chevrel:pascalc from comment #8)
> Tracking for 63
Note: this is a Nightly-only experiment.
Comment 10•7 years ago
|
||
(In reply to Mike Taylor [:miketaylr] (62 Regression Engineering Owner) from comment #9)
> (In reply to Pascal Chevrel:pascalc from comment #8)
> > Tracking for 63
>
> Note: this is a Nightly-only experiment.
Are you sure that the experiment is the cause of the bug?
Comment 11•7 years ago
|
||
(In reply to Pascal Chevrel:pascalc from comment #10)
> (In reply to Mike Taylor [:miketaylr] (62 Regression Engineering Owner) from
> comment #9)
> > (In reply to Pascal Chevrel:pascalc from comment #8)
> > > Tracking for 63
> >
> > Note: this is a Nightly-only experiment.
>
> Are you sure that the experiment is the cause of the bug?
Not 100% certain, but all the reports we have are on Nightly, so it seems likely "pretending to be Chrome to get the nice version of web search" is related. But who knows. :)
Comment 12•7 years ago
|
||
I also run into this frequently and unregistering the service worker for google.com fixed it.
Comment 13•7 years ago
|
||
That's good to know, thanks evilpie. Do you find that you have to repeatedly remove the worker, or was once enough?
I wonder if there is a reliable way for our addon to unregister the serviceworker if it's detected...
Flags: needinfo?(evilpies)
Comment 14•7 years ago
|
||
It's probably to easy to tell, but a handful so far seem to be working fine.
Flags: needinfo?(evilpies)
Comment 15•7 years ago
|
||
Eh, I meant s/to easy/too soon/ of course.
Comment 16•7 years ago
|
||
Strange fact: fennec is telling me service workers are not enabled, and I have none registered. But in fact, I do have some registered -- and I can see dom.serviceWorkers.enabled is true in about:config
https://searchfox.org/mozilla-central/source/toolkit/content/aboutServiceWorkers.js#19-25
Comment 17•7 years ago
|
||
I see the same message in about:serviceworkers as MikeT in comment 16, but then it lists serviceworkers regardless so I think that's a UI bug.
That said, there might be a bug regardless, as I have the Google search serviceworker installed on release Fennec on my phone, but when I load up a search page and call "navigator.serviceWorker.getRegistrtation().then(function(worker) { console.log(worker) })" it shows "undefined" (no registered workers).
Comment 18•7 years ago
|
||
(In reply to Mike Taylor [:miketaylr] (62 Regression Engineering Owner) from comment #16)
> Created attachment 8996363 [details]
> about:serviceworkers
>
> Strange fact: fennec is telling me service workers are not enabled, and I
> have none registered. But in fact, I do have some registered -- and I can
> see dom.serviceWorkers.enabled is true in about:config
>
> https://searchfox.org/mozilla-central/source/toolkit/content/
> aboutServiceWorkers.js#19-25
Bug 1354779.
Comment 19•7 years ago
|
||
Thinking about this from the angle that we changed something related to ServiceWorker that left some people in a confused state (which is solved by a hard refresh)...
Boris, I see https://hg.mozilla.org/mozilla-central/rev/1c52d8baf789 landed a few days ago. Can you think of any scenario related to this that might cause a google.com service worker to think the user was offline (until they hard-refreshed)?
Unfortunately nobody on our team has managed to get in a state to reproduce or observe error messages, so debugging is thus far guess-work.
Flags: needinfo?(bzbarsky)
![]() |
||
Comment 20•7 years ago
|
||
It's _possible_ that that patch could have weird effects if sandboxes are not in fact correctly holding on to their globals.
We could try backing that patch out and seeing whether the problem goes away, I guess.
Flags: needinfo?(bzbarsky)
Comment 21•7 years ago
|
||
I have been seeing this for a day now, I have a serviceworker enabled for google.com, and did a quick log of attempting a search
https://gist.github.com/daleharvey/b4ae9e39c89f2a08fc899466065edc0c
Comment 22•7 years ago
|
||
Few more logs but cant see anything obvious in there - https://gist.github.com/daleharvey/32bc0e1268dd0f25629b2545bf9ddfde
Comment 23•7 years ago
|
||
jchen just mentioned that he's running into this as well on Fennec nightly, but that things work fine in a private-browsing tab.
Reporter | ||
Comment 24•7 years ago
|
||
(In reply to Dennis Schubert [:denschub] from comment #3)
> We're seeing lots of reports here on webcompat.com, but sadly, I am unable
> to reproduce... For context: This is probably related to an experiment we're
> running right now (see bug 1453691) where we spoof as Chrome in Fennec
> Nightly to discover breakage with Google's Tier 1 experience.
>
> I'd like to debug this, but as I am not able to reproduce, this is hard...
> Marcia, can you also reproduce after clearing caches and cookies? Can you
> try in a private tab? Do you see any console errors?
>
> Tom, do you have any idea what may cause this?
My about:serviceworkers says "Service Workers are Not enabled"
After clearing cache and cookies the issue went away. But right before that I was in a persistent state of getting the offline message. I can attach my logcat if it useful (while the issue was present).
Flags: needinfo?(mozillamarcia.knous)
Comment 25•7 years ago
|
||
So...
Looks like Unregistering the google.com serviceworker makes the issue go away.
Tested on a OnePlus 5, Android 8.0.1 and Nightly 63.
Updated•7 years ago
|
See Also: → https://github.com/webcompat/web-bugs/issues/17997,
https://github.com/webcompat/web-bugs/issues/17998,
https://github.com/webcompat/web-bugs/issues/18027,
https://github.com/webcompat/web-bugs/issues/18029,
https://github.com/webcompat/web-bugs/issues/18030,
https://github.com/webcompat/web-bugs/issues/18000,
https://github.com/webcompat/web-bugs/issues/18002,
https://github.com/webcompat/web-bugs/issues/18001,
https://github.com/webcompat/web-bugs/issues/18004,
https://github.com/webcompat/web-bugs/issues/18006,
https://github.com/webcompat/web-bugs/issues/18007,
https://github.com/webcompat/web-bugs/issues/18008,
https://github.com/webcompat/web-bugs/issues/18009,
https://github.com/webcompat/web-bugs/issues/18010,
https://github.com/webcompat/web-bugs/issues/18011,
https://github.com/webcompat/web-bugs/issues/18012,
https://github.com/webcompat/web-bugs/issues/18013,
https://github.com/webcompat/web-bugs/issues/18014,
https://github.com/webcompat/web-bugs/issues/18015,
https://github.com/webcompat/web-bugs/issues/18016,
https://github.com/webcompat/web-bugs/issues/18019,
https://github.com/webcompat/web-bugs/issues/18018,
https://github.com/webcompat/web-bugs/issues/18022,
https://github.com/webcompat/web-bugs/issues/17999
Updated•7 years ago
|
Comment 26•7 years ago
|
||
(In reply to Marcia Knous [:marcia - needinfo? me] from comment #24)
> My about:serviceworkers says "Service Workers are Not enabled"
As mentioned above, you can't rely on that text on Android because of bug 1354779.
Comment 27•7 years ago
|
||
(In reply to Sergiu Logigan [:sergiu] from comment #25)
> Created attachment 8996615 [details]
> serviceworkers
>
> So...
> Looks like Unregistering the google.com serviceworker makes the issue go
> away.
>
> Tested on a OnePlus 5, Android 8.0.1 and Nightly 63.
Same here, removed the Service Workers registered on Google.com, and issue worked around, nightly from today, android 8.0.0 (XZ2 Compact)
Comment 28•7 years ago
|
||
(In reply to Sergiu Logigan [:sergiu] from comment #25)
> Created attachment 8996615 [details]
> serviceworkers
>
> So...
> Looks like Unregistering the google.com serviceworker makes the issue go
> away.
>
> Tested on a OnePlus 5, Android 8.0.1 and Nightly 63.
Tom, uh, could we somehow do a one-off "unregister the google serviceworker" hack here in the addon to fix currently busted instances? >_>
Flags: needinfo?(wisniewskit)
Comment 29•7 years ago
|
||
Hopefully? I'm investigating that approach now.
Flags: needinfo?(wisniewskit)
Comment 30•7 years ago
|
||
mythmon just tried an experiment with me, and ran this command in the remote devtools on his device on the google tab:
>navigator.serviceWorker.getRegistrations().then(regs => { for (const reg of regs) reg.update(); })
It didn't help, and neither did the same command using "unregister()" instead of "update()".
I'm not sure why it wouldn't help, given that unregistering the SW in about:serviceworkers fixes the problem for others. I've also tested that the commands should work, as they remove the SW installed by https://mdn.github.io/sw-test for me (unfortunately Google's SW isn't installing for me for whatever reason, so I can't test it there).
Comment 31•7 years ago
|
||
Dale, would you mind testing a long-shot theory for us? (assuming you are still experience this issue)
1) Disable our Google search experiment in about:config, by setting to false the pref extensions.gws-and-facebook-chrome-spoof.enabled
2) Do a Google search in another tab, and confirm that it is now showing the "old" Firefox Google search experience.
3) Refresh that tab with a long-press on the refresh button.
4) Re-enable our experiment again (flip the same pref in step 1 back to true).
5) Do a Google search again, confirm that the Chrome site experience is back.
6) Do another long-press refresh just in case.
7) Confirm whether the "you're offline" problem is gone.
Thanks in advance!
Flags: needinfo?(dharvey)
Comment 32•7 years ago
|
||
For the record, mythmon just tried the above steps in comment 31, and it looks like the Google serviceworker lingers and keeps the new Google search experience going even when our experiment is disabled.
Moreover, mythmon learned something interesting: attempts to unregister the serviceworker (as per comment 30) are never actually resolving or rejecting. There is also nothing interesting in the tab's web console or the main process console, and I'm not sure how to investigate such an issue.
baku, bkelly, any ideas on why a serviceworker's unregister promise might never complete? Is there something mythmon should try out here to help find out?
Flags: needinfo?(ben)
Flags: needinfo?(amarchesini)
Updated•7 years ago
|
Flags: needinfo?(mrbkap)
Flags: needinfo?(ben)
Flags: needinfo?(amarchesini)
Updated•7 years ago
|
Flags: webcompat+
Whiteboard: [webcompat] → [webcompat:p1]
Updated•7 years ago
|
Flags: needinfo?(mrbkap)
Comment 33•7 years ago
|
||
Miscleared the flag...
If unregister() and update() are not resolving then some kind of internal error is happening. It could be a corrupt profile or something causing the job queue to break.
Flags: needinfo?(mrbkap)
Comment 34•7 years ago
|
||
If I fetch the serviceworker URL from https://bugzilla.mozilla.org/attachment.cgi?id=8996615 via:
curl -H "Service-Worker: script" -A "Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/63.0 Firefox/63.0" "https://www.google.com/serviceworker?pwa=search&hl=en&gl=RO"
Or just also via desktop nightly, I get the following payload:
(function(){var a=self;a.skipWaiting();a.addEventListener("activate",function(b){b.waitUntil(a.clients.claim().then(function(){return a.registration.unregister()}))});}).call(this);
So indeed we'd expect this registration to clear itself up in general unless clients.claim() is broken or, as :bkelly suggests, the job queue is broken.
Comment 35•7 years ago
|
||
One thing to note, in Fennec Nightly, we're spoofing as Chrome Mobile (approximately), to get the good search experience:
https://searchfox.org/mozilla-central/source/mobile/android/extensions/gws-and-facebook-chrome-spoof/bootstrap.js#24
Comment 36•7 years ago
|
||
(In reply to Mike Taylor [:miketaylr] (62 Regression Engineering Owner) from comment #35)
> One thing to note, in Fennec Nightly, we're spoofing as Chrome Mobile
> (approximately), to get the good search experience:
Changing the user agent doesn't appear to change the service worker that gets returned.
Comment 37•7 years ago
|
||
Dale, Andreas, anyone, if you're still running into this problem, I'd like to test whether the following script fragment fixes it. You'd need to fire up the remote devtools and run this code in the main process:
> var gSWM = Cc["@mozilla.org/serviceworkers/manager;1"]
> .getService(Ci.nsIServiceWorkerManager);
> var regs = gSWM.getAllRegistrations();
> for (let i = 0; i < regs.length; ++i) {
> let info = regs.queryElementAt(i, Ci.nsIServiceWorkerRegistrationInfo);
> if (info.principal.origin.match(/^https?:\/\/(www|encrypted|maps)\.google\..*/)) {
> console.info("Updating ServiceWorker for", info.principal.origin);
> gSWM.propagateSoftUpdate(info.principal.originAttributes, info.scope);
> }
> }
With luck, it should be able to update the service worker, and the problem should go away. With a little less luck, re-running the fragment with the "propagateSoftUpdate" line replaced with this bit should at least work (by unregistering the worker entirely, and letting it reinstall upon your next Google search):
> let cb = {
> unregisterSucceeded() {
> console.log("Succeeded removing serviceworker for", info.principal.origin);
> },
> unregisterFailed() {
> console.log("Failed removing serviceworker for", info.principal.origin);
> },
> QueryInterface: ChromeUtils.generateQI([Ci.nsIServiceWorkerUnregisterCallback])
> };
> gSWM.propagateUnregister(info.principal, cb, info.scope);
This is basically the same code that about:serviceworkers runs, so if it doesn't work then I'm not sure what else we could try.
Flags: needinfo?(abovens)
Comment 38•7 years ago
|
||
(In reply to twisniewski from comment #37)
> Dale, Andreas, anyone, if you're still running into this problem, I'd like
> to test whether the following script fragment fixes it. You'd need to fire
> up the remote devtools and run this code in the main process:
>
> > var gSWM = Cc["@mozilla.org/serviceworkers/manager;1"]
> > .getService(Ci.nsIServiceWorkerManager);
> > var regs = gSWM.getAllRegistrations();
> > for (let i = 0; i < regs.length; ++i) {
> > let info = regs.queryElementAt(i, Ci.nsIServiceWorkerRegistrationInfo);
> > if (info.principal.origin.match(/^https?:\/\/(www|encrypted|maps)\.google\..*/)) {
> > console.info("Updating ServiceWorker for", info.principal.origin);
> > gSWM.propagateSoftUpdate(info.principal.originAttributes, info.scope);
> > }
> > }
I was experiencing the error, and ran this snippet; it did not fix my issues and I observed a service worker for Google search in about:serviceworkers.
> With luck, it should be able to update the service worker, and the problem
> should go away. With a little less luck, re-running the fragment with the
> "propagateSoftUpdate" line replaced with this bit should at least work (by
> unregistering the worker entirely, and letting it reinstall upon your next
> Google search):
>
> > let cb = {
> > unregisterSucceeded() {
> > console.log("Succeeded removing serviceworker for", info.principal.origin);
> > },
> > unregisterFailed() {
> > console.log("Failed removing serviceworker for", info.principal.origin);
> > },
> > QueryInterface: ChromeUtils.generateQI([Ci.nsIServiceWorkerUnregisterCallback])
> > };
> > gSWM.propagateUnregister(info.principal, cb, info.scope);
>
> This is basically the same code that about:serviceworkers runs, so if it
> doesn't work then I'm not sure what else we could try.
Modifying the script with this second bit successfully removed the service workers and resolved the issue for me.
Comment 39•7 years ago
|
||
Thanks a bunch, osmose! Based on that, here's a summary of what we've found out so far:
- updating the serviceworker does not help.
- unregistering it does help.
- the web APIs are unable to unregister the serviceworker (the promise never resolves/rejects).
- about:serviceworkers (or the equivalent code) can unregister the worker.
So based on this, we have a path forward here.
Mike, I could have our GWS system addon remove the serviceworker as it starts up (but only if it has not done so before, using an about:config option to record that fact).
That way, when the user restarts Firefox (presumably for the next nightly upgrade) it should do the trick. Does that sound good to you?
Flags: needinfo?(miket)
Flags: needinfo?(dharvey)
Flags: needinfo?(abovens)
Comment hidden (mozreview-request) |
Comment 42•7 years ago
|
||
rhelmer, this patch just updates our GWS/Facebook experiment Fennec system addon to clear the GWS service worker once on the next update (or if the user toggles the relevant about:config pref).
This is to mitigate the issue in this bug, where users have to manually remove the service worker or they cannot use GWS, as it presumes they're offline. It seems to be a temporary problem that is now resolved, but has still required some users to manually clear the worker.
Comment 43•7 years ago
|
||
mozreview-review |
Comment on attachment 8997484 [details]
Bug 1479209 - Update GWS experiment in bz1453691 to clear the GWS serviceworker.
https://reviewboard.mozilla.org/r/261232/#review268298
::: mobile/android/extensions/gws-and-facebook-chrome-spoof/bootstrap.js:92
(Diff revision 1)
> + console.info(ServiceWorkerFixNotice);
> + noticeShown = true;
> + }
> + let cb = {
> + unregisterSucceeded() { },
> + unregisterFailed() { },
Is it worth console-logging this, just to get diagnostic info on the off chance that it happens for QA or some user?
::: mobile/android/extensions/gws-and-facebook-chrome-spoof/bootstrap.js:128
(Diff revision 1)
> disable();
> };
>
> this.startup = () => {
> Services.prefs.addObserver(EnabledPref, checkIfEnabled);
> + Services.prefs.addObserver(ServiceWorkerFixPref, checkIfServiceWorkerFixNeeded);
Huh I thought observer objects required an `observe` function, but I see other code in-tree that does this so as long as it works that's cool.
Attachment #8997484 -
Flags: review?(rhelmer) → review+
Comment hidden (mozreview-request) |
Comment 45•7 years ago
|
||
Thanks for the quick review, rhelmer!
Requesting check-in.
Keywords: checkin-needed
Comment 46•7 years ago
|
||
(I clicked "Land commits" from treeherder, removing checkin-needed)
Keywords: checkin-needed
Comment 47•7 years ago
|
||
Pushed by mitaylor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/11996094e70c
Update GWS experiment in bz1453691 to clear the GWS serviceworker. r=rhelmer
Comment 48•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Comment 49•7 years ago
|
||
This does not fix the issue since the service worker is registered again once I visit https://google.com. It just allows to perform one search query until the offline message is shown again.
Flags: needinfo?(twisniewski)
Comment 50•7 years ago
|
||
Thanks for the report, Jovan! It could help a great deal if you might help us diagnose a potential lead: we think this is related to Google's service worker presuming that support is available for the ReadableStreams web standard.
Are you handy with the remote developer tools? It would be useful to confirm whether you see any interesting console messages while being told that you're offline on a Google Search tab. (If you're not sure how to use the remote devtools, but would like to, please hop onto the #webcompat Mozilla IRC channel and we'll try to step you through it ASAP).
If you're willing to at least try enabling our (very experimental) support for ReadableStreams, that might also help confirm if it's due to them not being enabled yet on Firefox. ReadableStreams can be enabled in about:config with the dom.streams.enabled setting (though I wouldn't recommend leaving them on as they're not really ready for general usage).
Status: RESOLVED → REOPENED
Flags: needinfo?(twisniewski)
Resolution: FIXED → ---
Comment 51•7 years ago
|
||
Google tells me that they've pushed a fix over the past 12 hours or so, and we've seen a corresponding decrease in the number of reports we're getting at webcompat.com, so I think we might be good now.
If anyone is still experiencing this issue, please let us know! Fixing it should just require un-registering the serviceworker one more time, which can be done through about:serviceworkers, or by resetting this about:config flag: extensions.gws-and-facebook-chrome-spoof.serviceworker-fix-applied (note that the flag should be immediately set back to true upon being reset).
Flags: needinfo?(mrbkap)
Comment 52•7 years ago
|
||
I also no longer can reproduce the issue.
Comment 53•7 years ago
|
||
I was able to reproduce the issue last night and on my first Google Search this morning (after comment 51 was posted), but when I tried another search a few minutes later, the issue had been resolved and my search was successful.
So if anyone's still hitting this, it's possible that a reload or a second attempt (or a few minutes' wait) will fix it. That seemed to be the case for me, at least.
Comment 55•6 years ago
|
||
OK, let's go ahead and close this -- reports have stopped coming in on webcompat.com. Thanks for everyone's help on this.
Updated•6 years ago
|
Status: REOPENED → RESOLVED
Closed: 7 years ago → 6 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Assignee: nobody → wisniewskit
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•