Closed Bug 673366 Opened 13 years ago Closed 9 years ago

me.com file download fails when "Always ask me where to save files" is enabled

Categories

(Toolkit :: Downloads API, defect)

19 Branch
defect
Not set
normal
Points:
3

Tracking

()

RESOLVED DUPLICATE of bug 1115248
Tracking Status
firefox21 --- affected
firefox22 - ---
firefox23 - ---
firefox24 - ---
firefox-esr17 --- unaffected

People

(Reporter: bigheadjer, Unassigned, Mentored)

References

Details

(Keywords: regression, Whiteboard: [lang=js][see comment 24 for steps to reproduce])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Build ID: 20110707182747

Steps to reproduce:

Attempt to download a public file on https://public.me.com/


Actual results:

The dialog asking me whether to Save the File or Cancel appears.  Selecting Save File causes the following error to appear in the Error Console:

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIHelperAppLauncher.saveToDisk]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/components/nsHelperAppDlg.js :: <TOP_LEVEL> :: line 458"  data: no]
Source File: resource://gre/components/nsHelperAppDlg.js
Line: 458

If instead you select "Save files in...." in the General Preferences, then the file is saved properly.


Expected results:

The file dialog asking me where to save the file should appear and I should be able to select the download location.
Do you get the problem only on downloads on that domain ?
Do you have any download extensions installed ?
Does it work in the Firefox safemode http://support.mozilla.com/en-US/kb/Safe+Mode ?
Yes so far on only on that domain.  I tested this with a new empty profile with no extensions installed and it still occurs.
And how do i download a file from this domain without having an Account there ?
I got my friend to set up a test case.  Here it is.

https://public.me.com/mcgirlygirl
I could reproduce the issue on:
 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110724 Firefox/8.0a1

Interesting. 
There is no response while trying to download (save) the file from the link:
https://public.me.com/mcgirlygirl
with the option "Always ask me where to save files" checked.
However if you choose to "open" instead of "save" it works fine.
Setting this as NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
confirming with Seamonkey trunk and FF5

0[631140]: http request [
0[631140]:   GET /ix/mcgirlygirl/U0370.pdf?disposition=download+1311601613645 HTTP/1.1
0[631140]:   Host: public.me.com
0[631140]:   User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
0[631140]:   Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
0[631140]:   Accept-Language: en-us,en;q=0.5
0[631140]:   Accept-Encoding: gzip, deflate
0[631140]:   Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
0[631140]:   DNT: 1
0[631140]:   Connection: keep-alive
0[631140]:   Referer: https://public.me.com/mcgirlygirl
0[631140]:   Cookie: mmr=nk11r10
0[631140]: ]

4288[631780]: http response [
4288[631780]:   HTTP/1.1 200 OK
4288[631780]:   Server: AppleIDiskServer.1G301009
4288[631780]:   x-responding-server: filesng003-0
4288[631780]:   X-dmUser: mcgirlygirl
4288[631780]:   Etag: "c-1g3s18hn-131p-1ds9ykr31p-1sgbutzeoq0"
4288[631780]:   Last-Modified: Mon, 25 Jul 2011 03:11:14 GMT
4288[631780]:   Content-Disposition: attachment;
4288[631780]:   Content-Type: application/octet-stream
4288[631780]:   Content-Length: 303079
4288[631780]:   Date: Mon, 25 Jul 2011 13:46:53 GMT
4288[631780]:   Connection: keep-alive
4288[631780]:   Set-Cookie: mmr=nk11r10; Domain=public.me.com; Path=/ix/mcgirlygirl; Secure
4288[631780]: ]
Component: General → Download Manager
Product: Firefox → Toolkit
QA Contact: general → download.manager
Version: 5 Branch → Trunk
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIHelperAppLauncher.saveToDisk]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource:///components/nsHelperAppDlg.js :: <TOP_LEVEL> :: line 477"  data: no]
Source File: resource:///components/nsHelperAppDlg.js
Line: 477

i.e. in MXR:
http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/downloads/nsHelperAppDlg.js#538
Another set of STR:
 
 
URL: http://www.apple.com/itunes/download/
(you needn't supply email or anything, simply uncheck those two boxes)

> 1) Click download button
> 2) Dialog box comes up asking what I want to do with the file
> 3) Very Important!! LEAVE THIS BOX ALONE
> 3) Page redirect takes place in the background
> 4) Hit the "Save File" button
> 5) Nothing happens, and iTunes is not downloaded or saved.

> If I start with a clear error console, and do the above steps, the following error message will appear every time.

Also required that, Options | General -> Downloads, is set to /Always ask me where to save files/.
 
 
Timestamp: 05/30/2013 07:51:01 AM
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIHelperAppLauncher.saveToDisk]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/components/nsHelperAppDlg.js :: <TOP_LEVEL> :: line 479"  data: no]
Source File: resource://gre/components/nsHelperAppDlg.js
Line: 479

