Lightning: CalDav calendars disabled (Status 401); using NextCloud on the server



Provider: CalDAV
9 months ago
9 months ago


(Reporter: Mathieu, Unassigned)






9 months ago
Using NextCloud 12.0 on the server, Thunderbird 52.2.1 (on Debian: package 1:52.2.1-1) and Lightning 

Seemingly since I switched the server to HTTPS, Thunderbird + Lightning is not able to access CalDav calendars any more. Existing and new calendars are simply disabled and grayed out in the list of calendars. This seems in essence similar to Bug 842705, which is rather old, and still unconfirmed. Steps to reproduce are simply to create a new calendar in Lightning using the CalDav address. At the end of the setup, the calendar is turned off automatically before authentication happens.

Here is the list of relevant messages and errors when trying to access a calendar "Test":

(message) [calCachedCalendar] replayChangesOn finished.
(message) [calCachedCalendar] sync queue empty.
(message) [calCachedCalendar] Performing playback operation add on 0 items to Test
(message) [calCachedCalendar] Performing playback operation modify on 0 items to Test
(message) [calCachedCalendar] Performing playback operation delete on 0 items to Test
(message) [calCachedCalendar] Doing changelog based sync for calendar https://[my-server]/cloud/remote.php/dav/calendars/mathieu/test/
(message) CalDAV: send: <?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:" xmlns:CS="" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:resourcetype/><D:owner/><D:current-user-principal/><D:supported-report-set/><C:supported-calendar-component-set/><CS:getctag/></D:prop></D:propfind>
(message) CalDAV: Status 401 on initial PROPFIND for calendar Test
(error) [calCachedCalendar] replay action failed: null, uri=https://[my-server]/cloud/remote.php/dav/calendars/mathieu/test/, result=2147500037, op=[xpconnect wrapped calIOperation]
Source File: file:///usr/lib/thunderbird/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calCachedCalendar.js
Line: 327
(message) [calCachedCalendar] replayChangesOn finished.
(message) [calCachedCalendar] sync queue empty.

To be fair, I don't know whether the problem is on the TB+Lightning side or on the NextCloud side; I also filed a bug there (, and I will keep both synchronized.

Note that on the same server, I also run an old instance of ownCloud (v8.2.9), which syncs the calendar without any issue (using HTTPS too). This may indicate that the problem is on NextCloud side, but the calendars are accessed without any problem in other platforms (e.g. iOS 10.3.1 or Gnome Calendars 3.22.4).

Any pointer will be greatly appreciated.


9 months ago
Component: Untriaged → Provider: CalDAV
Product: Thunderbird → Calendar
Version: 52 Branch → Lightning

Comment 1

9 months ago
Well, this bug can be closed as it is now solved on NextCloud side. It is still unclear why it was only affecting Thunderbird + Lightning, but the version 12.0.1 of NextCloud (not yet released) allows authentication to work properly again, and sync to work (both directions). For the record, more details here:

Thanks, and sorry for the noise.
The related commit in NextCloud is with the summary "Overrides \Sabre\DAV\Auth\Backend\AbstractBearer::challenge to prevent sending a second WWW-Authenticate header which is standard-compliant but most DAV clients simply fail hard." So, maybe we can improve the CalDAV provider on behaving more standard-compliant.

Comment 3

9 months ago
Great, yes this commit fixed my problem too
I got this problem only on one laptop, the other one still work, although it used the same cloned thunderbird profile.

but with this nextcloud fix, problem is gone :-)
You need to log in before you can comment on or make changes to this bug.