bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Installing a hosted app that preloads an appcache that does not exist causes the app install process to spin infinitely forever

RESOLVED WORKSFORME

Status

Core Graveyard
DOM: Apps
RESOLVED WORKSFORME
6 years ago
9 months ago

People

(Reporter: jsmith, Assigned: ferjm)

Tracking

Trunk
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
Build: B2G 18 1/12/2013
Device: Unagi

Steps:

1. Install a hosted app preloading appcache that points to an appcache manifest that does not exist (e.g. 404)

Expected:

We should fail fast and report an error to the user that the download failed.

Actual:

The app install process starts spinning forever with no end in sight. Nothing interesting in the logcat.
(Reporter)

Updated

6 years ago
Summary: Installing a hosted app that preloads an appcache that does not exist cause the app install process to spin infinitely forever → Installing a hosted app that preloads an appcache that does not exist causes the app install process to spin infinitely forever
(Reporter)

Comment 1

6 years ago
Probably doesn't block because the marketplace validator could mitigate this by providing feedback that the address for the appcache path doesn't exist. I'd probably track it though given that the developer UX here sucks.
tracking-b2g18: --- → ?
(Reporter)

Comment 2

6 years ago
ccing Matt to see if we're already doing the check in comment 1
Jason, as you said in another bug, this might easily happen outside of the marketplace, right ?
(Reporter)

Comment 5

