Closed Bug 1010220 Opened 10 years ago Closed 8 years ago

NS_ERROR_FILE_UNRECOGNIZED_PATH in DownloadLastDir.jsm after switching OSes

Categories

(Toolkit :: Downloads API, defect)

29 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1258797

People

(Reporter: jan, Unassigned, Mentored)

Details

(Whiteboard: [good next bug][lang=js])

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release)
Build ID: 20140428193813

Steps to reproduce:

Use Firefox on Windows
Download files from domain
Switch to Linux, copying content-prefs.sqlite
Try to download files from same domain


Actual results:

Can't choose a directory to save in, no message appears,
NS_ERROR_FILE_UNRECOGNIZED_PATH in resource://gre/modules/DownloadLastDir.jsm is thrown in Console.


Expected results:

Download-Dialogue should open and allow me to choose a folder.

Editing content-prefs.sqlite and running
update prefs SET `value` = '/home/myusername' where settingID = 3 AND `value` LIKE 'c:%';
fixed the Problem for me. But the component shouldn't crash because of a windows path in the prefs, it should probably treat it as if there was no entry.
Status: UNCONFIRMED → NEW
Component: Untriaged → Download Manager
Ever confirmed: true
Flags: firefox-backlog+
OS: Linux → All
Product: Firefox → Toolkit
Hardware: x86_64 → All
This should be a question of just adding a try catch in the right place, as there's already an if statement to check if we got a value back from the cps at all.
Whiteboard: [good first bug][mentor=Gijs][lang=js]
Moving from good-first to good next. A contributor taking this bug should be ready to spin up a virtual machine to test it.
Whiteboard: [good first bug][mentor=Gijs][lang=js] → [good next bug][mentor=Gijs][lang=js]
(In reply to Mike Hoye [:mhoye] from comment #2)
> Moving from good-first to good next. A contributor taking this bug should be
> ready to spin up a virtual machine to test it.

AIUI, it is much easier to reproduce this: you can just use the "sqlite manager" add-on (available on AMO) or another sqlite client to adjust the relevant value in the content-prefs database to utter garbage, and you should be fine to reproduce and fix the issue with a try catch and so on. :-)

(might still be good next rather than good first, but n-i to be sure)
Flags: needinfo?(mhoye)
Definitely good next. Good first bugs are simple fixes where the hard part is getting the development environment spun up and the patch in. See https://wiki.mozilla.org/Contribute/Coding/Mentoring
Flags: needinfo?(mhoye)
Mentor: gijskruitbosch+bugs
Whiteboard: [good next bug][mentor=Gijs][lang=js] → [good next bug][lang=js]
Duping forward by exception because the other bug has more details about how to fix this. I looked for this bug before I gathered those details, but couldn't find it because the summary was technical rather than descriptive. :-\
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Recently migrated from Windows to Linux, copying over the config, and this bug is happening.  But in my case it seems that only https pages are failing to save.
NS_ERROR_FILE_UNRECOGNIZED_PATH: Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIFile.initWithPath]DownloadLastDir.jsm:167
[Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIFile.initWithPath]"  nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)"  location: "JS frame :: resource://gre/modules/DownloadLastDir.jsm :: DownloadLastDir.prototype.getFileAsync/<.handleCompletion :: line 167"  data: no]
DownloadLastDir.prototype.getFileAsync/<.handleCompletion()
DownloadLastDir.jsm:167
safeCallback()
ContentPrefUtils.jsm:47
cbHandleCompletion()
ContentPrefUtils.jsm:36
onDone()
ContentPrefService2.jsm:154
handleCompletion()
ContentPrefService2.jsm:750
(unknown)
You need to log in before you can comment on or make changes to this bug.