If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Service Workers are not registering in B2G OOP

RESOLVED DUPLICATE of bug 1137683

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 1137683
3 years ago
3 years ago

People

(Reporter: On parental leave, Assigned: On parental leave)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

3 years ago
Trying to run https://ferjm.github.io/sw/app/index.html on a B2G maple based build throws this error that causes the service worker registration to fail:

 7648 Gecko  I  WARNING: child tried to open http IPDL channel w/o security info
 7648 Gec..  I  MainPage: Not registered: [Exception... "Illegal value"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "
             native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0"  data: no]

Enabling "network.disable.ipc.security" pref solves the issue.
(Assignee)

Comment 1

3 years ago
Printing the principal at [1] gives me:

"ServiceWorkerManager CopyPrincipal - appId 1033 isInBrowserElement 1 uri https://ferjm.github.io"

[1] https://hg.mozilla.org/projects/maple/file/217342aa5d11/dom/workers/ServiceWorkerManager.cpp#l768
(Assignee)

Comment 2

3 years ago
This works on desktop and we print

"ServiceWorkerManager CopyPrincipal - appId 0 isInBrowserElement 0 uri https://ferjm.github.io"

Comment 3

3 years ago
I bet it's https://hg.mozilla.org/projects/maple/file/217342aa5d11/dom/workers/ServiceWorkerManager.cpp#l629 which has no related loadgroup or callbacks associated with it, hence the IPDL security failure.
We'll need to grab a loadgroup from the document calling register(). Would you like to take a stab at this Fernando? You'll want to pass it in to the UpdateJob constructor, the way the principal is passed. Otherwise please assign it to me.

I'll likely land fixes only in central from this point on, since we are starting to move things to central and the buggy code is in Bug 1113555.
Flags: needinfo?(ferjmoreno)
(Assignee)

Comment 5

3 years ago
Ok, thanks for the pointers Nikhil. I'll try to take look during this week, but I am fairly new to this implementation, so I might end up assigning it to you :|.
Assignee: nobody → ferjmoreno
Flags: needinfo?(ferjmoreno)
Depends on: 1125961
Fernando, did baku's patch fix this? Please close this if it did.
Flags: needinfo?(ferjmoreno)
(Assignee)

Comment 7

3 years ago
I am not aware of any patch that fixes this issue. We were using the "network.disable.ipc.security" workaround so far.
Flags: needinfo?(ferjmoreno)
(Assignee)

Comment 8

3 years ago
Created attachment 8568477 [details] [diff] [review]
v1

I'm not sure if this is what you meant in comment 4. Unfortunately, it doesn't fix the issue.
Attachment #8568477 - Flags: feedback?(nsm.nikhil)
not on maple, on central Bug 1133242.
(Assignee)

Comment 10

3 years ago
Yes, I was testing on central. No more maple testing :) Unfortunately, bug 1133242 doesn't fix this issue.

We are not crashing in this case. What happens here is that we fail to register the service worker and we log this message: "WARNING: child tried to open http IPDL channel w/o security info". Which seems to be the cause of the registration failure.
Created attachment 8568531 [details] [diff] [review]
wip-update-principal
Can you try this patch?
(Assignee)

Comment 13

3 years ago
Sure, but I am about to take a plane. I'll try and post the results here in a few hours. However, it seems that your patch is doing part of what my patch is also doing. Apart from passing the loadgroup associated with the document calling register when creating the new channel I also pass the principal, which is what your patch is doing. This didn't work for me, but I'll try without passing the loadgroup again.
(Assignee)

Comment 14

3 years ago
Nikhil, I get the same error with both patches.
Flags: needinfo?(nsm.nikhil)
(Assignee)

Updated

3 years ago
Summary: Service Workers are not registering in B2G OOP ( with maple branch) → Service Workers are not registering in B2G OOP
Comment on attachment 8568477 [details] [diff] [review]
v1

Review of attachment 8568477 [details] [diff] [review]:
-----------------------------------------------------------------

dropping flag since it doesn't fix the issue. Fernando, has the situation changed on this? I can try getting a build on my flame.
Attachment #8568477 - Flags: feedback?(nsm.nikhil)
(Assignee)

Comment 16

3 years ago
Created attachment 8577130 [details]
Log
(Assignee)

Comment 17

3 years ago
I gave this one another try and it seems that it might be a duplicate of bug 1125961. I attached a log where you can see that we are missing the TabChild instance at [1] and that's the reason why we fail the security checks and the service worker registration.

[1] https://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/HttpChannelChild.cpp#1560
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(nsm.nikhil)
Resolution: --- → DUPLICATE
Duplicate of bug: 1125961
Bug 1137683 is actually more relevant.
Duplicate of bug: 1137683
You need to log in before you can comment on or make changes to this bug.