One (of a few) related thread at dslreports: http://www.dslreports.com/forum/r28297474-FireFox-Can-t-download-iTunes-with-FF21
With STR in comment#9:

Regression window(m-c)
Good:
http://hg.mozilla.org/mozilla-central/rev/acf7f73e8b18
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121022124809
Bad:
http://hg.mozilla.org/mozilla-central/rev/48502b61a63e
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121022184211
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=acf7f73e8b18&tochange=48502b61a63e

Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/8d9cff7e5c30
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121021214620
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/03cd2ad254cc
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121021225623
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=8d9cff7e5c30&tochange=03cd2ad254cc

Regressed by:
03cd2ad254cc	Saurabh Anand — Bug 722995 - Part 2: Make DownloadLastDir.jsm use per-window privacy status instead of global service. r=ehsan
Blocks: 722995
Keywords: regression
Version: Trunk → 19 Branch
OS: Other → All
Alice, are you confident about that regression range? It's a surprising patch to be causing the error, given the nature of the changes to nsHelperAppDlg.js.
(In reply to Josh Matthews [:jdm] from comment #13)
> Alice, are you confident about that regression range? It's a surprising
> patch to be causing the error, given the nature of the changes to
> nsHelperAppDlg.js.

Yes 100% sure.

Steps to Reproduce
1. Start Firefox 19 or the Bad Build
2. Set "Always ask me where to save files" in Option > General
3. Open Error Console
4. Open http://www.apple.com/itunes/download/
5. Click "DownLoad Now"
6. Click "Save File" when "Opening iTunes64Setup.exe" dialog pops up
7. Wait to redirect Thank you page
8. Click "Save" button when Filepicker dialog pops up

Actual Results:
Nothing happen, iTunes64Setup.exe is not saved.
And the following Error is shown in the error console.

Timestamp: 2013/05/31 3:48:52
Error: [Exception... "'TypeError: can't access dead object' when calling method: [nsIHelperAppLauncherDialog::promptForSaveToFile]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: resource://gre/components/nsHelperAppDlg.js :: <TOP_LEVEL> :: line 477"  data: no]
Source File: resource://gre/components/nsHelperAppDlg.js
Line: 477

Timestamp: 2013/05/31 3:48:52
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIHelperAppLauncher.saveToDisk]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/components/nsHelperAppDlg.js :: <TOP_LEVEL> :: line 477"  data: no]
Source File: resource://gre/components/nsHelperAppDlg.js
Line: 477
In Nightly24.0a1:

You should set security.mixed_content.block_active_content = false (due to Bug 864787)

And Error in Browser Console:

[04:02:38.250] [Exception... "Async version must be used"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://gre/components/nsHelperAppDlg.js :: <TOP_LEVEL> :: line 190"  data: no] @ resource://gre/components/nsHelperAppDlg.js:190

[04:02:42.327] can't access dead object @ resource://gre/modules/DownloadLastDir.jsm:168

[04:02:42.327] [Exception... "'[JavaScript Error: "can't access dead object" {file: "resource://gre/modules/DownloadLastDir.jsm" line: 168}]' when calling method: [nsIContentPrefCallback2::handleCompletion]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: resource://gre/modules/ContentPrefService2.jsm :: safeCallback :: line 769"  data: yes] @ resource://gre/modules/ContentPrefService2.jsm:772
Ok, so I tried reproducing and trying to find the code which causes this. I was able to reproduce it both in the Nightly and stable Firefox(21). It seems http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/downloads/nsHelperAppDlg.js#250 is the problem and in that too, the getInterface call isn't working properly.

@Alice, I tried to find out the error about dead objects that you pointed out, but can't seem to find it in the browser console. I only see errors and warnings in css files. Could you tell me how to see those errors ?
Maybe Boris knows what the dead object error means?
Flags: needinfo?(bzbarsky)
(In reply to Saurabh Anand [:sawrubh] from comment #16)
> 
> @Alice, I tried to find out the error about dead objects that you pointed
> out, but can't seem to find it in the browser console. I only see errors and
> warnings in css files. Could you tell me how to see those errors ?

I do not do any special thing...

Steps to Reproduce
0. Create New Proficle
1. Start Nightly24.0a1 30-May-2013 win32 build on Windows7 64bit
1-1 security.mixed_content.block_active_content = false in about:config
2. Set "Always ask me where to save files" in Option > General
3. Open Browser Console
4. Open http://www.apple.com/itunes/download/
5. Click "DownLoad Now"
6. Click "Save File" when "Opening iTunes64Setup.exe" dialog pops up
7. Wait to redirect Thank you page
8. Click "Save" button when Filepicker dialog pops up

[06:53:15.291] can't access dead object @ resource://gre/modules/DownloadLastDir.jsm:168
The dead object error typically means you tried to touch a content object from an already-closed tab or window and the memory leak fix that prevents chrome from keeping such objects alive kicked in.

So is there a window in this case that is opening and that the download is starting in but is then getting closed/
Flags: needinfo?(bzbarsky)
It would appear that this bug has been in the release for a couple of versions now, so we'll take a low risk uplift but won't track.
This bug bites me on Linux (Ubuntu 12.04 LTS) and Windows (XP SP3) on at least half of all download attempts. What I cannot understand: we have a tiny regression window (that is in good concordance with when this bug first hit me, could be FF 19), a clear culprit candidate: yet there is no progression. When I read through bug 722995 I have the impression the coders were pretty surprised with what their code did and did not fully understand its implications. Could anybody who really UNDERSTANDS what these objects and and instances do and are expected to do asynchronically (!) review the code and fix this?
This bug occur during downloading iTunes from apple.com but only if you wait until it redirects to "thank you" page. If you start downloading in first 2 seconds after clicking on download button, it works just fine.
Basically it seems this bug only occur if page where download originated from has been changed
ok, count 1 ([:bz] comment 19) and 1 (V@no comment 22) together: does this bug fire when the page where you clicked the download link refreshes? It is quite common nowadays that after clicking the download link you are presented with some kind of "Thank you for downloading ...". If the page gets refreshed, all old objects are gone, are they? I experience this bug often on sourceforge, and they also refresh the page - just a wild guess ...
Yes, page location changes, but no new window or tab created.
The download link located at
http://www.apple.com/itunes/download/
after clicking on download button two seconds later it redirects to
http://www.apple.com/confirm/itunes/thankyou.html

The sourceforge has different approach, it delays the download and it stays on the same page, I've never had any issues with sourceforge

Also must note, the file is being downloaded somewhere regardless (I can see network activity), but after selecting destination nothing happens and nothing added into downloads history. Unfortunately I can't confirm if downloading continue after destination folder selected.
Flags: needinfo?(josh)
Blocks: 918000
Whiteboard: p=0
No longer blocks: fxdesktopbacklog
Flags: firefox-backlog+
Whiteboard: p=0 → p=3
We are facing same issue, if page location changes while "save" dialog is displayed, file is not downloaded in the selected location.

The thing we noticed is the file is downloaded but in temporary location and is not moved to selected location
Attached file TestFirefox.war
If you need a reproducible sample, I am attaching a WAR file deployable in a servlet container like tomcat or jetty 
Access to the TestFirefox application and waits the page to be redirected.
In the dialog if you choose "open with" option, the file is opened
If you choose "save file" the file is not downloaded to the expected destination, but can be found in temporary system folder
Points: --- → 3
Flags: qe-verify?
Whiteboard: p=3
I'm willing to help someone figure this out. When reproducing in a nightly, the browser console now shows me:

>[Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) >[nsIInterfaceRequestor.getInterface]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: >resource://gre/components/nsHelperAppDlg.js :: >nsUnknownContentTypeDialog.prototype.promptForSaveToFileAsync/< :: line 258"  data: no]

That means that it's failing on http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/downloads/nsHelperAppDlg.js#260 (ie. promptForSaveToFileAsync) because the context object (ie. the window) no longer exists. We could try moving the parent variable out of the Task.spawn call and see if that helps matters; if not, we'll have to look for ways of getting the enclosing browser window, rather than the content window.
Flags: needinfo?(josh)
Whiteboard: [mentor=jdm][lang=js]
Whiteboard: [mentor=jdm][lang=js] → [mentor=jdm][lang=js][see comment 24 for steps to reproduce]
Mentor: josh
Whiteboard: [mentor=jdm][lang=js][see comment 24 for steps to reproduce] → [lang=js][see comment 24 for steps to reproduce]
Few things:
Using an e10s window seems to fix this, because aContext is a "ChromeWindow → browser.xul" rather than "XPCWrappedNative_NoHelper".

Moving the parent declaration out of Task.spawn doesn't fix it.
Currently trunk gives me a different error message (perhaps because of debug settings?)

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFilePicker.init]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: [...]components/nsHelperAppDlg.js :: nsUnknownContentTypeDialog.prototype.promptForSaveToFileAsync/< :: line 260"  data: no]

which seems to be coming from
https://mxr.mozilla.org/mozilla-central/source/widget/nsBaseFilePicker.cpp#140
I tried moving the picker.init call (and the prior var declarations) out of Task.spawn as well, but that still didn't fix it, so looks like it's going to involve getting the enclosing browser window as mentioned in comment 29.
I fixed this in bug 1115248, so I'm marking this as a dupe of the other. If all goes well, the fix should  make it into tomorrow's nightly. If you notice issues with windows/frames refreshing after that, please file a new bug, mark it as blocking bug 1115248 and CC me.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: