Closed Bug 842725 Opened 12 years ago Closed 12 years ago

install to device via b2gremote throws "appInfo is null"


(Firefox OS Graveyard :: General, defect)

Not set


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

B2G C4 (2jan on)
Tracking Status
firefox20 --- wontfix
firefox21 --- wontfix
firefox22 --- fixed
b2g18 + fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix


(Reporter: myk, Assigned: fabrice)


(Whiteboard: [apps watch list])


(1 file)

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://" 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://" line: 158}]

My device is currently running today's nightly build from the 1.0.1 branch (OS version, 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).
Attached patch patchSplinter Review
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)
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!
Whiteboard: [apps watch list]
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).
Comment on attachment 716958 [details] [diff] [review]

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+
Attachment #716958 - Flags: review?(ferjmoreno)
Attachment #716958 - Flags: review?(ferjmoreno) → review+
Closed: 12 years ago
Resolution: --- → FIXED
Comment on attachment 716958 [details] [diff] [review]

[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?
Given the low risk of regression and impact to development, approving for uplift.
tracking-b2g18: --- → +
Attachment #716958 - Flags: approval-mozilla-b2g18?
You need to log in before you can comment on or make changes to this bug.