install to device via b2gremote throws "appInfo is null"

RESOLVED FIXED in Firefox 22

Status

Firefox OS
General
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: myk, Assigned: fabrice)

Tracking

unspecified
B2G C4 (2jan on)
x86
Mac OS X

Firefox Tracking Flags

(firefox20 wontfix, firefox21 wontfix, firefox22 fixed, b2g18+ fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)

Details

(Whiteboard: [apps watch list])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
After using b2gremote to push a packaged app to an Unagi device running a nightly build from a b2g18 branch, the app doesn't appear on the homescreen until after a device restart, even though B2G notifies me that the app was installed; and the following error messages show up in logcat:

02-19 12:34:30.650 E/GeckoConsole(  394): [JavaScript Error: "appInfo is null" {file: "jar:file:///system/b2g/omni.ja!/components/AppProtocolHandler.js" line: 68}]
02-19 12:34:30.660 E/GeckoConsole(  394): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: '[JavaScript Error: "appInfo is null" {file: "jar:file:///system/b2g/omni.ja!/components/AppProtocolHandler.js" line: 68}]' when calling method: [nsIProtocolHandler::newChannel]" {file: "app://homescreen.gaiamobile.org/js/page.js" line: 158}]
02-19 12:34:30.660 E/GeckoConsole(  394): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: '[JavaScript Error: "appInfo is null" {file: "jar:file:///system/b2g/omni.ja!/components/AppProtocolHandler.js" line: 68}]' when calling method: [nsIProtocolHandler::newChannel]" {file: "app://homescreen.gaiamobile.org/js/page.js" line: 158}]


My device is currently running today's nightly build from the 1.0.1 branch (OS version 1.0.1.0-prerelease, Build Identifier 20130219070200), but I also noticed this behavior on today's nightly build from the 1.1 branch (which I was running until my phone automatically "updated" to the 1.0.1 build).

The problem is reproducible.  At one point, I stopped being able to reproduce after installing an app to the device a number of times.  But rebooting the device brought the problem back.

It doesn't happen with hosted apps, just packaged ones.  I have reproduced with two different packaged apps (test_apps/template and external-dogfood-apps/packstubtest).
(Assignee)

Comment 1

5 years ago
Created attachment 716958 [details] [diff] [review]
patch

Myk, can you test with this patch? That should fix a race condition where the oninstall handler is called before we had a chance to update the child processes with the new app data.
Assignee: nobody → fabrice
Attachment #716958 - Flags: feedback?(myk)
(Reporter)

Comment 2

5 years ago
I don't yet have a build environment for building B2G for my device, but since these are JS-only changes, perhaps I can use adb to push them to my device.  I'll look into it!

Updated

5 years ago
Whiteboard: [apps watch list]
(Reporter)

Comment 3

5 years ago
Ok, I put together a build environment, built B2G, and flashed it to my Unagi.  But now b2gremote doesn't trigger the remote debugging confirmation prompt on the device when it calls Debugger.init(6000), even though I enabled "remote debugging in its settings).  So the b2gremote Debugger never becomes ready, and I can't push an app to the device.

If I flash today's nightly build to the device and enable remote debugging, however, then the prompt does appear, and I can push apps to the device (but still have the problem described by this bug report).
(Reporter)

Comment 4

5 years ago
Comment on attachment 716958 [details] [diff] [review]
patch

One difference between the builds was that my custom build was VARIANT=eng, while the nightly build is VARIANT=user.  So I rebuilt my custom build as VARIANT=user and tried again.

Initially, that didn't seem to make a difference.  But after toggling the remote debugging setting a few times and reconnecting to the device a few times, suddenly the device started accepting install requests (although, strangely, it doesn't prompt me to accept the remote debugging connection first).  And packaged apps show up on the homescreen immediately upon being installed.

So it looks like this patch does fix the problem.
Attachment #716958 - Flags: feedback?(myk) → feedback+
(Assignee)

Updated

5 years ago
Attachment #716958 - Flags: review?(ferjmoreno)
Attachment #716958 - Flags: review?(ferjmoreno) → review+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/a8c4125b0e5a
https://hg.mozilla.org/mozilla-central/rev/a8c4125b0e5a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

4 years ago
Comment on attachment 716958 [details] [diff] [review]
patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): unknown; behavior seems longstanding.

User impact if declined: The known impact here is on developers, whose attempts to push apps to a device for testing will appear to fail (even though they will actually have succeeded).  It's possible that the bug will also affect users who install apps under certain circumstances, although we have no verified cases of that at the moment.

Testing completed: I tested Fabrice's patch on my Unagi device, after which Fabrice pushed it through inbound to central, where it has been baking for the last four days.

Risk to taking this patch (and alternatives if risky): The patch seems low-risk.  I don't know of any alternatives.

String or UUID changes made by this patch: None.
Attachment #716958 - Flags: approval-mozilla-b2g18?

Comment 8

4 years ago
Given the low risk of regression and impact to development, approving for uplift.
tracking-b2g18: --- → +
Attachment #716958 - Flags: approval-mozilla-b2g18?
https://hg.mozilla.org/releases/mozilla-b2g18/rev/6ddc563b84a2
status-b2g18: --- → fixed
status-b2g18-v1.0.0: --- → wontfix
status-b2g18-v1.0.1: --- → wontfix
status-firefox20: --- → wontfix
status-firefox21: --- → wontfix
status-firefox22: --- → fixed
Target Milestone: --- → B2G C4 (2jan on)
You need to log in before you can comment on or make changes to this bug.