Closed Bug 1388060 Opened 7 years ago Closed 7 years ago

OAuth2 Gmail and Google CalDAV calendars can't co-exist - Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIXPCComponents_Utils.import]

Categories

(Thunderbird :: Account Manager, defect)

defect
Not set
normal

Tracking

(thunderbird_esr52 unaffected, thunderbird56 fixed, thunderbird57 fixed)

VERIFIED FIXED
Thunderbird 57.0
Tracking Status
thunderbird_esr52 --- unaffected
thunderbird56 --- fixed
thunderbird57 --- fixed

People

(Reporter: Cykesiopka, Assigned: jorgk-bmo)

References

Details

(Keywords: regression)

Attachments

(1 file)

In the Lightning version bundled with Thunderbird 56.0b1-build2 (Build ID 20170805083828, https://hg.mozilla.org/releases/comm-beta/rev/99e90c2d4b50) OAuth2 Gmail and OAuth2 Google CalDAV calendars can't seem to co-exist.

STR:
1. Start with a clean profile.
2. Add a CalDAV calendar (Google; OAuth2; 2FA enabled).
3. Try to add a mail account (unrelated GMail; OAuth2; 2FA enabled).

ER:
In step 3, an OAuth2 prompt appears, and emails are fetched once the various authentication challenges are satisfied.

AR:
- In step 3, the "Mail Account Setup" window says "Configuration could not be verified - is the user name or password wrong?"
- In the Browser Console, these messages appear:
> 
  ^ (Yes, an empty message) errUtils.js:35
> NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIXPCComponents_Utils.import]
  ^ msgOAuth2Module.js:11
Alt STR:
1. Start with a "dirty" profile < 56.0b1, that has an OAuth2 IMAP Gmail account and an OAuth2 CalDAV calendar.
2. Try to fetch mail.
3. Try to send mail.

ER:
- Step 2: Mail is checked successfully.
- Step 3: Mail is sent successfully.

AR:
- Step 2: A notification appears:
> The IMAP server <e-mail address> does not support the select authentication method. Please change the 'Authentication method' in the 'Account Settings | Server settings'.
- Step 3: A dialogue pops up:
> Sending of the message failed.
> The Outgoing server (SMTP) <SMTP server domain name>  does not support the select authentication method.
> Please change the 'Authentication method' in 'Account Settings | Outgoing Server (SMTP)'.
See Also: → 1387887
The import problem is a fallout from bug 1384218 (bug 1383215).

Imports need to be consistent, /gre/ for M-C and /// for C-C which is what I did in bug 1384218.

Somehow imports of OAuth2.jsm got missed. There seem to be two of these modules in the system:
mailnews/base/util/OAuth2.jsm
and
calendar/providers/gdata/modules/OAuth2.jsm

There are three different imports:

calendar/providers/caldav/calDavCalendar.js
Components.utils.import("resource:///modules/OAuth2.jsm");

calendar/providers/gdata/modules/gdataSession.jsm
Components.utils.import("resource://gdata-provider/modules/OAuth2.jsm");

mail/components/cloudfile/nsBox.js
Cu.import("resource:///modules/OAuth2.jsm");

mailnews/base/src/msgOAuth2Module.js
Components.utils.import("resource://gre/modules/OAuth2.jsm");

The last one is most definitely wrong and I will fix this now and we'll see whether things return back to normal in today's Daily. If not, the Calendar people would have to rename their module.

Oh, the imports for OAuth2Providers.jsm are also all (consistently) wrong :-(
Keywords: leave-open
Attached patch 1388060.patchSplinter Review
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #8895292 - Flags: review?(acelists)
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/d6a93b3c0012
Bug 1384218 follow-up: fix import URI for OAuth2.jsm and OAuth2Providers.jsm. rs=bustage-fix
Cykesiopka, can you please try today's Daily (assuming it isn't busted).

If that works, fine, otherwise we need to rename GData's second OAuth2.jsm.
Flags: needinfo?(cykesiopka.bmo)
Daily worked for me with this change!
Great, can you check bug 1387887 please.

Closing this based on Patrick's report, the problem was caused by Mailnews, not Calendar.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Component: General → Security
Flags: needinfo?(clokep)
Product: Calendar → MailNews Core
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 57.0
Version: Lightning 5.8 → unspecified
Comment on attachment 8895292 [details] [diff] [review]
1388060.patch

This obviously needs uplift ;-)
Attachment #8895292 - Flags: approval-comm-beta+
Component: Security → Account Manager
Product: MailNews Core → Thunderbird
Flags: needinfo?(clokep)
Comment on attachment 8895292 [details] [diff] [review]
1388060.patch

Review of attachment 8895292 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks.
Attachment #8895292 - Flags: review?(acelists) → review+
Daily also works for me.
Thanks.
Status: RESOLVED → VERIFIED
Flags: needinfo?(cykesiopka.bmo)
And can you verify bug 1387887 as well please?
Keywords: leave-open
Great work everyone
Blocks: 1384218
Keywords: regression
56.0B2
An error was encountered preparing the calendar located at googleapi://marcausl@gmail.com/?calendar=marcausl%40gmail.com for use. It will not be available.

[Exception... "Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]"  nsresult: "0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE)"  location: "JS frame :: resource://calendar/modules/calUtils.jsm -> file:///C:/Users/marc/AppData/Roaming/Thunderbird/Profiles/qraffuc9.Marc/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calCalendarManager.js :: createCalendar :: line 446"  data: no]
Some testers had reported success, so we need an assessment of the conditions and the severity of this before EOB today, so we know whether to kill updates to b2 or to continue to allow updates.
That was reported in bug 1387887. Here we've been dealing with the error from comment #0, and that's 100% fixed. So please file that other issue in the other bug where we had some dispute whether the issue was fixed or not. Some said yes, other's no.
Summary: OAuth2 Gmail and Google CalDAV calendars can't co-exist → OAuth2 Gmail and Google CalDAV calendars can't co-exist - Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIXPCComponents_Utils.import]
installing the development version gdata-provider-3.7b2.en-US.win32.xpi resolves this - sorry for the noise
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: