Closed Bug 1777276 Opened 3 years ago Closed 3 years ago

Error on startup "Component returned failure code: 0x80550013 [nsIMsgPluggableStore.createFolder] Pop3IncomingServer.jsm:135"

Categories

(MailNews Core :: Networking: POP, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102+ fixed, thunderbird104 affected)

RESOLVED FIXED
105 Branch
Tracking Status
thunderbird_esr102 + fixed
thunderbird104 --- affected

People

(Reporter: wsmwk, Assigned: rnons)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

102.0 on Windows.
No pop accounts currently defined in this profile. There had been one, but it was removed several months ago.

Component returned failure code: 0x80550013 [nsIMsgPluggableStore.createFolder] Pop3IncomingServer.jsm:135
createDefaultMailboxes resource:///modules/Pop3IncomingServer.jsm:135
discoverFolders resource:///modules/MailUtils.jsm:64
generateMap chrome://messenger/content/folderPane.js:2028
_rebuild chrome://messenger/content/folderPane.js:1882
load chrome://messenger/content/folderPane.js:195
InterpretGeneratorResume self-hosted:1422
AsyncFunctionNext self-hosted:632

We see this as well on a pure POP3 setup. The error is shown 7 times right at the start, even before the OpenPGP keys are loaded.

I see exactly the same message very time I've open Thunderbird on macOS. Its thunderbird-102.0.1.

That error is NS_MSG_FOLDER_EXISTS. Could localized local folder names be involved perhaps? https://searchfox.org/comm-central/rev/7026810a88ddc7f2a1e8b841289ca774cafc241c/mailnews/local/src/nsMsgBrkMBoxStore.cpp#89

Yes, this happens with localised versions. Please try it:

  /** @see nsILocalMailIncomingServer */
  createDefaultMailboxes() {
    for (let name of ["Inbox", "Trash"]) {
      if (!this.rootFolder.containsChildNamed(name)) {
        this.msgStore.createFolder(this.rootFolder, name);  <--- failing line.
      }
    }
  }
Flags: needinfo?(remotenonsense)

Thanks, I found this is not a new problem, only it was ignored previously https://searchfox.org/comm-central/rev/3b062b49f0a5b38f704acd44871f01bfb1f4cb6f/mailnews/local/src/nsLocalMailFolder.cpp#209-210

Will think about a fix

Assignee: nobody → remotenonsense
Status: NEW → ASSIGNED
Flags: needinfo?(remotenonsense)
Target Milestone: --- → 105 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b1b52e85bce9
Use getChildWithURI in Pop3IncomingServer to work with localized folder name. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

I see this with 102.6.1 under Windows 10.
So this is fixed in 105?
I see some users in Japanese BBS suggested that a localized folder name for Sent, Inbox could not be used on thei machines. TB complained that either receiving and sending fails due to the missing folder although Sent and Inbox exist.
I wonder if this could be related. The symptoms are sketchy and may or may not be related to this bug, but I suspect there ARE other problems lurking with localized versions.

BTW, I see the following using searchfox. I wonder if any of them needs rewriting in a similar manner.