6 years ago
(In reply to Julien Wajsberg [:julienw] from comment #4)
> Jason, as you said in another bug, this might easily happen outside of the
> marketplace, right ?

Yup that's right. I actually found this bug from helping someone debug their webapp on the webapps mailing list.
(Assignee)

Updated

6 years ago
Assignee: nobody → ferjmoreno
(Reporter)

Updated

6 years ago
Blocks: 802574
(Assignee)

Comment 6

6 years ago
This works for me with latest inbound (80adbcab0085) and latest gaia (2465ff155f2c1d).

Installing an app with an appcache path that does not exists throws APP_CACHE_DOWNLOAD_ERROR and the icon stops spinning.

XXX FIXME : Got a mozContentEvent: webapps-install-granted
-*-*- Webapps.jsm : Creating AppcacheObserver for http://10.95.194.252:3000 - pending
-*-*- Webapps.jsm : Offline cache state change for http://10.95.194.252:3000 : 1
-*-*- Webapps.jsm : Offlinecache setError to APP_CACHE_DOWNLOAD_ERROR

Clicking in the icon again to download the app throws APP_CACHE_DOWNLOAD_ERROR:

XXX FIXME : Got a mozContentEvent: webapps-install-granted
-*-*- Webapps.jsm : Creating AppcacheObserver for http://10.95.194.252:3000 - pending
-*-*- Webapps.jsm : Offline cache state change for http://10.95.194.252:3000 : 1
-*-*- Webapps.jsm : Offlinecache setError to APP_CACHE_DOWNLOAD_ERROR
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
Jason, it would help if you could point to a webapp causing this, if you still have this ?
(Reporter)

Comment 8

6 years ago
I doubt something else fixed this - Tony confirmed this busted yesterday and a developer claimed this wasn't working on Saturday. I confirmed this yesterday as well twice. Reopen.

http://dictionary.reference.com/appmarket/dictionary/dictionary.webapp
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
(Reporter)

Comment 9

6 years ago
That app was taken off the market and dev has been notified to fix this, but comment 8 has an example.

http://dictionary.reference.com/cache.manifest <-- appcache_path

If you go to that site directly, you'll get a custom 404 page.

I'll retest, although I doubt this has been fixed.
Keywords: qawanted
QA Contact: jsmith
(Assignee)

Comment 10

6 years ago
Still works for me.

XXX FIXME : Got a mozContentEvent: webapps-install-granted
-*-*- Webapps.jsm : JSON manifest {
  "_origin": {
    "spec": "http://dictionary.reference.com/",
    "prePath": "http://dictionary.reference.com",
    "scheme": "http",
    "userPass": "",
    "username": "",
    "password": "",
    "hostPort": "dictionary.reference.com",
    "host": "dictionary.reference.com",
    "port": -1,
    "path": "/",
    "asciiSpec": "http://dictionary.reference.com/",
    "asciiHost": "dictionary.reference.com",
    "originCharset": "UTF-8",
    "ref": "",
    "specIgnoringRef": "http://dictionary.reference.com/",
    "hasRef": false
  },
  "_manifest": {
    "version": "1.0",
    "name": "Dictionary (by Dictionary.com)",
    "description": "Access Dictionary.com, the most popular and trusted online dictionary, with spell-check, word definitions, thesaurus, and more!",
    "icons": {
      "16": "/appmarket/dictionary/img/Mozilla_store_Dictionary_Dict_16x16.png",
      "48": "/appmarket/dictionary/img/Mozilla_store_Dictionary_Dict_48x48.png",
      "128": "/appmarket/dictionary/img/Mozilla_store_Dictionary_Dict_128x128.png"
    },
    "developer": {
      "name": "Dictionary.com, LLC",
      "url": "http://dictionary.com"
    },
    "installs_allowed_from": [
      "*"
    ],
    "appcache_path": "/cache.manifest",
    "locales": {},
    "default_locale": "en"
  },
  "_localeRoot": {
    "version": "1.0",
    "name": "Dictionary (by Dictionary.com)",
    "description": "Access Dictionary.com, the most popular and trusted online dictionary, with spell-check, word definitions, thesaurus, and more!",
    "icons": {
      "16": "/appmarket/dictionary/img/Mozilla_store_Dictionary_Dict_16x16.png",
      "48": "/appmarket/dictionary/img/Mozilla_store_Dictionary_Dict_48x48.png",
      "128": "/appmarket/dictionary/img/Mozilla_store_Dictionary_Dict_128x128.png"
    },
    "developer": {
      "name": "Dictionary.com, LLC",
      "url": "http://dictionary.com"
    },
    "installs_allowed_from": [
      "*"
    ],
    "appcache_path": "/cache.manifest",
    "locales": {},
    "default_locale": "en"
  }
}
-*-*- Webapps.jsm : Creating AppcacheObserver for http://dictionary.reference.com - pending
-*-*- Webapps.jsm : Offline cache state change for http://dictionary.reference.com : 1
-*-*- Webapps.jsm : Offlinecache setError to APP_CACHE_DOWNLOAD_ERROR

I am building inbound, so something else might have fixed this issue lately.
(Reporter)

Comment 11

6 years ago
Not working for me on b2g 18 with:

<project name="releases/gecko.git" path="gecko" remote="mozillaorg" revision="b75dfee39f8a5b634a9bc39dacf2bdf59ee4333f"/>

<project name="releases/gaia.git" path="gaia" remote="mozillaorg" revision="df38c1bb813029f3ccfa4a997fb1529b3ff1a1ff"/>
Keywords: qawanted
(Reporter)

Comment 12

6 years ago
Can you reproduce this with the b2g18 branch?

There's always the slight possibility that we have something working on trunk, but not working on b2g18. This has happened before...
(Assignee)

Comment 13

6 years ago
(In reply to Jason Smith [:jsmith] from comment #12)
> Can you reproduce this with the b2g18 branch?
> 
I'll try. I have to clone it first, though.
(Reporter)

Comment 14

6 years ago
Matt actually clarified what might be causing this bug on the validator side, which might explain why downloading is failing here:

Here's what the email thread said for the validator.

The bug is caused by the 301/302 redirects that occur before the 404 occurs. The requests library doesn't throw an HTTPError exception if it is set to `allow_redirects` and the first response is not a failed status code. I'm working on the bug today.
(Assignee)

Comment 15

6 years ago
FWIW, I tried with b2g18 (5a367713bfa4) and it seems to be working too.

I tested with 'appInexistingCache' and 'appRedirectNoExistCache' tests from http://owapps.cloudfoundry.com (you can check the source at https://github.com/ferjm/apptester/tree/master/webapp/apps).

I/GeckoDump(  108): XXX FIXME : Got a mozContentEvent: webapps-install-granted
I/Gecko   (  108): -*-*- Webapps.jsm : Creating AppcacheObserver for http://apptester.eu01.aws.af.cm - pending
E/GeckoConsole(  452): Content JS LOG at http://apptester.eu01.aws.af.cm/market.js:68 in onsuccess: Something went wrong. You installed a wrong app
E/GeckoConsole(  108): Offline cache manifest HTTP request failed, URL=http://apptester.eu01.aws.af.cm/inexisting.appcache
E/GeckoConsole(  108): Offline cache manifest removed, cache cleared, URL=http://apptester.eu01.aws.af.cm/inexisting.appcache
E/GeckoConsole(  108): Offline cache update error, URL=http://apptester.eu01.aws.af.cm/inexisting.appcache
I/Gecko   (  108): -*-*- Webapps.jsm : Offline cache state change for http://apptester.eu01.aws.af.cm : 1
I/Gecko   (  108): -*-*- Webapps.jsm : Offlinecache setError to APP_CACHE_DOWNLOAD_ERROR
E/GeckoConsole(  108): Content JS INFO at app://system.gaiamobile.org/js/app_install_manager.js:188 in ai_handleDownloadError: downloadError event, error code is APP_CACHE_DOWNLOAD_ERROR


I/GeckoDump(  108): XXX FIXME : Got a mozContentEvent: webapps-install-granted
I/Gecko   (  108): -*-*- Webapps.jsm : Creating AppcacheObserver for http://apptester.eu01.aws.af.cm - pending
E/GeckoConsole(  452): Content JS LOG at http://apptester.eu01.aws.af.cm/market.js:79 in onsuccess: Something went wrong. You installed a wrong app
E/GeckoConsole(  108): Offline cache manifest HTTP request failed, URL=http://apptester.eu01.aws.af.cm/app/appRedirectNoExistCache/redirect.appcache
E/GeckoConsole(  108): Offline cache manifest removed, cache cleared, URL=http://apptester.eu01.aws.af.cm/app/appRedirectNoExistCache/redirect.appcache
E/GeckoConsole(  108): Offline cache update error, URL=http://apptester.eu01.aws.af.cm/app/appRedirectNoExistCache/redirect.appcache
I/Gecko   (  108): -*-*- Webapps.jsm : Offline cache state change for http://apptester.eu01.aws.af.cm : 1
I/Gecko   (  108): -*-*- Webapps.jsm : Offlinecache setError to APP_CACHE_DOWNLOAD_ERROR
E/GeckoConsole(  108): Content JS INFO at app://system.gaiamobile.org/js/app_install_manager.js:188 in ai_handleDownloadError: downloadError event, error code is APP_CACHE_DOWNLOAD_ERROR
What bothers me here is that when I initially worked on Bug 829522 I had put some logs in Webapps.jsm's updateObserver.observe function, and I've never seen these logs happening.

FTR the problem in Bug 8295922 is that we were giving a wrong manifest URL to the AppCache downloader. However, the URL itself was existing (it was the webapp manifest) so this may be what triggers this bug.
(Reporter)

Updated

6 years ago
Keywords: qawanted
(Reporter)

Comment 17

6 years ago
I guess I can't reproduce as well.
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Keywords: qawanted
Resolution: --- → WORKSFORME
(Reporter)

Updated

6 years ago
No longer blocks: 802574

Updated

6 years ago
tracking-b2g18: ? → ---

Updated

9 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.