Docs Offline Broken: Drive service worker is failing to fetch offline extension content |
|||||||||||||||||||
Issue descriptionChrome Version : 72.0.3599.0 URLs (if applicable) : drive.google.com OS version : 10.13.6 Behavior in Safari (if applicable): Behavior in Firefox (if applicable): What steps will reproduce the problem? (1) Go to drive.google.com (2) Click on the gear to the right of the "search drive" input box and go to settings (3) Check the box for Offline (4) If prompted, install the offline extension and repeat step 3 (5) Wait a minute for offline to enable and for the drive service worker to register (6) Refresh the page and wait a few seconds What is the expected result? You should be presented with the drive homescreen and no offline promo. What happens instead? You will be prompted to install the extension or disable offline When we open up the network panel we see that the first request to the offline extensions page_embed.js script fails. If we unregister the drive service worker things work as expected. We tested this on Linux, ChromeOs and Mac and we were only able to repro on Mac with Chrome version 72.
,
Nov 2
Btw, I tested on Windows and it did not repro there. I believe this was tested on the Dev Channel (Stable is at Chrome 70, and Beta is at 71 right now). This repros on 72.
,
Nov 2
That is correct, I was only able to repro on Mac Os using chrome 72. I tried 69, 70 and 71 on Linux and Mac as well and all of those worked as expected.
,
Nov 2
i’ll try with the suggested flag and try to attach screenshots tomorrow.
,
Nov 3
Might be bug 899446 as it seemed to break Gmail with offline-enabled too.
,
Nov 4
,
Nov 4
Did not work with the network-service flag enabled. Screenshot below https://screenshot.googleplex.com/OkGqECbWBPO Not sure if related but the console also contained the following m=core:124 Uncaught qf {message: "Error in protected function: XMLHttpRequest is not defined", stack: "ReferenceError: XMLHttpRequest is not defined↵ …FB8gsw3Pl1snJq9-ssrH9kjsMB3-3cbrg/m=core:103:386)"} Also got the following, which is the failed get of the extension content GET chrome-extension://ghbmnnjooekpmoecnnnilnnbdlolhkhi/page_embed_script.js net::ERR_FAILED
,
Nov 4
Does work as expected when the network-service flag is disabled. https://screenshot.googleplex.com/JTfW4WwDcxZ I'll try with the Mac I tested in the office and with another user that had reported the issue early next week.
,
Nov 4
Since it seems related to network service, over to cduvall@ for triage. Clark, mind routing this? +jam@ FYI.
,
Nov 4
,
Nov 5
Over to shimazu@ as this looks related to service worker servicification.
,
Nov 5
In case it helps I was also able to repro on Linux after enabling the #network-service flag on Chrome 72.0.3595.2, I'm using Linux 4.17.0-3rodete2-amd64 #1 SMP Debian 4.17.17-1rodete2 (2018-08-28)
,
Nov 5
,
Nov 5
I can also repro on Linux using Chrome 70 if I enable the #network-service flag. We just had a few users on stable also saying they were having this issue, can you confirm what percentage of prod or corp this flag is enabled for and if possible can you roll back?
,
Nov 6
Thanks for routing this. I tried to repro but issue 843797 still consistently happens during investigation... I'm taking a bit of time to see it first since it's potentially related to the breakage.
,
Nov 6
,
Nov 6
Shimazu, While you're waiting on info/resolution of 843797 can you see if you can repro with the AccountConsistency flag off and the network-service flag on? We also wanted to know what percentage of users have the #network-service flag enabled on Chrome 70 and if it would be possible to disable it? Yesterday we had a Chrome 70 user on Linux reporting the issue and they had the #network-service flag set to default, disabling it addressed the issue so my guess is there's an ongoing rollout or experiment that he was in.
,
Nov 6
In case it helps below is a video of me reproducing on Chrome 70 with the #network-service flag enabled https://screencast.googleplex.com/cast/NjA2NjUzNDM5Mjc5MTA0MHw0MjcxMDJlMC00Ng If
,
Nov 6
Network service is enabled for 1% of users on M70 stable. cc dxie@ for question on whether we should disable the experiment.
,
Nov 6
below is a link to a har file with my network requests during one of the repros https://drive.google.com/file/d/1VKW_uAQy3geMheX6gxvto0BGDFGXS_wI
,
Nov 6
Can you also try reproducing with network-service disabled, and chrome://flags/#enable-service-worker-servicification enabled? The latter is turned on automatically with network service, but it's also at 1% of users (without network service). So if we need to turn off experiments, it might have to be both depending on the repro.
,
Nov 6
Works fine when I have network-service disabled and enable-service-worker-servicification enabled. Link to video below https://screencast.googleplex.com/cast/NDcxNjE0MjI2MjIyMjg0OHw3MTA5OTU2MC0yMg This was on Mac OS 10.13.6 using Chrome 70.0.3538.77
,
Nov 6
this is also on Windows on M70.
,
Nov 6
On my windows machine when tried to reproduce the issue observing below behavior : Prerequisite : Should have enabled "Enable Network Service" flag from chrome://flags. What steps will reproduce the problem? (1) Go to drive.google.com on Chrome Canary. (2) Click on the gear to the right of the "search drive" input box and go to settings (3) Check the box for Offline Observed behavior : After step3,"Extension Needed -- To turn on offline access, install the Google Docs Offline extension to your Chrome browser" dialog. click on [install] redirected to Chrome webstore which claims the extension is already installed on my machine.
,
Nov 6
pbommana@, That's a manifestation of the same issue, essentially the network-service flag breaks our ability to determine that the extension is installed.
,
Nov 6
Is there a way to get a list of all the flags that are currently enabled in Chrome? From chrome://flags we can't tell which of the ones set to Default are enabled.
,
Nov 6
I would try to do about://crashes then go to crash/<crashid> Under fields tab, you will see experiments, that will list a set of experiments you belong to.
,
Nov 6
(FYI We have turned off network service experiment on stable)
,
Nov 7
Turned off dcheck_always_on and tried it. I could repro and could confirm the request to page_embed_script.js is failing due to a failure of fetch(page_embed_script.js) in a service worker. The error code is net::ERR_UNKNOWN_URL_SCHEME, so probably the URLLoaderFactoryBundle owned by the service worker doesn't have an URLLoaderFactory for 'chrome-extension:'. I'm still investigating it.
,
Nov 7
Let me add a components.
,
Nov 7
,
Nov 7
Fetching chrome-extension URLs should have been added in issue 848628
,
Nov 7
Probably I understand it. SetupOnUIThread() in embedded_worker_instance.cc creates URLLoaderFactoryBundle, but it checks SchemeIsHTTPOrHTTPS(). Probably it was only for the URLLoaderFactoryBundle for script loading because a script from https cannot import scripts from chrome-extensions, but it's now applied for all bundles including the one used for fetch(). I could confirm docs offline works once the flag is always set to true. I'll make a CL.
,
Nov 7
Created a CL: https://crrev.com/c/1322258
,
Nov 7
this bug is needed for M71 beta since it breaks a few users who are running network service and needs to use offline gmail.
,
Nov 7
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b8a7f58fe3ca4cc1930f709c24baeafeb82c2170 commit b8a7f58fe3ca4cc1930f709c24baeafeb82c2170 Author: Makoto Shimazu <shimazu@chromium.org> Date: Wed Nov 07 19:09:31 2018 Create non-network factories for subresource loads from a service worker Previously we skipped to create non-network factories for subresource loading from a service worker as a performance optimization. It works on S13nServiceWorker because extensions are handled by a resource dispatcher host. However, NetworkService doesn't work well because those requests need to be routed to extensions before going to the NetworkService. This CL fixes by always creating non-network factories for subresource loads. Bug: 901443 Change-Id: Ia932dc11352c14be9f33c9e3448891cf66d699e0 Reviewed-on: https://chromium-review.googlesource.com/c/1322258 Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Commit-Queue: John Abd-El-Malek <jam@chromium.org> Cr-Commit-Position: refs/heads/master@{#606099} [modify] https://crrev.com/b8a7f58fe3ca4cc1930f709c24baeafeb82c2170/chrome/browser/chrome_do_not_track_browsertest.cc [modify] https://crrev.com/b8a7f58fe3ca4cc1930f709c24baeafeb82c2170/chrome/browser/extensions/fetch_apitest.cc [modify] https://crrev.com/b8a7f58fe3ca4cc1930f709c24baeafeb82c2170/chrome/test/data/workers/fetch_from_service_worker.html [modify] https://crrev.com/b8a7f58fe3ca4cc1930f709c24baeafeb82c2170/chrome/test/data/workers/fetch_from_service_worker.js [modify] https://crrev.com/b8a7f58fe3ca4cc1930f709c24baeafeb82c2170/content/browser/service_worker/embedded_worker_instance.cc
,
Nov 7
I see that https://crrev.com/c/1322258 was merged. Any idea on when it would be available in the prod/dev/canary builds?
,
Nov 7
Pls update bug with canary result tomorrow and request a merge to M71. Pls note we won't block this week beta for this, we will take the fix in for next week beta.
,
Nov 8
re c#38: Canary with the fix will be released tomorrow, and after we confirm it's fixed and no regression happens, I (or dxie or jam) will merge it soon to beta (M71). The new beta including the fix will be released next week. As Daniel said at c#28, NetworkService is now disabled on M70 so this bug doesn't affect users on stable.
,
Nov 8
The NextAction date has arrived: 2018-11-08
,
Nov 9
How is the change looking in canary? If change looks good in canary, pls request a merge to M71. Thank you.
,
Nov 12
Sorry for late. The bug was properly fixed in canary and so far I couldn't see any new crashes. Let me request a merge to M71.
,
Nov 12
This bug requires manual review: M71 has already been promoted to the beta branch, so this requires manual review Please contact the milestone owner if you have questions. Owners: benmason@(Android), kariahda@(iOS), kbleicher@(ChromeOS), govind@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 12
Approving merge to M71 branch 3578 based on comment #43. Please merge ASAP and mark bug as fixed after the merge. Thank you.
,
Nov 12
,
Nov 12
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1baf1b8f831c46e7f670e633518a8e42b80d77a3 commit 1baf1b8f831c46e7f670e633518a8e42b80d77a3 Author: Makoto Shimazu <shimazu@chromium.org> Date: Mon Nov 12 06:38:07 2018 [M71] Create non-network factories for subresource loads from a service worker Previously we skipped to create non-network factories for subresource loading from a service worker as a performance optimization. It works on S13nServiceWorker because extensions are handled by a resource dispatcher host. However, NetworkService doesn't work well because those requests need to be routed to extensions before going to the NetworkService. This CL fixes by always creating non-network factories for subresource loads. Bug: 901443 Change-Id: Ia932dc11352c14be9f33c9e3448891cf66d699e0 Reviewed-on: https://chromium-review.googlesource.com/c/1322258 Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Commit-Queue: John Abd-El-Malek <jam@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#606099}(cherry picked from commit b8a7f58fe3ca4cc1930f709c24baeafeb82c2170) Reviewed-on: https://chromium-review.googlesource.com/c/1331100 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Cr-Commit-Position: refs/branch-heads/3578@{#631} Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034} [modify] https://crrev.com/1baf1b8f831c46e7f670e633518a8e42b80d77a3/chrome/browser/chrome_do_not_track_browsertest.cc [modify] https://crrev.com/1baf1b8f831c46e7f670e633518a8e42b80d77a3/chrome/browser/extensions/fetch_apitest.cc [modify] https://crrev.com/1baf1b8f831c46e7f670e633518a8e42b80d77a3/chrome/test/data/workers/fetch_from_service_worker.html [modify] https://crrev.com/1baf1b8f831c46e7f670e633518a8e42b80d77a3/chrome/test/data/workers/fetch_from_service_worker.js [modify] https://crrev.com/1baf1b8f831c46e7f670e633518a8e42b80d77a3/content/browser/service_worker/embedded_worker_instance.cc
,
Nov 12
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1baf1b8f831c46e7f670e633518a8e42b80d77a3 Commit: 1baf1b8f831c46e7f670e633518a8e42b80d77a3 Author: shimazu@chromium.org Commiter: shimazu@chromium.org Date: 2018-11-12 06:38:07 +0000 UTC [M71] Create non-network factories for subresource loads from a service worker Previously we skipped to create non-network factories for subresource loading from a service worker as a performance optimization. It works on S13nServiceWorker because extensions are handled by a resource dispatcher host. However, NetworkService doesn't work well because those requests need to be routed to extensions before going to the NetworkService. This CL fixes by always creating non-network factories for subresource loads. Bug: 901443 Change-Id: Ia932dc11352c14be9f33c9e3448891cf66d699e0 Reviewed-on: https://chromium-review.googlesource.com/c/1322258 Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Commit-Queue: John Abd-El-Malek <jam@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#606099}(cherry picked from commit b8a7f58fe3ca4cc1930f709c24baeafeb82c2170) Reviewed-on: https://chromium-review.googlesource.com/c/1331100 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Cr-Commit-Position: refs/branch-heads/3578@{#631} Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}
,
Nov 12
I'm still getting the same issue on M71 3578 when i enable the #network-service flag on Linux (didn't get to try on Mac OS yet). Is there a separate flag I need to enable for the fix? Using: Version 71.0.3578.44 (Official Build) beta (64-bit) screenshot below https://screenshot.googleplex.com/py0UD527zFC
,
Nov 12
thank you for verifying the change but the fix isn't in .44. It should go out in the next Beta release. In the meantime, you can also check on a M72 Canary build.
,
Nov 12
I tried using Canary (Version 72.0.3602.2) with the #network-service flag enabled and I'm still seeing the issue there as well. I see the failed fetch for page_embed_script.js anytime I try to enable offline and I'm prompted to install the extension. https://screenshot.googleplex.com/s01y6X4w3jb Video link below, repro in monitor on the right on M72 https://screencast.googleplex.com/cast/NjA0OTQ4OTU0NjY0MTQwOHw1ZmY3Yzg4NC1lMQ unfortunately had to do a fullscreen grab from chrome stable since the screencast extension is crashing on canary.
,
Nov 13
I think it's Dev channel. We have four channel: Stable (latest - 2), Beta (latest - 1), Dev (latest, weekly) and Canary (latest, daily). The fix was in 72.0.3605.0 and you can try it on Win and Mac. Linux doesn't have canary channel.
,
Nov 13
Note that 71.0.3578.50 or later also has the fix.
,
Nov 13
Thanks for the clarification. Looks good for me on the Mac dev and canary build channels (though both are pointing to M72). |
|||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||
Comment 1 by rdevlin....@chromium.org
, Nov 2