Closed Bug 548735 Opened 10 years ago Closed 10 years ago

Local Folders "account" has disappeared from the left hand folder pane with v3.0.2

Categories

(Thunderbird :: Folder and Message Lists, defect, critical)

x86
Windows XP
defect
Not set
critical

Tracking

(blocking-thunderbird3.0 .3+, thunderbird3.0 .3-fixed)

RESOLVED FIXED
Tracking Status
blocking-thunderbird3.0 --- .3+
thunderbird3.0 --- .3-fixed

People

(Reporter: keith.dear, Assigned: Bienvenu)

References

()

Details

(Keywords: regression, Whiteboard: [gs])

Attachments

(1 file, 4 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)
Build Identifier: 3.0.2

My email archives are stored as "local folders" which I renamed to "G:\EMAIL" because that's where they are. That worked fine until the recent upgrade. On auto-upgrading to 3.0.1, I now saw this folder listed twice in the LH pane. I could expand the subdirectories in either entry - both looked the same. Annoying, but not a real problem.

Then auto-upgrade to 3.0.2.  The first startup, the two entries of "G:\EMAIL" had returned to one, which I was pleased about as it seemed that little glitch had been fixed. But the second time I started tb, the one listing became none. So now I cannot read old emails, or file new ones locally. The files are still there on disc, but tb is not showing them to me. 

At http://getsatisfaction.com/mozilla_messaging/topics/where_s_my_stuff I see that this is a fairly old (3month) problem that is frustrating a lot of people, who are being remarkably polite about it even as they walk out of the door. One person said that Mozilla is now behaving like Microsoft, which is perhaps not very polite, but I am now going to be even more rude for a moment:

THIS IS A serious BUG WHICH NEEDS TO BE FIXED yesterday! WE CAN'T ACCESS OUR EMAIL ARCHIVES FCS!!!!!!!  WHAT THE HELL WERE YOU THINKING OF RELEASING VERSION 3 WITH THIS BOMB INSIDE? IRRESPONSIBLE? criminal! IF THIS IS WHAT OPEN-SOURCE MEANS THEN I'M OFF BACK TO MONOPOLY LAND. WHAT IS wrong WITH YOU GUYS?

I'd like to say I feel better now, but really, I'm still just a little **** off. Would you put some serious effort into fixing this please? Like, RIGHT NOW?


Reproducible: Always

Steps to Reproduce:
1.no action required to reproduce. "local folders" not visible, not accessible
2.
3.



I downloaded 3.0.2 and installed over the top of the auto-updated version of 3.0.2 -- this should have made no difference but it was suggested on a blog. It did make no difference.

I have one account with two identities. There is no reference to "local folders" anywhere on the "account settings" dialogue, except within "server setting" where "Local directory" is set to the folder in my profile where the (synchronised) inbox etc reside.
Check next entries in prefs.js. Is inconsistency, mismatch seen? Does serverX pointed by accountmanager.localfoldersserver exist?

> (account definition)
> mail.accountmanager.accounts = account1,account2,account3,account4
> mail.accountmanager.defaultaccount = account2
> mail.account.account1.server = server1 (no idX for Local Folders)
> mail.account.account2.identities = id1
> mail.account.account2.server = server2
> mail.account.account3.identities = id2
> mail.account.account3.server = server3
> mail.account.account4.server = server4 (no idX for Smart Folders)
> (pointer to server entry for "Local Folders")
> mail.accountmanager.localfoldersserver = server1
> (server1 definition)
> mail.server.server1.directory-rel = [ProfD]Mail/Local Folders
> mail.server.server1.hostname = Local Folders
> mail.server.server1.type = none
> mail.server.server1.userName = nobody
> (server2 definition)
> mail.server.server2.directory-rel = [ProfD]Mail/pop3.a.a.a
> mail.server.server2.hostname = pop3.a.a.a
> mail.server.server2.name = a@a.a.a
> mail.server.server2.type = pop3
> mail.server.server2.userName = aaa
> (server3 definition)
> mail.server.server3.deferred_to_account = account1 (use Inbox of "Local Folders as Global Inbox)
> mail.server.server3.directory-rel = [ProfD]Mail/pop3.b.b.b
> mail.server.server3.hostname = pop3.b.b.b
> mail.server.server3.name = b@b.b.b
> mail.server.server3.type = pop3
> mail.server.server3.userName = bbb
> (server4 definition)
> mail.server.server4.directory-rel = [ProfD]Mail/smart mailboxes
> mail.server.server4.hidden = true (Smart Folder account is hidden at Account Settings)
> mail.server.server4.hostname = smart mailboxes
> mail.server.server4.name = Smart Folders
> mail.server.server4.type = none
> mail.server.server4.userName = nobody
@WADA: thanks for responding. It looks like this (below). Note especially:

user_pref("mail.accountmanager.localfoldersserver", "server2");
user_pref("mail.server.server2.directory", "G:\\EMAIL");
user_pref("mail.server.server2.directory-rel", "[ProfD]../../EMAIL");
(I tried changing the two "/"s to "\\", no effect)

My profile directory is G:/MozillaProfiles/Thunderbird so that is consistent. The folder EMAIL contains my archives, a bit over 400MB, which I can no longer see from within TB.


user_pref("mail.account.account1.server", "server1");
user_pref("mail.account.account3.server", "server2");
user_pref("mail.account.account4.identities", "id3,id1");
user_pref("mail.account.account4.server", "server3");
user_pref("mail.accountmanager.accounts", "account4,account1");
user_pref("mail.accountmanager.defaultaccount", "account4");
user_pref("mail.accountmanager.localfoldersserver", "server2");
[...]
user_pref("mail.server.server1.directory", "G:\\MozillaProfiles\\Thunderbird\\Mail\\smart mailboxes-5");
user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/smart mailboxes-5");
user_pref("mail.server.server1.hidden", true);
user_pref("mail.server.server1.hostname", "smart mailboxes");
user_pref("mail.server.server1.name", "Smart Folders");
user_pref("mail.server.server1.type", "none");
user_pref("mail.server.server1.userName", "nobody");
user_pref("mail.server.server2.ageLimit", 30);
user_pref("mail.server.server2.applyToFlaggedMessages", false);
user_pref("mail.server.server2.cleanupBodies", false);
user_pref("mail.server.server2.daysToKeepBodies", 30);
user_pref("mail.server.server2.daysToKeepHdrs", 30);
user_pref("mail.server.server2.directory", "G:\\EMAIL");
user_pref("mail.server.server2.directory-rel", "[ProfD]../../EMAIL");
user_pref("mail.server.server2.downloadByDate", false);
user_pref("mail.server.server2.downloadUnreadOnly", false);
user_pref("mail.server.server2.empty_trash_on_exit", true);
user_pref("mail.server.server2.hostname", "Local Folders");
user_pref("mail.server.server2.keepUnreadOnly", false);
user_pref("mail.server.server2.name", "G:\\EMAIL");
user_pref("mail.server.server2.numHdrsToKeep", 30);
user_pref("mail.server.server2.type", "none");
user_pref("mail.server.server2.userName", "nobody");
user_pref("mail.server.server3.ageLimit", 30);
user_pref("mail.server.server3.applyToFlaggedMessages", false);
user_pref("mail.server.server3.capability", 71662381);
user_pref("mail.server.server3.check_time", 30);
user_pref("mail.server.server3.cleanupBodies", false);
user_pref("mail.server.server3.daysToKeepBodies", 30);
user_pref("mail.server.server3.daysToKeepHdrs", 30);
user_pref("mail.server.server3.directory", "G:\\MozillaProfiles\\Thunderbird\\ImapMail\\anumail.anu.edu.au");
user_pref("mail.server.server3.directory-rel", "[ProfD]ImapMail/anumail.anu.edu.au");
user_pref("mail.server.server3.downloadByDate", false);
user_pref("mail.server.server3.downloadUnreadOnly", false);
user_pref("mail.server.server3.empty_trash_on_exit", true);
user_pref("mail.server.server3.hostname", "anumail.anu.edu.au");
user_pref("mail.server.server3.keepUnreadOnly", false);
user_pref("mail.server.server3.max_cached_connections", 5);
user_pref("mail.server.server3.name", "Keith Dear");
user_pref("mail.server.server3.namespace.other_users", "\"Shared Folders/User/\"");
user_pref("mail.server.server3.namespace.personal", "\"\"");
user_pref("mail.server.server3.namespace.public", "\"Shared Folders/Public/\"");
user_pref("mail.server.server3.numHdrsToKeep", 30);
user_pref("mail.server.server3.timeout", 29);
user_pref("mail.server.server3.type", "imap");
user_pref("mail.server.server3.userName", "u9909577");
user_pref("mail.server.server3.using_subscription", false);
Keith, if you try changing:

user_pref("mail.accountmanager.accounts", "account4,account1");

to
user_pref("mail.accountmanager.accounts", "account4,account3,account1");

does that fix it?
Mark Banner, accountmanager.localfoldersserver=server2 is kept.

Your settings.
> user_pref("mail.accountmanager.localfoldersserver", "server2"); <= server2 doesn't exist
> user_pref("mail.accountmanager.accounts", "account4,account1"); <= account2 and/or account3 is removed

> user_pref("mail.account.account1.server", "server1"); <= no problem at this stage
> user_pref("mail.account.account3.server", "server2"); <= wrong, should be account2/server2
> I t look that account2/server2 was deleted instead of account3/server2.
> user_pref("mail.account.account4.identities", "id3,id1"); <= good
> user_pref("mail.account.account4.server", "server3"); <= good

> user_pref("mail.server.server1.name", "Smart Folders");
> user_pref("mail.server.server2.directory", "G:\\EMAIL");
> user_pref("mail.server.server2.hostname", "Local Folders");
> user_pref("mail.server.server3.hostname", "anumail.anu.edu.au");
> user_pref("mail.server.server3.type", "imap");

Keep backup of profile directory and E:\EMAIL, and try next, please.
> user_pref("mail.accountmanager.accounts", "account4,account1");
>                                        => "account4,account2,account1
> user_pref("mail.account.account3.server", "server2");
>         => mail.account.account2.server

Suffix of "-5" is used in directory name for "Smart Folders". I looks that many garbage existed upon upgrade to Tb 3.0.0.
> user_pref("mail.server.server1.directory", "G:\\MozillaProfiles\\Thunderbird\\Mail\\smart mailboxes-5");
> user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/smart mailboxes-5");
Oh, sorry for my confusion.

account3=>server2 exists.
So, mail.accountmanager.accounts=account4,account3,account1 was sufficient.

No need to care for deferred_to_account = accountX in this case. 
I confused localfoldersserver=server2, localfoldersserver=account2, and deferred_to_account=account2...
YES!!!
It gave me back the local folders tree, but pointing to the wrong place (showing my profile directory, full of non-message stuff). But then I could right-click,settings,local directory,browse and set it back where it should be. And there they are!

(bleedin' obvious really, why didn't I think of that, yes I am being sarcastic)

Thank you both very much. Glass of good Australian red called for.
kd
Keith, I'm glad that fixed it for you.

I'm going to keep this bug open as it looks like there may be an issue in 3.0.2 that we need to address (xref bug 505465 comment 59).
blocking-thunderbird3.0: --- → ?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 505465
regression, or regression-like
Keywords: regression
Summary: Local Folders "account" has disappeared from the left hand pane → Local Folders "account" has disappeared from the left hand folder pane with v3.0.2
yes, so WADA's analysis is right - when cleaning up duplicate accounts, we seem to sometimes remove the localfolders server account...we probably need to do the same kind of check that we're not removing a deferred to account when cleaning up duplicates.
Keith, which is the directory where your mail actually was stored? G:\EMAIL? Was it messed up after repairing the account manager list of accounts because you had tweaked the mail.server.server2.directory-rel to no effect?
I've tweaked the unit test for this area of the code and it does reproduce the problem, so I should be able to debug it.
actually, the code is doing the right thing with my tweaked test, so I've not tweaked it correctly to reproduce the issue folks are seeing. Getting a backup of the original prefs would be really helpful...my guess at the moment is that there were duplicate servers, perhaps with different server directories, and we picked the wrong one.
Attached patch fix with unit test (obsolete) — Splinter Review
This fixes the original issue, which was that the code that tried to cleanup accounts pointing at the same server removed the existing account, not the duplicate account. I've extended the unit test to test for that.

I need to figure out how to recover profiles that have had this happen - since the reports have been about local folders accounts, we can at least clean up those prefs...if this had happened with imap accounts, we'd be a bit out of luck, but we haven't heard any reports about duplicate imap accounts, always local folders...
Assignee: nobody → bienvenu
Status: NEW → ASSIGNED
actually, the existing test did test this scenario, but it only checked that the account list was correct, not that we didn't clear out the wrong account prefs...
Attached patch fix with better unit test (obsolete) — Splinter Review
this fixes the unit test to verify the account settings for the existing accounts point at the right server prefs when done...
Attachment #429169 - Attachment is obsolete: true
Attached patch with repair code, and unit test (obsolete) — Splinter Review
Attachment #429175 - Attachment is obsolete: true
Attachment #429195 - Flags: superreview?(bugzilla)
Attachment #429195 - Flags: review?(bwinton)
Duplicate of this bug: 548798
Comment on attachment 429195 [details] [diff] [review]
with repair code, and unit test

>+++ b/mailnews/base/src/nsMsgAccountManager.cpp
>@@ -1422,16 +1419,43 @@ nsMsgAccountManager::LoadAccounts()
>+      m_accounts->EnumerateForwards(findAccountByServerKey, (void *)&entry);
>+      // If we don't have an existing account pointing at the local folder server,
>+      // we're going to add one.

If we broke the previous line after "folder", then we wouldn't need to go over 80 characters.

>+++ b/mailnews/base/test/unit/test_acctRepair.js
>@@ -0,0 +1,73 @@
>+/* ***** BEGIN LICENSE BLOCK *****
>+ * The Initial Developer of the Original Code is
>+ * David Bienvenu <bienvenu@mozillamessaging.com>.
>+ * Portions created by the Initial Developer are Copyright (C) 2010
>+ * the Initial Developer. All Rights Reserved.
>+ *
>+ * Contributor(s):
>+ *

As per http://weblogs.mozillazine.org/gerv/archives/2010/02/mpl_initial_developer_for_mozilla_employ.html I think this should have an Initial Developer of "the Mozilla Foundation.", and you as a Contributor.

Other than those tiny nits, r=me.

Later,
Blake.
Attachment #429195 - Flags: review?(bwinton) → review+
Attached patch fix addressing nits (obsolete) — Splinter Review
Attachment #429195 - Attachment is obsolete: true
Attachment #429238 - Flags: superreview?(bugzilla)
Attachment #429238 - Flags: review+
Attachment #429195 - Flags: superreview?(bugzilla)
this checks that the account 1 server pref is set correctly, and the deferred to account for server 5 is adjusted correctly.
Attachment #429238 - Attachment is obsolete: true
Attachment #429256 - Flags: superreview?(bugzilla)
Attachment #429238 - Flags: superreview?(bugzilla)
Attachment #429256 - Flags: superreview?(bugzilla)
Attachment #429256 - Flags: superreview+
Attachment #429256 - Flags: approval-thunderbird3.0.3+
fixed for 3.03 - I'm going to fix for 3.1 as soon as that tree finishes building, so the fix will be in b1.
blocking-thunderbird3.0: ? → .3+
fixed on trunk, for 3.1b1
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.1b1
The unit tests are failing on Linux:

  ### XPCOM_MEM_LEAK_LOG defined -- logging leaks to /tmp/tmpuMc6HE/runxpcshelltests_leaks.log
TEST-INFO | (xpcshell/head.js) | test 1 pending
Directory request for: MFCaF that we (mailDirService.js) are not handling, leaving it to another handler.
Directory request for: DefRt that we (mailDirService.js) are not handling, leaving it to another handler.
TEST-PASS | /buildbot/linux-comm-1.9.2-check/build/objdir/mozilla/_tests/xpcshell/test_mailnewsbase/unit/test_acctRepair.js | [run_test : 70] 2 == 2
account6,account1
TEST-PASS | /buildbot/linux-comm-1.9.2-check/build/objdir/mozilla/_tests/xpcshell/test_mailnewsbase/unit/test_acctRepair.js | [run_test : 73] account6,account1 == account6,account1
TEST-PASS | /buildbot/linux-comm-1.9.2-check/build/objdir/mozilla/_tests/xpcshell/test_mailnewsbase/unit/test_acctRepair.js | [run_test : 74] server1 == server1
TEST-UNEXPECTED-FAIL | /buildbot/linux-comm-1.9.2-check/build/objdir/mozilla/_tests/xpcshell/test_mailnewsbase/unit/test_acctRepair.js | account2 == account1 - See following stack:
JS frame :: /buildbot/linux-comm-1.9.2-check/build/mozilla/testing/xpcshell/head.js :: do_throw :: line 200
JS frame :: /buildbot/linux-comm-1.9.2-check/build/mozilla/testing/xpcshell/head.js :: do_check_eq :: line 230
JS frame :: /buildbot/linux-comm-1.9.2-check/build/objdir/mozilla/_tests/xpcshell/test_mailnewsbase/unit/test_acctRepair.js :: run_test :: line 76
JS frame :: /buildbot/linux-comm-1.9.2-check/build/mozilla/testing/xpcshell/head.js :: _execute_test :: line 128

This is the same on all the Linux boxes.

Digging into the test I added the lines:

var newprefs = gProfileDir.clone();
newprefs.append("prefs.js");
prefs.QueryInterface(Ci.nsIPrefService).savePrefFile(newprefs);

to save the prefs file at a suitable location.

account1 had indeed been created but mail.server.server5.deferred_to_account still pointed to account2 as the results suggest.

I'm not quite sure what the difference with Linux is, but this doesn't seem to be behaving right.
Status: RESOLVED → REOPENED
blocking-thunderbird3.0: .3+ → ?
Resolution: FIXED → ---
Target Milestone: Thunderbird 3.1b1 → ---
David's committed a test-only fix for this that fixed the tests. I also manually verified the fix worked on Linux.

Test-only fixes:
http://hg.mozilla.org/releases/comm-1.9.1/rev/1fa2ec575f55
http://hg.mozilla.org/releases/comm-1.9.1/rev/e002eb5cb6a1 (relbranch)
http://hg.mozilla.org/comm-central/rev/8870444a52c9
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Duplicate of this bug: 549074
blocking-thunderbird3.0: ? → .3+
note, it is also possible for NO folders/accounts to appear.
Please, can you be more clear for an inexperience user as you are?
Thanks.
I tried to migrate from Postbox to Thunderbird.
I backed it up the profile folder from postbox.
Now I can`t see my local folders where a archived all my email older than a week.

Can you help me?

Thanks
Carlos
Carlos, please post your problem at https://support.mozilla.org/en-US/questions/new/thunderbird
Thanks
Thank you, I will

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