Last Comment Bug 825209 - Marketplace is failling to serve etags for the packaged app zip files, which makes them impossible to install right now
: Marketplace is failling to serve etags for the packaged app zip files, which ...
Status: VERIFIED FIXED
: smoketest
Product: Marketplace
Classification: Server Software
Component: Consumer Pages (show other bugs)
: 1.0
: ARM Gonk (Firefox OS)
: -- blocker (vote)
: 2013-01-03
Assigned To: Rob Hudson [:robhudson]
:
Mentors:
Depends on:
Blocks: market-packaged-apps
  Show dependency treegraph
 
Reported: 2012-12-28 06:46 PST by Jason Smith [:jsmith]
Modified: 2012-12-28 15:40 PST (History)
6 users (show)
jsmith: mkt‑blocker+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Jason Smith [:jsmith] 2012-12-28 06:46:54 PST
See https://bugzilla.mozilla.org/show_bug.cgi?id=824695#c25. Right now, none of the packaged apps can be installed from marketplace because marketplace is only serving etags for the mini-manifest, not the zip files. This results in the download starting, but failing to finish for any packaged app that was installed from marketplace.

This is a smoketest blocker, so this deserves a very high priority.
Comment 1 Jason Smith [:jsmith] 2012-12-28 06:47:28 PST
Any ideas Rob?
Comment 2 Rob Hudson [:robhudson] 2012-12-28 09:09:01 PST
I didn't realize the zip files needed an etag also but I'll make this my top priority today. I'm going to assume the same is true for the zip files for reviewers.
Comment 3 Rob Hudson [:robhudson] 2012-12-28 11:03:29 PST
https://github.com/mozilla/zamboni/commit/b2bdf7a 

This adds an ETag header to both the public and reviewer zip files. Just in case it makes any difference, these also use the "X-Accel-Redirect" header for SENDFILE support.
Comment 4 Jason Smith [:jsmith] 2012-12-28 11:14:27 PST
For those of us who don't know about how often marketplace dev gets pushes for patches - when when I be able to try this out? Tomorrow?
Comment 5 krupa raj[:krupa] 2012-12-28 11:50:13 PST
(In reply to Jason Smith [:jsmith] from comment #4)
> For those of us who don't know about how often marketplace dev gets pushes
> for patches - when when I be able to try this out? Tomorrow?

Changes on dev show up instantaneously. So 5 minutes after the commit has landed you should see the changes.
Comment 6 Jason Smith [:jsmith] 2012-12-28 12:51:46 PST
(In reply to krupa raj 82[:krupa] from comment #5)
> (In reply to Jason Smith [:jsmith] from comment #4)
> > For those of us who don't know about how often marketplace dev gets pushes
> > for patches - when when I be able to try this out? Tomorrow?
> 
> Changes on dev show up instantaneously. So 5 minutes after the commit has
> landed you should see the changes.

Okay...so retrying this with this patch right now didn't work for me. Still seeing:

12-28 15:49:06.993: E/GeckoConsole(108): [JavaScript Error: "[Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIHttpChannel.getResponseHeader]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://gre/modules/Webapps.jsm :: <TOP_LEVEL> :: line 1838"  data: no]" {file: "resource://gre/modules/Webapps.jsm" line: 1838}]

Which implies the etag wasn't found. I'll do a curl to double check...

Do we need to push out new packaged apps to see this fix?
Comment 7 Jason Smith [:jsmith] 2012-12-28 12:56:19 PST
Okay, there's definitely no etags showing up:

jds2501@nitron:~$ curl -I https://marketplace-dev.allizom.org/downloads/file/181685/test-webapi-permissions-1.3.zip
HTTP/1.1 200 OK
Server: nginx
X-Backend-Server: dev1.addons.phx1.mozilla.com
Content-Type: application/zip
Date: Fri, 28 Dec 2012 20:55:36 GMT
Accept-Ranges: bytes
Via: Moz-pp-zlb09
Connection: keep-alive
Set-Cookie: lang="en-US\054"; Path=/
Set-Cookie: region=us; Path=/
Last-Modified: Wed, 26 Dec 2012 04:19:38 GMT
Content-Length: 19925

Rob - Any ideas?
Comment 8 Rob Hudson [:robhudson] 2012-12-28 14:35:22 PST
I checked the -dev server settings and we're using XSENDFILE headers and nginx's X-Accel-Redir. I'm wondering if nginx does an internal redirect and eats the headers I set? Locally, not using nginx, the ETag header shows up for me.
Comment 9 Rob Hudson [:robhudson] 2012-12-28 14:42:08 PST
Yep, looks like nginx needs a special directive to tell it to keep the ETag header:
http://forum.nginx.org/read.php?2,205636,205665#msg-205665
Comment 10 Rob Hudson [:robhudson] 2012-12-28 15:02:55 PST
Jason updated the nginx config so it doesn't eat the etag.
Comment 11 Jason Smith [:jsmith] 2012-12-28 15:16:23 PST
There we go:

$ curl -I https://marketplace-dev.allizom.org/downloads/file/181821/test-webapi-permissions-1-1.3.zip
HTTP/1.1 200 OK
Server: nginx
Content-Type: application/zip
Date: Fri, 28 Dec 2012 23:15:59 GMT
Accept-Ranges: bytes
Etag: "fa80ed14a75b7756e4dc952468004657d7bbc53676bc777f6ee5f5b7b8573bdc"
Via: Moz-pp-zlb09
Connection: keep-alive
Set-Cookie: lang="en-US\054"; Path=/
Set-Cookie: region=us; Path=/
Last-Modified: Fri, 28 Dec 2012 22:32:07 GMT
Content-Length: 19927

Let's see what happens if I test this on the phone now...
Comment 12 Jason Smith [:jsmith] 2012-12-28 15:40:32 PST
Tried installing 4 packaged apps on marketplace - we're green as can be. Marking as verified.

Note You need to log in before you can comment on or make changes to this bug.