Open
Bug 697106
Opened 15 years ago
Updated 9 years ago
filter changes not saved without warning when msgFilterRules.dat is open by other program (or otherwise inaccessible (missing permissions))
Categories
(Thunderbird :: Filters, defect)
Tracking
(Not tracked)
NEW
People
(Reporter: aceman, Assigned: aceman)
References
Details
(Keywords: dataloss, Whiteboard: [filter-mgmt])
Attachments
(2 files)
Steps to reproduce:
1. open msgfilterrules.dat file in some program that locks it (I used Far Manager built-in viewer (F3)). I don't know what type of lock is needed, but Tb will probably need and exclusive RW one so read lock could be enough.
2. go to Message Filters and make any changes to a filter.
3. confirm with OK, close dialog. No warning.
4. close TB. Notice the changes weren't stored in the msgfilterrules.dat file but TB didn't warn about it.
I get this error in the Error console after step 3:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIMsgFilterList.saveToDefaultFile]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame :: chrome://messenger/content/FilterListDialog.js :: onFilterUnload :: line 315" data: no]
Expected result:
Tb should display a warning the filters could not be saved.
Updated•14 years ago
|
Severity: normal → critical
Keywords: dataloss
Summary: filters not saved without warning when msgFilterRules.dat is open by other program → filter changes not saved without warning when msgFilterRules.dat is open by other program
Comment 1•14 years ago
|
||
FYI.
If file is opened by other software when Tb attempts file I/O, some known problems may occur. I think many Tb's file I/O code is not so torelant with interfere by other software, as Tb's file I/O code is not torelant with system crash, power failure, crash/freeze of Tb and so on.
(1) prefs.js
Because I/O of prefs.js is "write to prefs-N.js, delete prefs.js, rename prefs-N.js prefs.js"(called "Safe file writing), if prefs.js is opened by other software, prefs.js is not updatd and file named prefs-N.js increases upon each prefs.js update by Tb. If this continues even when termination of Tb, update of prefs.js is lost, although final data is kept in latest prefs-N.js.
(2) VirtualFolders.dat, bug 650831 relevant.
VirtualFolders.dat is written by "open write replace, write data".(not method called "Safe file writing"). See bug 650831 for this. File I/O for msgFilterRules.dat is similar to VirtualFolders.dat. So, similar problem to this bug can occur on virtualFolders.dat too.
(3) MsgDB, bug 498814
If mail folder file is opened by other software when Tb tries to Compact folder, Compact silently fails. If mail folder file is closed by other software just before Tb's "delete of old file" step, mail folder file is possibly deleted by Tb.
(4) Mail data of IMAP offline-use=on folder, Bug 501851
If appending to IMAP offline-store file is interfered with other software, mail data at offset=0 in offline-store(length=102,256 bytes) is used as mail data.
Comment 2•14 years ago
|
||
FYI.
Bug 494706 was one of most critical problems ivoked by interfere of other software.
Comment 3•14 years ago
|
||
Save to msgFilterRules.dat is successful.
1. Write to msgFilterRules-1.dat
2. Rename msgFilterRules-1.dat msgFilterRules.dat (with ReplaceIfExists mode)
Comment 4•14 years ago
|
||
Save to msgFilterRules.dat fails, because interfered by other software.
1. Write mode open of msgFilterRules.dat by Sakura Editor.
2. Write to msgFilterRules-1.dat
3. Rename msgFilterRules-1.dat msgFilterRules.dat (with ReplaceIfExists mode)
=> fails with "ACCESS DENIED"
> Error: uncaught exception: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)
> [nsIMsgFilterList.saveToDefaultFile]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)"
> location: "JS frame :: chrome://messenger/content/FilterListDialog.js :: onFilterUnload :: line 300" data: no]
4. Delete msgFilterRules-1.dat
Comment 5•14 years ago
|
||
Problem was reproduced with Tb 9.0.1 on Win-XP.
Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 6•14 years ago
|
||
File I/O of msgFilterRules.dat was same as or similar to prefs.js.
"write xxx-N.ext, rename xxx-N.ext xxx.ext" way,
but msgFilterRules-1.dat was deleted when "ACCESS DENIED" is returned to rename.
If prefs.js, delete of prefs-N.js was not observed when test in the past.
Comment 7•14 years ago
|
||
(In reply to :aceman from comment #0)
> Expected result:
> Tb should display a warning the filters could not be saved.
I think "Retry? Save to other location? Cancel?" like dialog is kind for user, because "Retry? Cancel?" dialog is already shown by Tb when Draft/Sent/Templates save error.
This kind of dialog is also useful for write error of Tb's important flat files such as prefs.js, virtualFolders.dat, abook-X.mab.
Comment 8•14 years ago
|
||
FYI.
When virtualFolders.dat, file is written with "write with OverwriteIf" mode, and no error message is shown even if write error occurs, and latest data is lost. However, severity of problem is far lower than msgFilterRules.dat case, because virtual folder is recovered from existent .msf file for virtual folder upon restart of Tb and virtualFolders.dat is updated by latest information.
Updated•10 years ago
|
Whiteboard: [filter-mgmt]
I'll take this as I no longer can reproduce the error. Maybe we replace the filter file in a safe manner now (e.g. create new one, write, then replace the old one) in which case the lock on the original file is not an issue anymore.
Even if I kept the file locked while TB was open, after closing TB and reopening the file in an editor, the NEW contents was in the file.
Assignee: nobody → acelists
Product: MailNews Core → Thunderbird
Version: 10 → 10 Branch
Comment 10•10 years ago
|
||
https://support.mozilla.org/en-US/questions/1143806 might be describing this.
Updated•9 years ago
|
Summary: filter changes not saved without warning when msgFilterRules.dat is open by other program → filter changes not saved without warning when msgFilterRules.dat is open by other program (or otherwise inaccessible (missing permissions))
Comment 13•9 years ago
|
||
I think the problem is worse than initially reported: all chnages are discarded, the passwords to accounts are stored in the password manager file as long as tb is open. when closed and repopened, everything has vanished.
this is quite annoying. does it have anything to do with permissions ? I use el crapitan and I regret my move from windows, which i did cause i wasted so much time on windows applications.
same happening here.
Comment 14•9 years ago
|
||
If you don't have write access to the files in your profile you're in trouble ;-(
Why don't you visit the profile (Help > Troubleshooting Information, open the profile) and check the access rights?
Comment 15•9 years ago
|
||
As far as I was struggling with the similar problem (bug 1324287) and it tooks a time to find, where is the root of the problem, it would be nice to have at least warning, that something could not be saved. In case of not saving data of password manager it is quite critical I think.
You need to log in
before you can comment on or make changes to this bug.
Description
•