Uses (containsChildNamed)
mail/modules/MessageArchiver.jsm
314 if (!dstFolder.containsChildNamed(folderName)) { // found in MessageArchiver.continueBatch
mailnews/base/content/virtualFolderProperties.js
303 } else if (parentFolder.containsChildNamed(name)) { // found in onOK
mailnews/extensions/newsblog/FeedUtils.jsm
1240 while (aParentFolder.containsChildNamed(folderName)) { // found in FeedUtils.getSanitizedFolderName
mailnews/local/src/Pop3IncomingServer.jsm
216 if (!server.rootFolder.containsChildNamed("Inbox")) { // found in Pop3IncomingServer.deferredToAccount
suite/mailnews/content/mailWindowOverlay.js
1127 if (!dstFolder.containsChildNamed(folderName)) { // found in BatchMessageMover.continueBatch

Flags: needinfo?(mkmelin+mozilla)

Maybe I should search for "Inbox" and friends.
The following looks suspicious.
https://searchfox.org/comm-central/source/mailnews/local/src/Pop3IncomingServer.jsm#216


    // Check if we are deferred to the local folders, and create INBOX if needed.
    let server = MailServices.accounts.getAccount(accountKey).incomingServer;
    if (server instanceof Ci.nsILocalMailIncomingServer) {
      if (!server.rootFolder.containsChildNamed("Inbox")) {   <---- This. We may create "Inbox" folder unnecessarily in localized version?
        server.rootFolder.createSubfolder("Inbox", null);
      }
    }

This one also.:

	mailnews/local/src/nsNoIncomingServer.cpp
134	rv = CreateLocalFolder(u"Inbox"_ns);

https://searchfox.org/comm-central/rev/0fefd9ea7a9c8e805c833ce935cb54df597453df/mailnews/local/src/Pop3IncomingServer.jsm#216 does look like it could be affected, the others probably not.

This bug looks like it should be uplifted.

Flags: needinfo?(mkmelin+mozilla)

Comment on attachment 9289763 [details]
Bug 1777276 - Use getChildWithURI in Pop3IncomingServer to work with localized folder name. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: A harmless error message is shown in console
Testing completed (on c-c, etc.): beta
Risk to taking this patch (and alternatives if risky): low

Attachment #9289763 - Flags: approval-comm-esr102?

Comment on attachment 9289763 [details]
Bug 1777276 - Use getChildWithURI in Pop3IncomingServer to work with localized folder name. r=mkmelin

[Triage Comment]
Approved for esr102

Attachment #9289763 - Flags: approval-comm-esr102? → approval-comm-esr102+

(In reply to ISHIKAWA, Chiaki from comment #11)

Maybe I should search for "Inbox" and friends.
The following looks suspicious.
https://searchfox.org/comm-central/source/mailnews/local/src/Pop3IncomingServer.jsm#216


    // Check if we are deferred to the local folders, and create INBOX if needed.
    let server = MailServices.accounts.getAccount(accountKey).incomingServer;
    if (server instanceof Ci.nsILocalMailIncomingServer) {
      if (!server.rootFolder.containsChildNamed("Inbox")) {   <---- This. We may create "Inbox" folder unnecessarily in localized version?
        server.rootFolder.createSubfolder("Inbox", null);
      }
    }

This one also.:

	mailnews/local/src/nsNoIncomingServer.cpp
134	rv = CreateLocalFolder(u"Inbox"_ns);

(In reply to Magnus Melin [:mkmelin] from comment #12)

https://searchfox.org/comm-central/rev/0fefd9ea7a9c8e805c833ce935cb54df597453df/mailnews/local/src/Pop3IncomingServer.jsm#216 does look like it could be affected, the others probably not.

This bug looks like it should be uplifted.

Before we forget, should we not modify the following line in a similar manner?

if (!server.rootFolder.containsChildNamed("Inbox")) { <---- This. We may create "Inbox" folder unnecessarily in localized version?

Flags: needinfo?(remotenonsense)

That one is reported in bug 1799106 it seems, so we could take it there.

See Also: → 1799106

Sent a patch in bug 1799106 to fix if (!server.rootFolder.containsChildNamed("Inbox")), thanks.

Flags: needinfo?(remotenonsense)

(In reply to Magnus Melin [:mkmelin] from comment #17)

That one is reported in bug 1799106 it seems, so we could take it there.

Somebody probably needs to change the test files, too.
If the test is always executed in
LC_ALL=C locale, it may not matter.
HOWEVER, come to think of it, that is why these problems were not noticed before.
Then it is a big issue in itself, I think.
(I could not make a localized version due to missing L10N package on my PC many year ago and so
local testing is always done using LC_ALL=C or some such.)

calendar/test/browser/invitations/browser_identityPrompt.js

42 if (!rootFolder.containsChildNamed("Inbox")) {
mailnews/base/test/unit/test_bug434810.js
24 Assert.ok(rootFolder.containsChildNamed(expectedFolders[i])); // found in run_test
mailnews/base/test/unit/test_nsIMsgFolder.js
51 if (!root.containsChildNamed("Inbox")) { // found in run_test
58 if (!root.containsChildNamed("Drafts")) { // found in run_test
65 if (!root.containsChildNamed("Templates")) { // found in run_test
72 if (!root.containsChildNamed("Sent")) { // found in run_test
79 if (!root.containsChildNamed("Archives")) { // found in run_test
86 if (!root.containsChildNamed("Trash")) { // found in run_test
93 if (!root.containsChildNamed("Outbox")) { // found in run_test
mailnews/imap/test/unit/test_imapPasswordFailure.js
123 Assert.ok(rootFolder.containsChildNamed("Inbox"));
124 Assert.ok(!rootFolder.containsChildNamed("Subscribed"));
146 Assert.ok(rootFolder.containsChildNamed("Inbox"));
147 Assert.ok(rootFolder.containsChildNamed("Subscribed"));
mailnews/imap/test/unit/test_mailboxes.js
41 Assert.ok(rootFolder.containsChildNamed("Inbox"));
42 Assert.ok(rootFolder.containsChildNamed("TRASH"));
47 Assert.ok(rootFolder.containsChildNamed(folderName1));
49 Assert.ok(!rootFolder.containsChildNamed("Unsubscribed box"));
60 Assert.ok(rootFolder.containsChildNamed(folderName2));

There are cases where |containsChildNamed()| is passed a variable, and I am not sure what to do with these.
At least someone needs to make a pass to see if it looks suspicious.

(In reply to Ping Chen (:rnons) from comment #18)

Sent a patch in bug 1799106 to fix if (!server.rootFolder.containsChildNamed("Inbox")), thanks.

Thank you!

(In reply to ISHIKAWA, Chiaki from comment #19)

If the test is always executed in
LC_ALL=C locale, it may not matter.

Environment is irrelevant. The issue is only present with localized builds, so I don't think a change is really needed.

See Also: → 1968878
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: