Service Worker Failures on ChromeOS (Startup Timeout / DETACH_STALLED_IN_STOPPING)

42 views
Skip to first unread message

Stefan Srnjakov

unread,
5:02 AM (15 hours ago) 5:02 AM
to Chromium Extensions

I’m running into a rare but recurring issue with my Chrome extension’s service worker and I’d like to get some feedback or insights.

Setup:

  • The extension uses a workaround to keep the service worker persistent and always active.

  • I have an offscreen script, and a content script on all pages, which communicate with the service worker using runtime messages.

  • The extension is mostly used on ChromeOS and deployed via GAC (Google Admin Console).

Problem:
Less than 1% of startups show problems where the service worker fails to activate. I’ve never been able to reproduce this myself, but I do see it in logs collected from chrome://serviceworker-internals. Importantly, the issue resolves itself if the user restarts their Chromebook, so it doesn’t appear to be user-specific.

Collected errors (longer loop that shows the extesnsion is trying to restart): 
Error: {"columnNumber":-1,"lineNumber":-1,"message":"ServiceWorker startup timed out. The worker was in startup phase: Script streaming.","sourceURL":""}
Error: {"columnNumber":-1,"lineNumber":-1,"message":"DETACH_STALLED_IN_STOPPING","sourceURL":""}
Error: {"columnNumber":-1,"lineNumber":-1,"message":"ServiceWorker startup timed out. The worker was in startup phase: Script streaming.","sourceURL":""}
Error: {"columnNumber":-1,"lineNumber":-1,"message":"DETACH_STALLED_IN_STOPPING","sourceURL":""}
Error: {"columnNumber":-1,"lineNumber":-1,"message":"ServiceWorker startup timed out. The worker was in startup phase: Script streaming.","sourceURL":""}
Error: {"columnNumber":-1,"lineNumber":-1,"message":"DETACH_STALLED_IN_STOPPING","sourceURL":""}

Reply all
Reply to author
Forward
0 new messages