Open Opened 13 years ago Updated 3 years ago

# "Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later." Possibly caused by too many file handles in use.

x86
Windows XP
Not set
major

NEW

## Attachments

### (11 files)

 26.83 KB, image/png Details 22.12 KB, image/png Details 105.62 KB, image/png Details 36.02 KB, image/png Details 466.98 KB, image/png Details 124.81 KB, image/png Details 25.60 KB, image/png Details 108.51 KB, text/plain Details 44.48 KB, image/png Details 3.31 MB, application/gzip Details 16.34 KB, application/gzip Details
User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; MSN Optimized;US)
Build Identifier: 8.0b6 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090408 Eudora/3.0b2

The following dialog appears when I click on the address book icon:

Reproducible: Always

Steps to Reproduce:
1.  Click on Address book icon.

Address Book should have opened.  If you try to add an address contact, you cannot as there is no address book that is loaded.
I have tried doing everything that I found in other Bug Reports.  This problem has been occurring for several days now.  I am unable to have my addresses automatically load.
(In reply to comment #1)
> I have tried doing everything that I found in other Bug Reports.  This problem
> has been occurring for several days now.  I am unable to have my addresses

Have you tried verify that you have read/write access to that file and that the file is not damaged? You can determine where the file is located by looking at the "Server Settings" options (Tools->Account Settings->[account]->Server Settings). The "Local Directory" shown toward the bottom of that panel shows you where the files are located.

Matt
That is the first thing I did.  I have played around with this even more.  I created a new profile altogether.  I copied my mail folders.  This way I had a brand new address book totally blank where as the first time it had been populated through an import from Eudora 7.

The issue has popped up yet again.  I have also gone into Symantec and told it to exclude .mab file extensions.
Attachment #381180 - Attachment description: Security Tab of abook.mab → Screen Shot of abook.mab Security Attributes Tab
Sometimes, and not knowing how and why, the address book shows actual books, but most of the time it shows blank.
From my untrained eye it doesn't appear that the contents are damaged.  And as you can see there are some entires yet nothing appears when you open the address book through the GUI.
Do you see the same problem when using Thunderbird 3.0b2? See http://www.mozillamessaging.com/en-US/thunderbird/early_releases/downloads/ for the installer. It will use the same data as Eudora 8 so no importing or anything will be required.

Matt
Address Book error still exists.
The address book under the profile for my wife works just fine.
(In reply to comment #9)
> Created an attachment (id=381204) [details]
> Screen Shot of Thunderbird 3.0b2
>
> Address Book error still exists.

OK, then I am going to assign this to Thunderbird. They might have seen this before and have a better idea how to address this.

Matt
Assignee: mozilla-bugs → nobody
Product: Penelope → Thunderbird
Version: unspecified → Trunk
Bug summary says abook-1.mab, but comment #0 and screen shot says abook.mab.
Which? Problem occurred on both abook.mab and abook-1.mab?

Same problem as Bug 391263? Or problem after problem of Bug 391263?
Check address book related setting via Config Editor.
There was a point where I tried to create another address book to solve the problem.  That was on the default profile I had.  I then created a new profile and migrated all of my mail in the local folders over to the new profile to see if that could be a potential fix.  The issue now is only with abook.mab.  I am sorry for the confusion, but I guess you could say the abook-1.mab was also an issue.
I filtered using addr in the configuration editor.
I've had the same problem with a french version of Thunderbird, with the exact same error message which says :

"Impossible de charger le fichier de carnet d'adresses abook.mab. Il est peut-être en lecture seule ou verrouillé par une autre application. Veuillez réessayer plus tard."

I'm not used to open root or system files and modify it.
So I tried to uninstall and then reinstall Thunderbird (v. 2.0.0.23), but nothing improved...
(In reply to comment #14)
> Screen Shot of Thunderbird 3.0b2 Config Editor for Address Book Entries
> I filtered using addr in the configuration editor.

What is you purpose to show us Config Editor display after filter by 'addr'?
As seen in Bug 391263, Tb's address books are defined in ldap_2.servers.<name>.xxx.
Check at least next entries for all address books defined by your Tb.
> ldap_2.servers.<name>.description
> ldap_2.servers.<name>.filename
> ldap_2.servers.<name>.uri       (URL if LDAP server)
Check whether funny setting like next exist or not first.
Same file name is set in multiple ....filename entry.
And check file pointed in it exists or not, read only or not, etc.
muntada (and others) do you run Google Desktop and let it index e-mail?
Whiteboard: closeme 2010-07-15
No, I do not.
Whiteboard: closeme 2010-07-15
muntada, did you ever get this sorted out?
Whiteboard: [closeme 2012-08-01]
I get the apparently same problem:

Reproducible: Always

Steps to Reproduce:
1. Open Thunderbird
2. Start a new message
3. Enter an e-mail address - typing one letter suffices to get the message.
4. then any e-mail I type appears in red=unrecognized;
2bis. At any rate my address book appears empty and no new contact can be added.

I checked that my abook.mab is not read-only and not locked by another program (I also restarted Windows, to no avail; temporarily deactivated my avast! antivirus, no avail either).

Its contents look normal (as far as I can tell, knowing about nothing about its format).

I tried to delete/rename it out the way, but no new abook.mab appeared, and Thunderbird then barked on history.mab (same error message).

I tried to replace abook.mab with an older (2008) backup, and with an empty file, and got the same error message in both cases (on abook.mab).

In the process of these tests, a few empty (0-byte) backups were created: abook.map.bak, abook.mab-1.bak, history.mab.bak, etc.

Using SysInternal's Process Monitor, I see attempts to open abook.mab that appear to succeed (the file was present). Two of them get an 'FAST IO DISALLOWED' status, but all others get SUCCESS (including a call to CreateFile - but maybe only readonly, will have to check again, more details later). So I guess the problem is *not* that Thunderbird can't access the file.

The problem appeared yesterday. Lacking room on my system disk C:, I had done some cleanup, including (as far as I remember) in the *Firefox* profile folder, but not in the Thunderbird profile folder. So perhaps is something *else* missing/corrupted ?
Perhaps not obvious from my previous message, the error message I get is of course the same "Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later."
Whiteboard: [closeme 2012-08-01]
The problem appears to be solved now, for me.

A possible (IMO rather likely) cause is that I had too many folders, more specifically too many .msf files in my profile (518 at the highest). As witnessed with Process Explorer, Thunderbird keeps a Windows handle on each of these files (even those hidden in collapsed parts of the tree view). Maybe this way it reaches some process-wide or session-wide limit, which may well cause an obscure failure at opening yet another file, say abook.mab.

Reducing the number of folders drastically (to about 300) appeared to solve the problem (as well as other problems I began encountering with folders after the initial abook.mab trouble). So far so good for the previous few days.

(The other problems: unexplained crashes; also on opening specific folders, the list of messages appeared blank, Thunderbird appeared to rebuild the corresponding .msf file but without result. The .msf file indeed has disappeared and no new one appeared. Manually asking Th to rebuild the folder got no better results. I had the same problem with 2 different folders. All solved the moment I reduced my total number of folders.)

As for a fix, I can live with a limit of 500 subfolders, if that's indeed the cause, but then I'd like to suggest at least:
- warning the user when his count of subfolders comes close to the limit;
- if possible, issuing a more specific error message when such failures happen.
version 15 containing the fix for bug 723248 should get you out of trouble.  It should be released in little more than a week
Depends on: 723248
Summary: Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later. → "Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later." Too many file handles in use.
Is problem still present after version 15 fix?
Flags: needinfo?(fvdp.public)
Whiteboard: closeme INCO 2013-06-01
I get this error every time I start TB 17.0.5. Is it possible that it's due to an add-on?
Flags: needinfo?(fvdp.public)
(In reply to aj from comment #25)
> I get this error every time I start TB 17.0.5. Is it possible that it's due
Maybe, try to start Thunderbird in Safe Mode - https://support.mozillamessaging.com/en-US/kb/safe-mode
I get this in 17.0.6 all the time. Even if I start in safe mode!
However, it always loads and seems to work.

But this also seems to be linked to the spell checker. Since this has happened, every word is flagged by the spell checker.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: closeme INCO 2013-06-01
What is number of open thunderbird files?
lsof -p <pid>
you'll need to get the process id
ps -ef | grep thunderbird

And total number for the OS?
lsof | wc -l
Flags: needinfo?(jamesrome)
(In reply to Phoenix from comment #24)
> Is problem still present after version 15 fix?

Frédéric?
Flags: needinfo?(fvdp.public)
(In reply to Phoenix from comment #26)
> (In reply to aj from comment #25)
> > I get this error every time I start TB 17.0.5. Is it possible that it's due
> Maybe, try to start Thunderbird in Safe Mode -
> https://support.mozillamessaging.com/en-US/kb/safe-mode

aj?

And see comment 26
Flags: needinfo?(aj)
Flags: needinfo?(jamesrome)
On my mac,
jarmac:~ jar$lsof | wc -l 5903 I still have the problem in safe mode. And also, every word in outgoing messages is flagged as a spelling error. Flags: needinfo?(fvdp.public) Flags: needinfo?(aj) Oops, I unflagged the neededinfo for others by confusion. (In reply to James Rome from comment #31) > Created attachment 752939 [details] > The output from lsof -p 24860 >> tbfilehandle.txt ~900 files, 90+% of which is font related only ~12 mail folders open, which is good. what does is reported by ulimit -a Flags: needinfo?(jamesrome) jarmac:~ jar$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 709
virtual memory          (kbytes, -v) unlimited
jarmac:~ jar$ Flags: needinfo?(jamesrome) tb v17.0.6 imac os/x v10.8.4 I am having the same problem. I get the same message about not opening a file. There are about a dozen address book files of the form <abook-NN.mab>; TB throws up its hands after failing to load the first one it tries, usually <abook-3.mab>. It certainly does not "Try again later." I would really like to have access to those address books again. And at the same time the address book problem showed up, so did the Speller problem of underlining everything as misspelled. I have tried: - rebooting - copying a book file to another name - changing the permissions to 666 - completely changing the filename - starting in Safe Mode This is also related somehow to <https://bugzilla.mozilla.org/show_bug.cgi?id=855751> It all started about the same time 2 - 3 months ago. Its still happening to me. I reduced the cached server connections to 2/server. Do you mean that it still happens with greater-than-2 connections per server but not with 2 or less? Or that it happens regardless? Or that it became bearable (usually get the Address Books)? And where is the setting for the cached connections? The cached connections setting is only for IMAP, and is in the advances server settings. But the error happens regardless of the number. However, irregardless, the address book always seems to work for me. But I do get the spell checker errors. Arrgh! I would swear that even starting in Safe Mode the Address Books were not loaded. I went back to experiment some more and, hmph!, the books loaded in Safe Mode. I then restarted in standard mode (the books did not load), removed some disabled extensions, and disabled the remaining. The books loaded. I enabled each extension one at a time, restarting, waiting for the one that would block the address books. None of them did. So it was one of the disabled extensions that I had removed: - lightning - provider for google - test pilot for thunderbird - saved password editor And they had to be *removed*, not just disabled. indeed cached connections cannot have anything to do with this issue. I think Frédéric's issue was fixed by bug bug 723248 or caused by an addon. Note to Frédéric - there is no folder limit. But bug 767210 is an example where a similar but different message is seen for a user with many folders on Mac. Jim's case apparently is also an addon. xref bug 855751. Note, for reasons I don't understand other users have reported cases odd issues related to safe mode, such one run of safe mode permanently solving a problem without removing or disabling any addons, or safe mode not solving a problem but *removing* an addon did. This leaves James, aj and muntada. muntada is gone and thus we have no way of knowing what his issue was or whether it could happen in a current version. But I think the odds are exceedingly low. Thus I think we should close this bug, and anyone who still gets the error should file a new bug or support topic at getsatisfaction.com/mozilla_messaging/ and post a link to it here in this bug report. Further food for thought, address book here is typically (if not always) the VICTIM, not the cause of users seeing this error message. That said, perhaps the error message could be improved, or made more specific if it is possible See Also: → 717574 Summary: "Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later." Too many file handles in use. → "Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later." Possibly caused by too many file handles in use. there are a few examples in support forum I've tagged as https://getsatisfaction.com/mozilla_messaging/tags/unable_to_load_address_book_file Whiteboard: [gs] Thanks Wayne. I get the error even in safe mode but not every time (four out of five just now). It seems more or less random which of the .mab files it complains about. They are both 644: AJs-MacBook-Pro:4n4i7xq7.default aj$ ls -la *.mab
-rw-r--r--@ 1 aj  staff   1373 30 Apr 10:48 abook.mab
-rw-r--r--@ 1 aj  staff  30610 10 Jun 22:44 history.mab

Any further thoughts? At this point I've more or less given up on TBs address book and spell checking.
Given all the people that are seeing this problem, it seems to me that it is necessary to find out what is causing this. If it is an addon, which one, and why? Then the addon developers can be given advice on how to avoid the problem.

If Thunderbird would fix the multiple password bug, I could get rid of StartupMaster, which always loads before the error message.
Here's a bizarre twist on this issue:

So all that work looking for a suspect addon was a waste of time. There is no suspect addon. It is some other problem with TB, apparently with startup.
(In reply to James Rome from comment #44)
> Given all the people that are seeing this problem, it seems to me that it is
> necessary to find out what is causing this. If it is an addon, which one,
> and why? Then the addon developers can be given advice on how to avoid the
> problem.

Indeed. And anyone is free to guide the users in getsatisfaction to a resolution, now that I have identified the victims.

(In reply to Jim Moe from comment #45)
> So all that work looking for a suspect addon was a waste of time. There is
> no suspect addon. It is some other problem with TB, apparently with startup.

Possibly.  But my inclined to think otherwise.  IMO the odds at better than even that an addon triggered this.  You are not the first person to have discovered that some oddity related to safe mode or deleting an addon solved a problem, when safe mode alone was not enough. (which does indeed beg the question of why wasn't safe mode enough)
> You are not the first person to have discovered
> that some oddity related to safe mode [...]

This was not about safe mode or deleting addons. It is specifically how TB is started.
- If TB is started after enabling OR disabling (it does not matter which) an addon by using the "Restart Now" button, the books load, every time.
- Even if an addon is en-/disabled, if TB is shutdown (quit) then started by clicking on its icon, the books do NOT load.
(In reply to Jim Moe from comment #47)
> > You are not the first person to have discovered
> > that some oddity related to safe mode [...]
>
> This was not about safe mode or deleting addons. It is specifically how TB
> is started.

> - If TB is started after enabling OR disabling (it does not matter which) an
> addon by using the "Restart Now" button, the books load, every time.

Restart Now *is* safe mode

> - Even if an addon is en-/disabled, if TB is shutdown (quit) then started by
> clicking on its icon, the books do NOT load.
And what if you start in safe mode from the icon per https://support.mozillamessaging.com/en-US/kb/safe-mode#w_how-to-start-thunderbird-in-safe-mode ?
(In reply to Wayne Mery (:wsmwk) from comment #48)
> Restart Now *is* safe mode

You're kidding aren't you? After a Restart Now my add-ons are still 'active'.
(In reply to aj from comment #49)
> (In reply to Wayne Mery (:wsmwk) from comment #48)
> > Restart Now *is* safe mode
>
> You're kidding aren't you? After a Restart Now my add-ons are still 'active'.

surely you jest :)

no, I am not kidding.  Please attach to bug report .png screen shots of the Restart Now dialog and the tools | addons that you think are still active after restart
The image shows the typical Restart Now button for addons. After the restart only that addon is disable, hence, not safe mode.
sorry for confusion - my bad. I'm thinking "Help | Restart ...".  From now on, ignore everything I write :)

So, every time you start thunderbird from the addon manager with "restart now" the address books load?
Yes.
I have the same problem.
Sorry for the late answer: I no longer have the problem (using Thunderbird 17.0.6) *but* this is likely irrelevant: I solved the problem by cutting down my directory hierarchy to under 300 folders, and that worked fine even with the originally affected Thunderbird version.
I may try to create 200 more dummy folders and see what happens...
Well, will somebody help this dummy? I still have the problem after updating! *pulling my hair out cause this is annoying*
I recently upgraded to v24. This problem was not affected fir fixed in any way.

And the folder settings continue to decay to default settings.

So, basically, nothing new in v24 is of any use to me since all of the old problems remain.
Only going on-line once TB has started seems to work around this issue for me.

Thunderbird -> Preferences -> Advanced -> Offline... -> Ask me for online state at startup

And then untick: File -> Offline -> Work Offline
(In reply to James Rome from comment #39)
> The cached connections setting is only for IMAP, and is in the advances
> server settings. But the error happens regardless of the number.
>
> However, irregardless, the address book always seems to work for me. But I
> do get the spell checker errors.

If you are out of fd (file descriptors - ref, then the spell dictionary file can't open, just like AB files can't open.

You're running OS X 10.8.4?
And, what addons are running when you are in safe mode?
Do you concur with Jim, that restart from the addon manager seems to avoid the problem?
Flags: needinfo?(jamesrome)
(In reply to aj from comment #59)
> Only going on-line once TB has started seems to work around this issue for
> me.
>
> Thunderbird -> Preferences -> Advanced -> Offline... -> Ask me for online
> state at startup
>
> And then untick: File -> Offline -> Work Offline

starting offline helps because then network the mail folders won't open at startup. they open when you go online
Mac users may be particularly prone to have this problem, because, as in James' case, hundreds of font files stay open at startup.

Frédéric, Vanessa, are you also on Mac?
Flags: needinfo?(vfoster001)
Flags: needinfo?(fvdp.public)
No, I'm running Win7.
Flags: needinfo?(vfoster001)
I haven't added any new add-ons for a few years. I don't have many. Every time I start TB it shows the address book "unable to load..." but the address book loads. All I do is X out of the error message.
My 13 accounts are all IMAP. But this address book problem completely disappeared when I created a new profile.
Flags: needinfo?(jamesrome)
(In reply to Jim Moe from comment #40)
> Arrgh! I would swear that even starting in Safe Mode the Address Books
> were not loaded. I went back to experiment some more and, hmph!, the
> books loaded in Safe Mode.
>
I can confirm this behaviour. In the French Mozilla forum I'm trying to help a Mac user who "lost" her address books after changing the hard drive of her MacBook Pro and upgrading from OS X 10.5 to 10.6 and from TB 16.x to TB 24.1.1.

The Address Book window was completely blank, no addresses were displayed and no Address Books in the Directory Pane.
In the Contact Sidebar of a Compose window addresses were loaded but she couldn't choose another AB and address autocompletion didn't work.

I asked her to disable both of her extensions, "British English Dictionary" and "Test Pilot", and restart TB. All AB were loaded.
But on the following TB start the error messages reappeared and no AB were loaded.
Actually, whenever she launches TB in safe mode, she gets no error messages and the AB are loaded.
There is no userChrome.css file in her TB profile and "layers.acceleration.disabled" is set to "true" in about:config.

Before we tried safe mode she made another confusing experience:
installed v17.0.8 instead of v24.1.1 => no AB, updated to v24.1.1 via "About Thunderbird" -> "Check for Updates" => AB were loaded (!!), restarted TB 24 => no AB!
(In reply to Eckard Berberich from comment #66)
> installed v17.0.8 instead of v24.1.1 => no AB, updated to v24.1.1 via "About
> Thunderbird" -> "Check for Updates" => AB were loaded (!!), restarted TB 24
> => no AB!

This is odd, but consistent with another user who reports the same - so restart from THunderbird (including after disabling one or more addons?) somehow affects this issue
Odd, indeed. I just updated v24.1.1 and still the same error. This is a real bugger.
any thoughts as to why file loading should be different for a process loaded via  thunderbird ("restart"), vs thunderbird cold from command line or start menu?
Flags: needinfo?(mkmelin+mozilla)
> Flags: needinfo?(m-wada@usa.com)
Wayne Mery, what do you want to me, even though no answer to my question of comment #16 from any of bug opener and "me too" posters in this bug?

Bug 391263, which I already pointd in comment #12, surely occurs if some conditions are met.
1. There is no abook.mab file yet.
2. Before abook.mab file is created, create LDAP server via non Address Book UI.
(before first Address Book open after profile creation)
=> LDAP server uses abook.mab and creates abook.mab file.
3. Because Personal Address book is defined as filename=abook.mab in mail-something.js
by default, Personal Address Book also uses abook.mab file.
4. Because 2 address books try to use same abook.mab file, anything bad may occur.
5. When double-book'ed LDAP server is deleted, the abook.mab file is already used by
Personal Address Book, then abook.mab file is perhaps not deleted.
So, if "LDAP server who used abook.mab too" is deleted and re-defined,
abook-Suffix.mab is used for the re-defined LDAP server or address book,
then "double-booking status of abook.mab file" vanishes.
This is because Tb never uses existent abook.mab/abook-Suffix.mab file
for newly created LDAP server or Adress Book, and because Tb deletes *.mab file
only when deletion of LDAP server/Address Book.

I believe "problem analysis in this bug without ruling out such problem first" is merely waisting of time.
Please note that last response from bug opener is;
> Summary:
>
> Comment #18 on 2010-07-01 19:04:21 PDT
>   No, I do not.
(I have no idea)
Flags: needinfo?(mkmelin+mozilla)
Wayne, I still have the same problem so I just click the box closed and go on with my email business.
(In reply to WADA from comment #70)
> Wayne Mery, what do you want to me,

Because I value your experience and opinion.  Yes, my question might not be relevant to the original poster or your line of thought on solutions for this problem. But a) there are clearly users who do not have have the same experience of the OP yet have the same symptom (eg Frédéric), and b) there are credible reports of users * restarting* in safe mode and then not seeing the problem (even though they have no addons which would impact on the problem or how many files/ might be open) - so this may help inform what the cause of the problem.

> even though no answer to my question of
> comment #16 from any of bug opener and "me too" posters in this bug?

I don't see how that is relevant to my question - I can't control who answers and how they answer. But I suspect the reporter is gone (Abdul indeed has msged me that he no longer users Thunderbird), and it is easy for users new to the bug to miss earlier comments/questions as you know.
Flags: needinfo?(fvdp.public)
(In reply to Vanessa from comment #72)
> Wayne, I still have the same problem so I just click the box closed and go
> on with my email business.

Please see Wada's questions in comment 25 and comment 70
Whiteboard: [gs] → [gs][workaround on Mac: reduce number of system font files)
There is also (I forgot) bug 717574 - Saved Search stops working and causes errors (like "Unable to Load Address Book File" and lost msf files) when there are a sufficient number of searched mailboxes and installed extensions. hitting OS file descriptor limits. Which can affect both Mac and non-Mac users. But more likely to impact higher percent of Mac IMO.
This issue was resolved for me by the recent v24.4 release. Before that release my address book or my spell check worked but rarely (if ever) both. Now everything works. :)
(In reply to AJ from comment #76)
> This issue was resolved for me by the recent v24.4 release. Before that
> release my address book or my spell check worked but rarely (if ever) both.
> Now everything works. :)

That is VERY interesting.  Thanks for commenting AJ.

If you reinstall https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.3.0/ does the problem then reappear?

(reminder to self, that this is interesting...)
(In reply to AJ from comment #59)
> Only going on-line once TB has started seems to work around this issue for
> me.  Thunderbird -> Preferences -> Advanced -> Offline... -> Ask me for online
> state at startup.  And then untick: File -> Offline -> Work Offline
Flags: needinfo?(aj)
I uninstalled, re-installed, new update, still the same problem.
Am I supposed to do or make some kind of folder>>>?

Wayne Mery, what do you want to me, even though no answer to my question of comment #16 from any of bug opener and "me too" posters in this bug?

Bug 391263, which I already pointd in comment #12, surely occurs if some conditions are met.
1. There is no abook.mab file yet.
2. Before abook.mab file is created, create LDAP server via non Address Book UI.
(before first Address Book open after profile creation)
=> LDAP server uses abook.mab and creates abook.mab file.
3. Because Personal Address book is defined as filename=abook.mab in mail-something.js
by default, Personal Address Book also uses abook.mab file.
4. Because 2 address books try to use same abook.mab file, anything bad may occur.
5. When double-book'ed LDAP server is deleted, the abook.mab file is already used by
Personal Address Book, then abook.mab file is perhaps not deleted.
So, if "LDAP server who used abook.mab too" is deleted and re-defined,
abook-Suffix.mab is used for the re-defined LDAP server or address book,
then "double-booking status of abook.mab file" vanishes.
This is because Tb never uses existent abook.mab/abook-Suffix.mab file
for newly created LDAP server or Adress Book, and because Tb deletes *.mab file
only when deletion of LDAP server/Address Book.
(In reply to Vanessa from comment #78)
> I uninstalled, re-installed, new update, still the same problem.
> Am I supposed to do or make some kind of folder>>>?

I see from earlier comments that you're on Windows - I'm on Mac. Sorry - should have mentioned that.
Flags: needinfo?(aj)
(In reply to Wayne Mery (:wsmwk) from comment #77)
> (In reply to AJ from comment #76)
> > This issue was resolved for me by the recent v24.4 release. Before that
> > release my address book or my spell check worked but rarely (if ever) both.
> > Now everything works. :)
> If you reinstall
> https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.3.0/ does
> the problem then reappear?

I'm loathe to fiddle it with now that it's working reliably for the first time in years. Also you told me to ignore everything you write. ;)
I was able to resolve this issue by drastically reducing the number of open folders in Thunderbird. lsof -p showed about 900 files, I moved two large hierarchies out of my profile, opened thunderbird again, lsof -o shows about 700 files and address book loads correctly.

Things I tried that DID NOT WORK (WADA):
1) removed abook-1.mab
2) edit prefs.js and rename the abook.mab entry for LDAP from abook.mab to something non-existent, like abook-77.mab
3) increasing the number of open files in /etc/profile.

I am on a Mac, Thunderbird 24.4. The only extension is lightning.

sean
(In reply to Sean Fulton from comment #81)
> Things I tried that DID NOT WORK (WADA):
> 1) removed abook-1.mab
> 2) edit prefs.js and rename the abook.mab entry for LDAP from abook.mab to
> something non-existent, like abook-77.mab
> 3) increasing the number of open files in /etc/profile.

???

> 2) edit prefs.js and rename the abook.mab entry for LDAP from abook.mab to (snip)

Was abook.mab file pointed by whom? An LDAP server? Personsl addressbook?
As written in pointed bug, definition of personal address book doesn't appear in prefs.js. So, Config Editor is needed to see personal addressbook definition.

> 1) removed abook-1.mab

Which addressbook/LDAP server pointed abook-1.mab file?

> 1) removed abook-1.mab
> rename the abook.mab entry for LDAP from abook.mab to something non-existent, like abook-77.mab

What you did is merely a manual corruption of Addressbook/LDAP server definition, isn't it?

Here is what was in my prefs.js:

user_pref("ldap_2.servers.test.filename", "abook.mab");

So, based on what I could cipher out of your various posts, It seemed to me that the ldap server and the collected_address book could be creating contention. So I changed the value in prefs.js to something non-existent and that didn't impact the the problem.

But what DID impact the problem was reducing the number of folders ....

sean
(In reply to Sean Fulton from comment #83)
> Here is what was in my prefs.js:
> user_pref("ldap_2.servers.test.filename", "abook.mab");

> user_pref("ldap_2.servers.test.filename", "abook.mab");

Have you read my previous comment? Have you read and understood bug which I already pointed multiple times?
Default mab file of main Personal Address Book is as follows.
> ldap_2.servers.pab.filename;abook.mab
As I repeatedly stated, this is not held in prefs.js file. This is defined in mailnews.js which is for deffault value. So, it can be viewed via Config Editor only.

> user_pref("ldap_2.servers.test.filename", "abook.mab");

How, when, did you define/create this address book?
Is this local address book? Or LDAP server?
Did you intentionally use abook.mab file for this addressbook?
If yes, did you change definition of ldap_2.servers.pab.filename by yourself?

> But what DID impact the problem was reducing the number of folders ....

If problem due to number of file handles, why problem occurs only on abook.mab and problem never occurs on any abook-N.mab file?
Do you correctly understand "what you did" by your "reducing the number of folders"?
If you didn't change ldap_2.servers.pab.filename setting even though you use user_pref("ldap_2.servers.test.filename", "abook.mab");, it's merely that you successfully reproduced bug which I pointed multiple times, isn't it?

Does your following in your comment #81 mean that you changed user_pref("ldap_2.servers.test.filename", "abook.mab"); to user_pref("ldap_2.servers.test.filename", "abook-77.mab"); in prefs.js file?
> 2) edit prefs.js and rename the abook.mab entry for LDAP from abook.mab to
> something non-existent, like abook-77.mab
If yes, and if you didn't alter ldap_2.servers.pab.filename, you fortunately did recovery procedure from problem of bug 391263 correctly.
Who/Why added pretty misleading "Too many file handles in use" to important bug summary, without surely ruling out problem due to bug 391263?
I reduced the number of folders and the problem went away. I don't know if the problem never occurs on any abook-N.mab files because abook.mab is the problem.

I did not create this LDAP address book at any time that I know of. We do not use LDAP.

sean
(In reply to Sean Fulton from comment #86)
> I did not create this LDAP address book at any time that I know of. We do not use LDAP.

If so, what does following in your comment #81 mean?
> 2) edit prefs.js and rename the abook.mab entry for LDAP from abook.mab to something non-existent, like abook-77.mab
What actions on what entry in prefs.js did you do when what was set in prefs.js setting?
Why can a "LDAP server defintion" be generated even though you never request creation of it via Tb's UI or by install of addon which you intentionally did?
I did not set up ldap--we do not use ldap. Based on your comments
i edited prefs.js with vi, found that line and changed it as i indicated
very clearly in my comment. Then i started
thundefbird and got the error.  Ldap does not appear to be related.

Then i removed about 200 folders as suggested by another
poster, started thunderbird and it works.

You seem to be focusing on something that for me had nothing to
do with the issue.  I am just posting to help others who may have the same
problem.

FYI we had this address book issue with thundrrbird17.  It went away
when we upgraded to 24 but then it reappeared.  Removing some folders helped.

Sean

I'm only posting to try to help others who have this proble
Just to confirm this behavior. When I "removed" the mail folders, I followed the following procedure:

1) Quit Thunderbird
2) Open Shell window, navigate to Thunderbird Profile folder, then to Mail folder.
3) Identify folders to remove
4) MOVED folders to $HOME/Documents/hold 5) Start THunderbird ADDRESS BOOK WORKS! To confirm, I put them back: 1) Quit Thunderbird 2) In Shell Window, mv$HOME/Documents/hold/* back into the Mail folder in my Thunderbird profile
3) Start Thunderbird

To double-check:
1) Again, quit Thunderbird
2) In the shell window, move the folders again to $HOME/Documents/hold 3) Start Thunderbird ADDRESS BOOK WORKS! sean Address book works with:$  lsof -p 779 | wc -l
767

$ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 4096 pipe size (512 bytes, -p) 1 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 709 virtual memory (kbytes, -v) unlimited I am wondering if it is max user processes instead of open files?? RE comment 85: "Who/Why added pretty misleading "Too many file handles in use..." The problem with local address books (abook-N.mab) is the same as in issue #855751: the system runs out of resources for opening files. Seem comment 27 there. (In reply to Sean Fulton from comment #89) > Just to confirm this behavior. When I "removed" the mail folders, I followed > the following procedure: > > 1) Quit Thunderbird > 2) Open Shell window, navigate to Thunderbird Profile folder, then to Mail > folder. > 3) Identify folders to remove > 4) MOVED folders to$HOME/Documents/hold
> 5) Start THunderbird
>
>
> To confirm, I put them back:
> 1) Quit Thunderbird
> 2) In Shell Window, mv $HOME/Documents/hold/* back into the Mail folder in > my Thunderbird profile > 3) Start Thunderbird > > ERROR ABOUT ADDRESS BOOK NOT LOADING BECAUSE IT IS IN USE. > > To double-check: > 1) Again, quit Thunderbird > 2) In the shell window, move the folders again to$HOME/Documents/hold
> 3) Start Thunderbird
>
>
> sean

Aha!
Thanks for very clear "[Steps to reproduce problem]".
"Number of files under mail directory of each accout" * "number of accounts" is relevant.
Because any file under mail directory for an account, except special file such as popstate.dat, msgFlterRules,dat, FolderName.sbd, is a msgStore file for local mail folder, Tb uses all files as msgStore file, and Tb creates xxx.msf for file named xxx, and xxx.yyy.msf for xxx.yyy.
This is done by folder rediscovery process after restart of Tb, and it's done before first addressbook open after restart, and first address book open is done on Personal AddressBook, and file for Personal Addressbook is abook.mab, and error message is shown if "file open failure of address book file".
So, if file handle exausted by folder rediscovery, "open failure due to file handle limit" occurs on abook.mab, and "open failure due to file handle limit" is reported on abook.mab.

Phenomenon is: if all file handle is consumed by folder files during restart of Tb, "open failure due to file handle shortage" is not reported on mail folder file, and "open error due to file handle shortage" is always reported on abook.mab.
In other words: if file handle shortage occurs during restart of Tb before open of abook.mab, open of abook.mab failes due to file handle shortage.

> ldap_2.servers.pab.filename = abook.mab
> user_pref("ldap_2.servers.test.filename", "abook.mab");
=> double booking of abook.mab
Access to Personal Address Book and access to "test" interferes each other, because same abook.mab is used. External symptom may be overide of data, but external symptom may be file open failure message.
Because you already changed to user_pref("ldap_2.servers.test.filename", "abook-77.mab");, this "double booking of abook.mab" was already removed before you did above steps, so "problem due to bug 391263" is surely ruled out in your case.
And, because "open of Personal Address Book" is always done first and because "open of test addressbook" is never tried when this bug occurs, bug 391263 is essentially irrelevant to this bug. This bug occurs regardless of "double booking of abook.mab file".

> To confirm, I put them back:
> 1) Quit Thunderbird
> 2) In Shell Window, mv $HOME/Documents/hold/* back into the Mail folder in > my Thunderbird profile > 3) Start Thunderbird > ERROR ABOUT ADDRESS BOOK NOT LOADING BECAUSE IT IS IN USE. After this, xxx.msf file is created if it doesn't exist, and "file path for mail folder" is written in panacea.dat(association between file path and folder name is cached), and it's read from panacea.dat by next restart of Tb. Does "open failure of abook.mab" reported by "shutdown Tb, restart Tb" after above error due to many folder files? I'm not sure I understand your question. I completely shut down Thunderbird before making any changes, so the problem only happens after starting, and only after I add the files back. My question though is how we run out of file descriptors if I changed my profile at login to open 4096. Previous to that my profile allowed only 256. So with thunderbird taking between 700 and 900 open files (it was failing with 820 or so), is there some limit hard-coded into TB that is causing the problem? Also, we're still having a related bug that reports an error filtering messages into the Inbox, even after reducing the number of files and rebuilding the Inbox.msf. Someone on that thread suggested the problem was too many file descriptors, but we are still experiencing that problem on startup only. ( I don't have that bug report handy). (In reply to Sean Fulton from comment #93) My previous qquestion is; If Tb is restarted with consistent panacea.dat, does problem occur? After you added files, panacea.dat file content is chsnged to obsolete. So, I want to know this bug occurs wth consistent/valid panace.dat content, or not. 1. add files => mismatch between actual files and "path data saved in panacea.dat" is generated 2. restart Tb => panacea.dat is obsolete, so additional jobs are executed during restart 3. terminate Tb => panacea.dat content is kept consistent. 4. restart Tb => restart is done with "actual files == data in panacea.dat" state. View panacea.dat file content by Text Editor, please. Majority of data is table of "relation between absolute path of file <-> mail folder name" (In reply to Sean Fulton from comment #90) >$ ulimit -a
> open files                      (-n) 4096
(In reply to Sean Fulton from comment #93)
> (it was failing with 820 or so),

In OS, "clean up of file handle for closed file" may not be executed yet after file close by application.

If ordinal mail folder open, Tb closes xxx file after read of each mail data, and Tb closes xxx.msf file according to mail.db.idle_limit, and tries to limit "number of opened db" according to mail.db.max_open.
So, large "total number of folders in Tb" doesn't usually affect on "file handle limit" relevant issue.
However, upon restart of Tb, Tb scans all mail directory(Mail, Mail/<server>, Mail/<server>/Folder, Mail/<server>/Folder.sbd/Sub, ...), and creates xxx.yyy.zzz.msf if xxx.yyy.zzz exists but xxx.yyy.zzz.msf doesn't exist.
Even when all .../parent.sbd/folder and .../parent.sbd/folder.msf at all directory hiearchy level is accessed, if file is closed after each access to file(file open), "number of used file handle" won't exceeds "open files=4096" limit.
This bug indicates that Tb doesn't close file which was accessed during folder rediscovery after each file access. It may be "bulk open", "bulk access", "bulk close" like one, instead of "for(each folder){open file;access file;close file;}" like one.

Can you get file access log during restart of Tb? Does Tb close each file after each access?

> Also, we're still having a related bug that reports an error filtering messages into the Inbox,
> even after reducing the number of files and rebuilding the Inbox.msf.

Problem like bug 931303? or problem like bug 917769? or problem like 482836? or problem like bug 905576?
These are problems related to "outdated msf condition".
As seen in log data obtained in bug 905576, problem is frequently observed after short period from restart of Tb. A reason of "startup only problem" is;
While Tb is sleeping(terminated at last night), mails are added to Mbox of POP3 servers.
"Number of added mails while Tb is sleeping" is frequently greater than or equal to one.
At morning, by "check new messages upon start up", new mails of all POP3 account is downloaded.
So, "filter move" frequently happens just after restart of Tb in usual environment.
Because "filter move" is relevant to problem, probability of "phenomenon is observed" is high
when Tb is restarted.
(In reply to Jim Moe from comment #91)
> Seem comment 27 there.
Thanks for pointing.
Following is the comment.
> However, it always loads and seems to work.
I can understand this phenomenon now.
- Because of impab-2.mab case, this case is never "double booking of abook.mab which is abook.mab only
issue".
- Because of "problem during restart only", impab-2.mab is usable after end of restart.
- This phenomenon is explained by "file handle shortage during restart" pretty well.
And if "file handle shortage", "the file handle shortage occurs during restart ONLY" is obvious
by this comment.
Wayne shouldn't have inserted "Possibly" in bug summary. "Possibly" is too weak :-)
Linkify for ease of access : bug 855751
If problem in Tb is relevant to "file handle shortage", "problem is actually caused by file handle shortage or not" is pretty easily determined by merely checking "number of file handles actually consumed by Tb when problem occurs" and by checking "what files does Tb access(do open/close) after restart and before problem occurs".
However, even "actual number of file handles" doesn't look reported before "(it was failing with 820 or so)" in comment #93. Why no one provided such data in this bug for such long time? Because no one asked to provide such data to bug opener and "me too" comment poster in this bug?

FYI.
File access monitor tool.
- Win : Do Google search for "Process Monitor"
- Mac : Even on Mac OS X, such tool is available.
> https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/fs_usage.1.html
> https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/opensnoop.1m.html
- Linux : Many tools are available. You can choose any tool you like.

NSPR log of Tb may be helpful. Because nothing is analyzed yet, following parameter may be better for first screening.
(Win example) SET NSPR_LOG_MODULES=timestamp,all:5.
Because problem during restart, you can terminate Tb when problem occurred. Because timestamp of "proble occured is already known(you saw error message, file access is logged,...), checking "all:5 log around problem" is not so hard for any general user even if log volume is large. Text Editor is usually always available on any PC.
(In reply to AJ from comment #79)
> (In reply to Vanessa from comment #78)
> > I uninstalled, re-installed, new update, still the same problem.
> > Am I supposed to do or make some kind of folder>>>?
>
> I see from earlier comments that you're on Windows - I'm on Mac. Sorry -
> should have mentioned that.

TY AJ
(In reply to Sean Fulton from comment #83)
>
> Here is what was in my prefs.js:
>
> user_pref("ldap_2.servers.test.filename", "abook.mab");
>
> So, based on what I could cipher out of your various posts, It seemed to me
> that the ldap server and the collected_address book could be creating
> contention. So I changed the value in prefs.js to something non-existent and
> that didn't impact the the problem.
>
> But what DID impact the problem was reducing the number of folders ....
>
> sean

Sean,
Can you give me a step by step of how to reduce the number of folders? That is, if this worked. Thank you.
(In reply to Sean Fulton from comment #89)
> Just to confirm this behavior. When I "removed" the mail folders, I followed
> the following procedure:
>
> 1) Quit Thunderbird
> 2) Open Shell window, navigate to Thunderbird Profile folder, then to Mail
> folder.
> 3) Identify folders to remove
> 4) MOVED folders to $HOME/Documents/hold > 5) Start THunderbird > > ADDRESS BOOK WORKS! > > To confirm, I put them back: > 1) Quit Thunderbird > 2) In Shell Window, mv$HOME/Documents/hold/* back into the Mail folder in
> my Thunderbird profile
> 3) Start Thunderbird
>
>
> To double-check:
> 1) Again, quit Thunderbird
> 2) In the shell window, move the folders again to $HOME/Documents/hold > 3) Start Thunderbird > > ADDRESS BOOK WORKS! > > sean Thank you for this post. Sean, You say in step 3) "Identify folders to remove" I do not know which folders I can remove. In the Mail folder I have 5 folders. One of them is named "Local Folders." The next folder is my "pop-server" folder. The next folder is "smart mailboxes." Then a folder named "smart mailboxes-1." And the last folder is named "smart mailboxes-2." So I'm not sure what I need to do. Thank you for your help...Everyone! I am guessing your folders are in the "Local Folders" folder. You can also consolidate folders from within Thunderbird by clicking and dragging messages into folders and then deleting the empty folders. But if you are going to use the shell, make sure you know what you are doing because you can easily lose mail! sean (In reply to Vanessa from comment #101) > In the Mail folder I have 5 folders. > One of them is named "Local Folders." > The next folder is my "pop-server" folder. > The next folder is "smart mailboxes." > Then a folder named "smart mailboxes-1." > And the last folder is named "smart mailboxes-2." Do you use View/Folders/All? (It sound for me so. sounds not "View/Folder/Unified"...) Why "Local Folders" is referred first? Is "Local Folders" shown at top of folder pane? (it seems so...) > I have 5 folders Folders? Accounts? When "Local Folders" is expanded, what mail folders are shown in what order? How about "smart mailboxes." or "smart mailboxes-N." > The next folder is "smart mailboxes." > Then a folder named "smart mailboxes-1." > And the last folder is named "smart mailboxes-2." Why "smart mailboxes.", "smart mailboxes-1.", and "smart mailboxes-2." appears at folder pane... "smart mailboxes."? or ""smart mailboxes"? (actually end with dot?) Anyway, it looks account definitios is broken... (1) Can you show us your current account/server definition? 1. By browser, go http://www.h2.dion.ne.jp/~radon/mozilla/tb-addon/html/Dup_Check_Of_Account.HTML This is my web site. Nothing is sent by this page. Data of your prefs.js is not saved by the page. The web page merely extracts string from your prefs.js text and displays extracted text. 2. Terminate Tb, Edit prefs.js file of Tb in Tb's profile drectory, Select All, Copy, close prefs.js. At the Web page, at left box, Paste, Click button labeled "Do Dup check of pasted prefs.js" 3. See displayed text. hostname, userName etc. is displayed. Show us displayed text, or send it to me via mail if you don't want to open userName to public, or change userName string before show it us. (2) It looks "Local Folders" is set as default account. Do next first. - Account Settings, select your "pop-server", Account Actions -> Set As Default, restart Tb (3) Check mail directory of all accounts. Account Settings, Server Settings of each account, Local Directory: Select string shown at Local Directory: field, Copy, Paste at Text Editor. Obtained lines is path for mail directory of each account(sever). Alternative : Tools/Options/Advanced/General, Config Editor (do Google Search for "Config Edtitor") .directory in Search: field => following is shown. Each entry can be copied to clip board. Do Copy, Paste at Text Editor. mail.server.server#.directory mail.server.server#.directory-rel How many sub directories, files are contained in these directories? Tb's file/directory use. FolderX => FolderX file for msgStore, FolderX.msf file for summary file FolderX.sbd directory to hold XXX, XXX.msf of subfolder XXX under FolderX => If SubSubfolder under SubFolder under FolderX, used file is; FolderX.sbd\SubFolder.sbd\SubSubFolder, FolderX.sbd\SubFolder.sbd\SubSubFolder.msf FYI. A way to produce mail folder named "smart mailboxes ...". 1. Profile directory for Tb's profileN = ...\Profiles\profileN ...\Profiles\profileN\Mail is created and used for mail directory of each account. Following is created and used. ...\Profiles\profileN\Mail\pop3.account, ...\Profiles\profileN\Mail\Local Folders, ...\Profiles\profileN\Mail\smart mailboxes 2. Use this profile directory as mail directory of an account in other Tb's profile Tb's profile directry for profileX = ...\Profiles\profileX Local Directory: of accountA = ...\Profiles\profileN\Mail Under accountA : ...\Profiles\profileN\Mail\Local Folders == mail folder named "Local Folders" ...\Profiles\profileN\Mail\pop3.account == mail folder named "pop3.account" ...\Profiles\profileN\Mail\smart mailboxes == mail folder named "smart mailboxes" FYI. If user transerred Tb's profile directory from Win-XP to Vista/Win7/Win8, situation like comment #104 tends to occur by simple misoperation during OS migration, because "path depth of default profile directory location" is different between Win-XP and Vista/Win7/Win8...(one level deeper in Vista/7/8) IIRC, "absolute path part in panacea.dat file data on Win/Linux" is "persistentDescripter" on Mac OS X. If this persistentDescripter is changed, same situation as "delete panacea.dat, restart of Tb", and "copy/move Tb's profile directory==force change of absolute path of files for mail folder, and restart Tb". If "absolute path of file for mail folder" is changed from "path held in panacea.dat" or panacea.dat content is lost, Tb loses relation between mail folder name and files used for the mail folder". So, Tb has to check all files from scratch during restart. On Mac OS X, IIUC, persistentDescripter corresponds to "absolute path on Win/Linux". To all problem reporters on Mac OS X: What kind of data is saved in panacea.dat by Tb on Mac OS X? (easily be checked by Text Editor) To all problem reporters who experiences this bug frequently/repeatedly on Mac OS X: Is persistentDescripter kept persistently between "shutdown Tb" and "restart Tb" in your environment? Problem occurs only just after upgrade of Mac OS X or upgrade of Tb? Or problem occurs consistently/repeatedly in your ordinal/normal daily use? (In reply to WADA from comment #95) > (In reply to Jim Moe from comment #91) > > Seem comment 27 there. > Thanks for pointing. > Following is the comment. > > "Unable to load address book file impab-2.mab. It may be read-only, or locked by another application. Please try again later." > > However, it always loads and seems to work. > I can understand this phenomenon now. I'm very glad for everyone's efforts to see progress is being made. > - Because of impab-2.mab case, this case is never "double booking of > abook.mab which is abook.mab only > issue". > - Because of "problem during restart only", impab-2.mab is usable after end > of restart. > - This phenomenon is explained by "file handle shortage during restart" > pretty well. for some users, most certainly > And if "file handle shortage", "the file handle shortage occurs during > restart ONLY" is obvious > by this comment. > Wayne shouldn't have inserted "Possibly" in bug summary. "Possibly" is too > weak :-) Possibly :) But to be clear - at the time of comment 41 the reporter's situation and folder environment was (and still is afaict) unclear. In addition, much has changed in the Thunderbird backend regarding how and when folder files are closed, etc. It bears repeating that on Mac all font files are opened on startup, and never closed. I assume (but don't know) that for most Mac users this numbers several hundred files descriptors, making Macs more susceptible to failed file opens. It will be interesting to see what plays out regarding panacea.dat. We need to be mindful there may be other factors. Some users may have changed versions, not changed their environment, and gotten the problem. https://getsatisfaction.com/mozilla_messaging/topics/multiple_recurring_issues_with_tb_24_1_0 may be such an example more complete list of bug reports citing "Unable to load address book" bug 717574 Mac TB3 bug 769125 XP TB13 bug 846282 linux (Kelm comment 3) - see bug 855836 comment 6 bug 893786 Mac tb24 (Mitra, earlybird) (In reply to Wayne Mery (:wsmwk) from comment #108) > It bears repeating that on Mac all font files are opened on startup, and > never closed. I assume (but don't know) that for most Mac users this numbers > several hundred files descriptors, making Macs more susceptible to failed > file opens. If so, it's merely default of "$ ulimit -a / open files (-n) xxxx" is small in Mac OS X, isn't it?
If so, solution on Mac OS X is to simply increase ulimit, isn't it?

> Some users may have changed versions, not changed their environment, and gotten the problem.

IIUC, persistentDescripter of a file is altered by version change of OS in MAC OS X.

A way to see whether panacea.dat content is relevant or not(applicable to any OS).
(1) Copy profile directory(call copy .../ProfA to .../ProfB)
needless to say, disable automatic new mail check, disable auto purge etc. is needed before copy.
(2) Start Profile Manager, create new profile named prof-b,
with selecting .../ProfB as profile directory for prof-b.
(3) Start Tb with prof-b (if needed, thunderbird.exe -no-remote -p "prof-b")
Because data in panacea.dat is not usable(file exists, but not under my mail directory, so file is
discarded), restart takes pretty long and warning of "unresponsive Script" is observed easily
(all files under my mail directory are sccaned and checked, ...).
(4) Terminate Tb => panacea.dat is updated.
(5) Restart Tb. In this restart, panacea.dat content is usable.
Is there any difference in required or consumed file handles between (3) and (5)?

I guess "required peak/average number of file handles" is not so different between (3) and (5).
However, if so, problem should occur upon any restart of Tb, at same timing after start of restart, at same or similar file, until file handle limit is increased by user or PC admnistorator, or until number of folders(number of accounts, folder hierarchy depth etc.) is reduced by user.

In some people's environment, it looks that problem occurs consistently, but in other user's environment, it sounds that problem is not consistent.
What is difference?
For phenomenon after following message is shown.

(0) abook-1.mab is file used by Abook1 in Tb 24 on Win-XP
(1) "Open Write" of abook-1.mab file by other software such as Rexx, PHP
(2) Start Tb => above message is shown, due to Sharing Violation upon open by Tb
Open Adress book => Abook1 is not shown in address book list.
Close abook-1.mab at other software
=> Abook1 was never shown by Tb in this Tb run
Open new(second) messenger window
=> Abook1 was nnot shown by Tb in this Tb run
Create new address book named Abook2 => abook-2.mab is used, because abook-1.mab already exists
(3) Terminate Tb
(4) Restart Tb => Abook1 and Abook2 is normally shown and usable.
i.e.
On Win-XP, if Tb 24,
Once open failure occurred on abook-N.mab which is for AbookN during restart of Tb,
AbookN will never shown in address book list, until Tb is termiated and restarted.
Is this Win-XP phenomenon?
Addressbook is usable even after error during restart if file is accessble, if Mac OS X or Linux?
Or if all messenger window is closed and opened again, address book is accessed again?
(open error console, close all other window, open messenger window again by "Start Tb")
Microsoft and Google get around ulimit, but Thunderbird cannot?

$lsof|cut -f 1 -d ' ' |sort | uniq -c|sort -n 1 COMMAND 7 cut 7 dbfsevent 7 uniq 8 pboard 9 AppleIDAu 9 cfprefsd 9 lsof 10 distnoted 10 helpd 10 pbs 11 CVMCompil 12 ScanNotif 12 SymSecond 12 accountsd 13 CalendarA 14 DisplayLi 14 fontd 14 sort 15 CIJScanne 15 mdworker 16 RealPlaye 16 macfusion 16 usernoted 17 Android 17 GrowlHelp 17 lsboxd 17 tccd 17 xpcd 18 imagent 19 NetworkBr 19 Time\x20O 20 AppleSpel 23 TextMate 23 talagent 24 SymQuickM 28 com.apple 29 Image\x20 31 Notificat 31 loginwind 35 Flux 37 launchd 39 plugin-co 40 AdobeRead 41 Activity 41 Terminal 43 Dock 45 TextEdit 46 Macfusion 54 Preview 56 bash 57 SystemUIS 62 GoogleTal 89 TextWrang 99 UserEvent 106 Dragon 114 Finder 116 Skype 122 JavaAppli 132 firefox 147 soffice 152 Mail 167 Dropbox 470 Microsoft 626 thunderbi 958 Google [78 goldbera@ArthursMacBook:~/tmp]$ !u
ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 709
virtual memory          (kbytes, -v) unlimited
[79 goldbera@ArthursMacBook:~/tmp]\$ lsof|wc -l
4492
 How does one "on Mac: reduce number of system font files"?
 This is  TB 24.5.0 on OS X 10.8.5  with "Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later."

(In reply to Arthur Goldberg from comment #112)
24.5.0 on Ubuntu 12.04 LTS 64bit

I also had to fight with this nasty bug after my laptop crashed suddenly a few times.

I finally found a workaround: Keep a backup copy of panacea.dat and if you suffer the symptoms mentioned in this thread, then just replace this file with your backup, and everything works again like a charm! nothing else needed!
(In reply to dan from comment #115)
> I finally found a workaround: Keep a backup copy of panacea.dat and
> if you suffer the symptoms mentioned in this thread, then just replace this file with your backup,
> and everything works again like a charm! nothing else needed!

Does it mean following?
(a) If panacea.dat is deleted/broken, or if first restart of Tb after Profile directory copy, this bug occurs.
Note:
If "restart just after profile directory copy", entry in panacea.dat points files which are placed under other profile directory,
which are existent but not usable for this profile.
This consumes excess file handles because "file open of all mail files under other profile directory" occurs.
(b) When this bug happened, "restart of Tb" increases number of correct entries in panacea.dat.
So, after several restarts of Tb, this bug will disappear, because panacea.dat comes back to "clean status".

Can you reproduce this bug by next test in your environment?
(1) Copy currently used profile directory(...\abc) to directory(...\def, and ...\ghi).
Note: Because all of profile=abc/def/ghi accesses same mail account's mbox,
disable "auto mail delete" like options before profile directory copy, please.
(2) Start Tb with -ProfileManager, create new profiles(call def, ghi), and choose ...\def , or ...\ghi, as profile directory.
(3) Start Tb with profile=def. (panacea.dat points files in ...\abc)
(4) Delete panacea.dat of ...\ghi directory, start Tb using profile=ghi. (nothing is registered in panacea.dat).
Is there any difference between (3) and (4)?
Dan, thanks for that info.  If panacea is bad, then all folders will be opened in a short period of time (panacea is a cache - comment 94). So I can see how substituting a "good" panacea could help avoid this.
Flags: needinfo?(d.erlacher)
Blocks: 717574
I started seeing this problem today.  Even deleting my ~/.thunderbird directory doesn't help.  Whenever I start Thunderbird, I get the "Unable to Load Address Book File" dialog box.  After dismissing the dialog box, I get a blank Thunderbird main window that hangs.

I'm running Thunderbird 31.2.0 on Ubuntu Linux 12.04.
I do get this output when I start Thunderbird.  I guess it's add-on related, but starting in Safe Mode doesn't make a difference.

1415032629750	addons.manager	WARN	Failed to copy the application shipped blocklist to the profile: [Exception... "Component returned failure code: 0x8052000a (NS_ERROR_FILE_DISK_FULL) [nsIFile.copyTo]"  nsresult: "0x8052000a (NS_ERROR_FILE_DISK_FULL)"  location: "JS frame :: resource://gre/modules/AddonManager.jsm :: AMI_validateBlocklist :: line 543"  data: no] Stack trace: AMI_validateBlocklist()@resource://gre/modules/AddonManager.jsm:543 < AMI_startup()@resource://gre/modules/AddonManager.jsm:650 < AMP_startup()@resource://gre/modules/AddonManager.jsm:2321 < AMC_observe()@resource://gre/components/addonManager.js:55 < <file:unknown>
1415032630071	DeferredSave.extensions.json	WARN	Write failed: {"operation":"close","path":"/usr2/timur/.thunderbird/hkfyrqfw.default/extensions.json.tmp","unixErrno":122}
1415032630072	addons.xpi-utils	WARN	Failed to save XPI database: {"operation":"close","path":"/usr2/timur/.thunderbird/hkfyrqfw.default/extensions.json.tmp","unixErrno":122}
TypeError: nounDef is undefined
-- Exception object --
*
-- Stack Trace --
gloda_ns_newQuery@resource:///modules/gloda/gloda.js:1897:5
ContactIdentityCompleter@resource://gre/components/glautocomp.js:178:7
nsAutoCompleteGloda@resource://gre/components/glautocomp.js:493:5
XPCOMUtils__getFactory/factory.createInstance@resource://gre/modules/XPCOMUtils.jsm:271:11
glodaSearch_XBL_Constructor@chrome://messenger/content/search.xml:75:1
Never mind .. it looks like the real problem was that my HOME directory was out of space.  df showed only 93% allocated, but I had to drop it to 92% before Thunderbird started working.  It must some screwball AFS behavior.  Sorry for the noise, but maybe it helps someone else.
Have same problem with 31.3.0 on Fedora 20.  It may be a space problem because I noticed I was down to less than a gig of space on that partition and the utility I used showed it in red.  Then I deleted a couple gigs and the utility showed it in green.  I'm down to 91%, but that doesn't help.

So then I restarted TB, but still have the problem, so I must assume that it cannot reset itself correctly.  I even uninstalled and reinstalled, because that had helped before.  Most of the time it now opens with no addons existing where there should be about a dozen, and there is nothing under appearance.  The only thing it shows is plugins.

I can can restart in safe mode and no go, or remove them all permanently and it doesn't matter either.

Talk about a corrupte program.  I can't even imagine how to recover from this one.
>>Talk about a corrupte program.  I can't even imagine how to recover from this one.

quit TB, delete panacea.dat from the user profile's root and then start again....
Flags: needinfo?(d.erlacher)
(In reply to dan from comment #122)

> quit TB, delete panacea.dat from the user profile's root and then start
> again....

And that does....what? Nothing for me. Didn't fix the address book problem.
Another side-effect of this issue: Folders are un-subscribed spontaneously.
(In reply to Jim Moe from comment #124)
> Another side-effect of this issue: Folders are un-subscribed spontaneously.

Under the conditions of this bug it is possible for folders to not display. But afaik it is not possible for folders to actually be unsubscribed.
(In reply to Wayne Mery (:wsmwk) from comment #125)
> (In reply to Jim Moe from comment #124)
> > Another side-effect of this issue: Folders are un-subscribed spontaneously.
>
> Under the conditions of this bug it is possible for folders to not display.
> But afaik it is not possible for folders to actually be unsubscribed.
>
Folders disappear on both MacOS and linux, and are restored by re-subscribing. It happens very rarely and to folders that are not often viewed, so it is difficult to say what the conditions are that may cause the disappearance. It may be a totally unrelated issue.

In other news...
I have changed the setting "mail.db.max_open" to a value of 8. The default value is 32. AFAIK The issue on the iMac has been ameliorated. I have, yet again, gone through the accounts and primary folders on the iMac, applying our preferred settings. I will know in about a week how well that setting actually works.
Just wanted to add my experience:

I got the same error message, but when I deleted several old accounts that had a lot of folders and quit and started up again, everything worked fine. Removing Add Ons did not work.

OS X 10.9.5, Thunderbird 31.6.0
It had about 100 file handles open.
> [2015-03-02] In other news...
> I have changed the setting "mail.db.max_open" to a value of 8. The default value is 32.
>
Having had time, the TB installation on the iMac has continued to decay to its default values at about the same rate as it had been before changing "mail.db.max_open". :-( Most folders are, once again, showing their default settings.
So to recap, this bug was filed 2009-06-01 in time period of version 3.0. One or a combination of things must have happened, some of which may have been:
1. thunderbird 3.0 vastly changed how it opens files or the number of files (virtuals/unified?, .jar files)
2. Mac got lots more font files (but afaict there were no Mac changes in that time period - Version 10.5 Leopard was October 26, 2007, 10.6 Snow Leopard was August 28, 2009)
3. gecko changed the way it opens font files (I haven't been able to find such a bug via query [1])
4. an increase in the number of open fds (file handles) that are "not files", such as sockets

Noteworthy items:
- we see this on Mac, not other OSes
- some users have reported restarting Thunderbird *from* Thunderbird avoids the problem
- Firefox doesn't seem to have a problem (but it also doesn't open a bunch of files/folders like TB)
- Mac startup time should be impacted from opening all these font files

Solution seems likely to be either drastically reducing the number of open font files, or increasing ulimit
> Noteworthy items:
> - we see this on Mac, not other OSes
>
It also affects linux although to a much lesser degree. I cannot speak to Windows installations.
I just got shafted again by this bug on a linux system. (The settings in the OSX system have almost all reverted to default over the last 4 weeks.)

I expect to notice when there are messages in a sub-sub-folder; the top folder is highlighted when subfolders have new messages. At some point in the last 2 weeks, this long-ignored disaster reset the Properties of those subfolders but two (out of 34). Because two of them still functioned as expected, I foolishly assumed all of them were properly set up.

As a result I missed some important messages that were moved to those folders by a filter.
http://forums.mozillazine.org/viewtopic.php?f=39&t=2992049 describes somebody getting a "Unable to load address book file abook.mab. It may be read-only, or locked by another application. Please try again later." error using Thunderbird 38.6.0 under Windows 10. "The file is present in the root of the profile folder. It is not locked. It is not in use by another application."

"Looking at the most recent abook.mab in a text editor it appears there are a handful of actual email messages written to the top of file, overwriting much of what should be there."

Is this the same problem, or is it a different problem with the same symptoms?
Also with the newest version 45.0 this abook.mab load error still occurs. I reduced the number of folders but without stopping the abook.mab load error. In my case the abook error occurs randomly with different address book file numbers. Because of this error also abook. synchronization using the add-on Adressbook Synchronizer is regularly skipped.
In my case non-us letters in my profile path made problems -my windows account name has those non-us letters causing windows to have two user account folders (one with and one without non-us letters). By copying all profile files to another folder I surpass this error but still have some issues.
Blocks: tb-mac
TB 45.2.0 on OS X
- Folders, which the index couldn't be read anymore
- spell checker that stopped working
- no auto completion of the addresses
asf.

Those issues appeared randomly not all together bit one time this, later that. I've increased the limit of the allowed number of open files and now those problems seem to have disappeared. On OS X you can increase the number of allowed open files as described here: http://unix.stackexchange.com/questions/108174/how-to-persist-ulimit-settings-in-osx-mavericks (see below "System Limit (Requires Reboot to Take Effect))".

Check with ulimit -n (on Mavericks 256 seems to be the default) and increase this number to 2048 or higher using a method described in the article mentioned above. I chose the /Library/LaunchDaemons/limit.maxfiles.plist method, rebooted and then the TB problems were gone.

For TB Hackers: It would be great to reduce the number of open files TB needs to operate. I have three accounts with hundreds of folders and ten thousands of mails, several thousand contacts, ... just what gets collected after many years of using E-Mail.
TB should detect that the limit of open files has been hit and state this in the error message.
Dear sirs,
to who it belongs to...
I have this error message everyday, it's annoying , it's frustrating, I can't use the Addressbook anymore,

Latest version of TB, multiple IMAP folders and nearby 50'000 emails. I really don't want the company to change to other platforms... I'm a developer too, so I'm more sensible with it.
I was able to reproduce and fix this problem. Here is what I did.

1. Created around 5,000 folders inside Local Folders, each one with one e-mail message.
2. Disabled all addons and spellcheck dictionaries.
3. Closed TB and deleted panacea.dat.
4. Ran TB from a terminal and saw lots of "too many open files" messages. See https://pastebin.com/dYz16evX
5. Closed TB and deleted panacea.dat.
6. I raised hard and soft limit of open files so "ulimit -Hn" and "ulimit -Sn" showed 60000.
7. Ran TB and everything was OK. No more error messages, all folders were visible, addres book showed my contacts.

My setup:
- TB 55.0a1 ID 20170531030205 64-bit
- Ubuntu 17.04 64-bit

If you have some questions, catch me at #tb-qa.
As Wayne suggested to me, I repeated this procedure again but this time I set global variables MOZ_LOG_FILE and, more specifically, MOZ_LOG with a value "MSGDB:5,timestamp". This is what I got.
Attached file foo.tar.gz
An output of "lsof +c 0 | grep thunderbird | sort -k 1.100 -o foo" before closing TB.
Forgot to mention this was on a fresh and fully updated Ubuntu 17.04 with a newly created TB profile with no addons.
Searched but couldn't find any solution for win-machines. From win XP to Win 10 no solutions.
(In reply to JanK from comment #140)
> Created attachment 8879150 [details]
> moz_log_file.txt.tar.gz

Thanks for the log.  So we have an issue at startup.  Your log shows 987 opened files/folders in ~1 second. Perhaps aceman has some thoughts.

Sample of the log...

2017-06-19 13:50:44.573828 UTC - [Main Thread]: I/MSGDB /home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder (another copy).sbd/Subfolder (888th copy).msf - 0 hdrs in use
2017-06-19 13:50:44.573830 UTC - [Main Thread]: I/MSGDB /home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder (another copy).sbd/Subfolder (28th copy).msf - 0 hdrs in use
2017-06-19 13:50:44.573831 UTC - [Main Thread]: I/MSGDB /home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder (another copy).sbd/Subfolder (664th copy).msf - 0 hdrs in use
2017-06-19 13:50:44.573841 UTC - [Main Thread]: I/MSGDB /home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder (another copy).sbd/Subfolder (547th copy).msf - 0 hdrs in use
2017-06-19 13:50:44.573867 UTC - [Main Thread]: I/MSGDB closing database    /home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder.msf
2017-06-19 13:50:44.573889 UTC - [Main Thread]: I/MSGDB nsMsgDatabase::Open(/home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder.msf, TRUE, 0x7f1a5e741200, TRUE)
2017-06-19 13:50:44.573919 UTC - [Main Thread]: I/MSGDB error opening db 80520006
2017-06-19 13:50:44.573922 UTC - [Main Thread]: I/MSGDB 987 open DBs
2017-06-19 13:50:44.573923 UTC - [Main Thread]: I/MSGDB /home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder (another copy).msf - 0 hdrs in use
2017-06-19 13:50:44.573925 UTC - [Main Thread]: I/MSGDB /home/jan/.thunderbird/kqxipvwa.default/Mail/Local Folders/Folder (another copy).sbd/Subfolder (353rd copy).msf - 0 hdrs in use
Flags: needinfo?(acelists)
I have no idea here, we have no solution to this yet. Maybe we could extend the backend code to never open more than e.g. 500 folders (of course, with possible speed hit). But I don't know where to do that, I don't think it is in the DB cache manager I have touched.
Flags: needinfo?(acelists)
Thank you mr. Wayne keeping the thread alive and your work, but why did you linked it to a newer thread? This bug was reported 9 years ago and it's still unresolved.
Depends on: 131589

This is really allarming. On Mozilla Blog reading Thunderbird will receive a new user interface update and redesign... new features... I can understand that a new look brings to new donations and money but I'm wondering if the userbase is increasing or decreasing with all this new looks from time to time... leaving people for decades with the same bugs and loosing compatibility with existings extensions.

(In reply to JanK from comment #139)

I was able to reproduce and fix this problem. Here is what I did.

1. Created around 5,000 folders inside Local Folders, each one with one
e-mail message.
2. Disabled all addons and spellcheck dictionaries.
3. Closed TB and deleted panacea.dat.
4. Ran TB from a terminal and saw lots of "too many open files" messages.
See https://pastebin.com/dYz16evX
5. Closed TB and deleted panacea.dat.
6. I raised hard and soft limit of open files so "ulimit -Hn" and "ulimit
-Sn" showed 60000.
7. Ran TB and everything was OK. No more error messages, all folders were
visible, addres book showed my contacts.

My setup:

• TB 55.0a1 ID 20170531030205 64-bit
• Ubuntu 17.04 64-bit

If you have some questions, catch me at #tb-qa.

@JanK: thanks - I deleted panacea.dat and now it works

@ Wolfgang Steigenberger, thank you very much for the fine work you have done on this bug. It helps a great deal to so many people.

In general,
It still appears to be quite evident that the program is misdesigned. A database of messages should never have to have all of the files opened at one time. One only needs the one currently being accessed. I can only imagine the load it places on the system the way it is now. I can also see the possibility of corruption occurring because of forcing a system to handle so many files at once when we see the rest of the program in such a state.

Hi, this bug is occuring on TB 60.8.0 on BOTH my Win10/Pro/64 and Win7/Pro/64 machines.
I was also able to get it to behave (load address book) by running in safe mode, disabling add-ons.

The common thread between my two machines is recent switch of our company from home-hosted IMAP to office365 exchange email. With both TBs I'm trying the OWL add-on. In safe mode, TB doesn't open all those (previously IMAP) mailfolders now hosted under exchange (because OWL, which accesses them for TB, is disabled). So "too many folders" appears to be plausible for my experience.

Any decisive solutions still welcome!
Frank

You need to log in before you can comment on or make changes to this bug.