Bug: Welcome to TB Daily account hub won't let me add email account: Uncaught Exception (accountUtils.js:237), lots of console errors (with existing installations of same release channel in other folders)
Status: RESOLVED
Priority: P2
Resolution: WORKSFORME
Created: 2020-09-16 16:29:31+00:00
Resolved: 2021-08-04 18:01:13+00:00

[EDIT 2021-03-03]

With the benefit of hindsight, this bug probably requires having an existing installation of the same release channel, but in another folder. I understand that this is the precondition for getting the "Important News - ...new profile" alert seen in attachment 9182449.

STR

1.) install 1st instance of Thunderbird in a new folder (C:\test\install1) of a virgin OS profile, create email account, close.
2.) install 2nd instance of Thunderbird (same release channel as in step 1) in another new folder (C:\test\install2).
- close "Important news: This installation of ... has a new profile" via (x) button
- switch to 3-pane tab
- open Error console (Ctrl+Shift+J)
- from "Welcome to Thunderbird" account hub, click [Email] button to add a new account.

Actual result

- Important caveat: **You'll only get the errors for the *first* startup of the *second* install. For subsequent startups, it's all fine and good.**
- distorted alert: "Important News - ...new profile" (oversize alert is bug 1695719): "This installation of {Thunderbird/Daily/...} has a new profile..." (make sure you are seeing this, I believe without this you will not see the bug). close the alert on (x), don't do anything else.
- After clicking on [Email] button from "Welcome..." hub, NOTHING.
- Loads of errors in console (see screenshots attached to this bug), the last one from the [Email] button being:

```
Uncaught
Exception { name: "NS_ERROR_FAILURE", message: "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMailSession.topmostMsgWindow]", result: 2147500037, filename: "chrome://messenger/content/accountUtils.js", lineNumber: 235, columnNumber: 0, data: null, stack: "AddMailAccount@chrome://messenger/content/accountUtils.js:235:3\nonclick@chrome://messenger/content/msgAccountCentral.xhtml:1:1\n", location: XPCWrappedNative_NoHelper }
accountUtils.js:235
```

Expected:
- installing in another folder should not be affected by previous installations of the same channel in other folders
- Trying to create an existing email account via Welcome hub's [Email] button should succeed without console errors

----
(Original description)

Trying to add existing email account on first time account hub fails with uncaught exception.

Using a try build of current daily (from Bug 1665321 Comment 3):
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=068128352d3c6f40ce908cdcdf28c53c433cce1f
82.0a1 (2020-09-16) (64-bit)

Uncaught 
Exception { name: "NS_ERROR_FAILURE", message: "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMailSession.topmostMsgWindow]", result: 2147500037, filename: "chrome://messenger/content/accountUtils.js", lineNumber: 237, columnNumber: 0, data: null, stack: "AddMailAccount@chrome://messenger/content/accountUtils.js:237:3\nonclick@chrome://messenger/content/msgAccountCentral.xhtml:1:1\n", location: XPCWrappedNative_NoHelper }
accountUtils.js:237
    AddMailAccount chrome://messenger/content/accountUtils.js:237
    onclick chrome://messenger/content/msgAccountCentral.xhtml:1