Closed Bug 593498 Opened 15 years ago Closed 15 years ago

Backing up or cloning in-use profile can throw exception

Categories

(Testing Graveyard :: ProfileManager, defect)

All
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jgriffin, Unassigned)

Details

If you attempt to backup or clone a profile which is in-use by Firefox, an exception is thrown (at least on Windows): JavaScript error: , line 0: uncaught exception: [Exception... "Component returne d failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFile.copyTo]" nsresult: "0x80 004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://profilemanager/conte nt/profileManager.js :: anonymous :: line 794" data: no] This occurs because while Firefox is running, it places a file in the profile it's using, parent.lock, to which it has exclusive access. When profile manager tries to copy it, it causes an error. We need to deal with this in one of three ways: 1) do recursive file-by-file copies, instead of directory copies, and ignore any files that can't be copied (this is how archiving currently works) 2) detect parent.lock and throw up an error when trying to backup or copy a profile that has it 3) detect the JS exception which is currently thrown, clean-up any half-copied profiles, and alert the user to the probable cause
A similar problem affects linux: an error occurs on linux when trying to copy the 'lock' file, but on linux the copy operation is not interrupted. But if you try to open the copied profile, you get messages about corrupted files.
(In reply to comment #1) > A similar problem affects linux: an error occurs on linux when trying to copy > the 'lock' file, but on linux the copy operation is not interrupted. But if > you try to open the copied profile, you get messages about corrupted files. For linux, it should be easy just to remove the lock file post-copy; for windows, i have no clue
Assignee: nobody → jgriffin
Status: NEW → ASSIGNED
Whiteboard: [blocker-1.0]
I've fixed profile lock detection. Doing any of the following operations on locked profiles can generate errors: - rename - copy - delete - backup - restore If a user attempts to do any of these with a locked profile, he's warned, but allowed to continue if he wants. If he does continue, exceptions will likely occur, so I've added code to catch these, notify the user, and recover as much as possible.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [blocker-1.0]
Assignee: jgriffin → nobody
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.