New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 901443 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 12
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-11-08
OS: Linux , Windows , Mac
Pri: 1
Type: Bug

Blocked on:
issue 843797



Sign in to add a comment

Docs Offline Broken: Drive service worker is failing to fetch offline extension content

Project Member Reported by mcleane@google.com, Nov 2

Issue description

Chrome 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.



 
Does this repro on stable or beta?  Can you also try with chrome://flags/#network-service both enabled and disabled?
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.
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.
i’ll try with the suggested flag and try to attach screenshots tomorrow.
Might be  bug 899446  as it seemed to break Gmail with offline-enabled too.
Labels: Needs-Triage-M72
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


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.
Cc: devlin@chromium.org jam@chromium.org
Components: Platform>Extensions
Labels: Proj-Servicification
Owner: cduvall@chromium.org
Since it seems related to network service, over to cduvall@ for triage.  Clark, mind routing this?

+jam@ FYI.
Status: Assigned (was: Unconfirmed)
Cc: cduvall@chromium.org
Labels: Proj-Servicification-Stable
Owner: shimazu@chromium.org
Over to shimazu@ as this looks related to service worker servicification.
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)
Cc: mcleane@google.com
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?
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.
Blockedon: 843797
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.
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 
Cc: dxie@chromium.org
Components: Internals>Services>Network
Labels: OS-Linux OS-Windows
Network service is enabled for 1% of users on M70 stable.

cc dxie@ for question on whether we should disable the experiment.
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
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.
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
this is also on Windows on M70.
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. 

pbommana@,

That's a manifestation of the same issue, essentially the network-service flag breaks our ability to determine that the extension is installed.  
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.
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.
(FYI We have turned off network service experiment on stable)
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.
Components: Blink>ServiceWorker
Let me add a components.
Cc: falken@chromium.org

Comment 32 Deleted

Fetching chrome-extension URLs should have been added in   issue 848628 
Status: Started (was: Assigned)
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.
Created a CL: https://crrev.com/c/1322258
Labels: ReleaseBlock-Beta M-71
this bug is needed for M71 beta since it breaks a few users who are running network service and needs to use offline gmail.
Project Member

Comment 37 by bugdroid1@chromium.org, 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

I see that https://crrev.com/c/1322258 was merged.  Any idea on when it would be available in the prod/dev/canary builds?
NextAction: 2018-11-08
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.
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.
The NextAction date has arrived: 2018-11-08
How is the change looking in canary? If change looks good in canary, pls request a merge to M71. Thank you.
Labels: Merge-Request-71
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.
Project Member

Comment 44 by sheriffbot@chromium.org, Nov 12

Labels: -Merge-Request-71 Hotlist-Merge-Review Merge-Review-71
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
Labels: -Merge-Review-71 Merge-Approved-71
Approving merge to M71 branch 3578 based on comment #43. Please merge ASAP and mark bug as fixed after the merge. Thank you.
Status: Fixed (was: Started)
Project Member

Comment 47 by bugdroid1@chromium.org, Nov 12

Labels: -merge-approved-71 merge-merged-3578
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

Labels: Merge-Merged-71-3578
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}
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

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.
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.


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.
Note that 71.0.3578.50 or later also has the fix.
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