Closed Bug 163899 Opened 22 years ago Closed 12 years ago

Empty bookmarks written, if some error in bookmarks file

Categories

(SeaMonkey :: Bookmarks & History, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: BenB, Unassigned)

References

Details

(Keywords: dataloss)

I just had a system crash where several files were corrupted. Investigating it,
I noticed that the bookmarks file still was more than 1 MB in size, as expected.
After I started Mozilla, I noticed that there were other problems (e.g. with
localstore.rdf), so I closed it again, fixed that problem and started Mozilla
again. Then I noticed that the bookmarks were empty (and I might have closed
Mozilla again at that point) and the bookmarks file on disk was only a few bytes
big then.

Appearantly, Mozilla encountered some problem while reading bookmarks.html and
decided to ignroe the whole file (and thus start with empty bookmarks). When it
got closed, it wrote out the current list of bookmarks (which was empty),
overwriting the old file.

This is *severe* data loss. I lost an unknown number of bookmarks this way,
those that I added in the last 20 days (until the last backup).
Yesterday I lost all my bookmarks.

There was a power failure after wich my (Linux) computer restarted. After
booting I started Mozilla and noticed that all my bookmarks are gone, also some
of my preferences.
At the moment of the power failure, I had mozilla open with several tabs, my
sidebar is alway open with the bookmarks as active tab.

After reading this bug in Bugzilla, I think my problem has something todo with
this bug. But beside my bookmarks, also some of my preferences were lost.

Please fix this bug soon.

I use Mozilla 1.1
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826
Keywords: mozilla1.1mozilla1.3
is this a dup of 164244?
SERIOUS error.  It should try and repair itself.  All bookmarks lost.  The
Horror! The Horror!  
No longer blocks: profile-corrupt
Flags: blocking1.4?
Keywords: mozilla1.3
pierre, can you look at this and see if it's anything obvious? 
I won't have time to do any useful investigation til next week.
Benjamin would have some insights here since he rewrote that part.
I'm pretty sure my changes wouldn't affect this... this problem has probably
been around for a long time. There are several possible solutions:

1) keep a number of backup copies of the bookmarks file, just as we keep
multiple copies of prefs.js, etc.

2) if the bookmarks parser fails for some reason, alert the user (and then what?)
> 2) if the bookmarks parser fails for some reason, alert the user
> (and then what?)

Then don't write out at exit, unless the user said it's OK.

3) Try hard to read as much from the file as possible, don't give up at the
smallest error.
Just lost all of my bookmarks.  There wasn't even a crash, just started Moz up
one time, and the file was blank. :(
mozilla1.4 shipped. unsetting blocking1.4 request.
Flags: blocking1.4?
crash => IMHO this could be resolved as dupe of Bug 193749 "bookmarks and
personal preferences are lost after system crash due to power failure".
Just got burnt by this.  Requesting blocking aviary branch...
Flags: blocking-aviary1.0?
Flags: blocking-aviary1.0? → blocking-aviary1.0-
Product: Browser → Seamonkey
Assignee: bugs → p_ch
QA Contact: claudius → bookmarks
(In reply to comment #6)
> I'm pretty sure my changes wouldn't affect this... this problem has probably
> been around for a long time. There are several possible solutions:
> 
> 1) keep a number of backup copies of the bookmarks file, just as we keep
> multiple copies of prefs.js, etc.
Sirs: EXCELLENT IDEA.
When did the format of this file change from netscape?
With Netscape it was html, it could be emailed to yourself as backup,
and IT WORKED CROSS PLATFORM. ( is used to use it to get my bookmarks from
windows to linux. Kommander reads the old NetScape file perfectly ::))

> 2) if the bookmarks parser fails for some reason, alert the user (and then what?)
And then ask the user if he wants to use 1) Last known good ( default ), 2) First time todays or 3) Yesterdays 4) Last weeks or 5) Mozilla defaults ( factory fresh ).
According to '170539 prefs_lost' it occured at first launch of the day, He would need to use 4) Yesterdays.

If this effets ALL the application suite prefrences, then you would also need to see of you only need to revert that apps prefrences or all prefrences.
This BUG is also: 170539 prefs_lost
This BUG is also: 193749  

Thank you for a most excellent browser, despite this BUG

Benjamin Smedberg wrote:
"3) Try hard to read as much from the file as possible, don't give up at the
smallest error."
Sir: I complement you, your colluges, and your CS instructors. 
Reassigning as per Bug #32644
Assignee: p_ch → nobody
*** Bug 263488 has been marked as a duplicate of this bug. ***
Bug 249150 and bug 260928 are the firefox version of this bug.
*** Bug 328694 has been marked as a duplicate of this bug. ***
Could you remove the bookmarks feature of firefox until this bug is fixed?
You could also state somewhere (like in the bookmarks menu) that the bookmarks feature of firefox is severely broken and should not be used for any data that is minimally important.

I think this is a good idea since you do not want to hide this info to firefox users. No one should be hidden the info that the bookmarks feature of firefox corrupts bookmarks under many circumstances while MSIE works much more properly. If you do not info the user about this issue firefox would look just like something that need to be "sold" anyway even having severe problems.
This isn't a regular bug that happens to everyone, also there is a bookmarks backup feature for people who encounter this problem.

For those of you that it's happening to, when you end up with an "empty" bookmarks.html is the size 0kb or does it still have some measure of size?  If you view the html in a document editor does it have any characters to it?  If so can you post the contents of it please?
(In reply to comment #18)
> This isn't a regular bug that happens to everyone, also there is a bookmarks
> backup feature for people who encounter this problem.

You are wrong. This is a bug that happens to everyone if they follow the steps to make it happen.

> For those of you that it's happening to, when you end up with an "empty"
> bookmarks.html is the size 0kb or does it still have some measure of size?  If
> you view the html in a document editor does it have any characters to it?  If
> so can you post the contents of it please?

You can try it for yourself:
Run Firefox
Fill up the partition where the bookmarks are until there in no space available.
Add or remove bookmarks.
Quit Firefox
You just have lost your bookmarks.
(Try the same with MSIE and you will see that MSIE won't corrupt your bookmarks)
David - first of all this is a seamonkey bug, not a firefox bug (although is this a core issue or no?)

secondly, your steps to reproduce are not the issue for everyone this is happening to, and is probably a different bug.
This bug occurs too in 2.0.0.0 versioh of Firefox.
It may be linked to a lack of memory of disk (but on my disk, there remain 700M)
When examining bookmark history:
Bookmarks-yesterday is 144k big, full of 0's
Bookmarks-daybefore is 144k big, correct

bookmark.html itself is normal 1k but empty (with default values)

When I got the problem (2 times in a month), I had not modified bookmarks recently.

No comment in more than a year. I suppose that a "dataloss" bug is severe enough to deserve fixing, even in Branch builds and even if it isn't clear that Trunk builds won't get a different bookmarks backend within the next year.
Hardware: PC → All
This bug concerns the old bookmarks.html code in XPFE. Both Firefox and SeaMonkey have been using the (new) Places implementation for some time now. Closing this obsolete bug.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.