-
Notifications
You must be signed in to change notification settings - Fork 107
Description
I have a puzzling problem after nextcloud and emacs upgrades
I have successfully been using org-caldav to sync with my nextcloud calendars for about 1 year. I recently upgraded my machine (os, emacs and nextcloud changed) and I now have trouble, but only with org-caldav. Syncing my android devices works and sending OPTION request with
curl returns the correct DAV header information.
I assume this is probably due to some change in nextcloud but perhaps someone here can help me diagnose this?
System is Kubuntu 20.04, nextcloud 18.04, emacs 26.3, org-mode 9.6.3
The failure
- Message buffer:
Contacting host: example.org:443 [2 times]
progn: Error while checking for OPTIONS at URL https://example.org/nextcloud/remote.php```/dav/calendars/username/personal/: 404 Not Found
- org-caldav-debug buffer:
Syncing first calendar entry:
(:calendar-id "personal" :files ("~/org/personal.org") :inbox "~/org/personal-cal-inbox.org" :skip-conditions (nottimestamp))
Check connection for https://example.org/nextcloud/remote.php/dav/calendars/username/personal/.
Got error while checking connection (will try again):
(error "Error while checking for OPTIONS at URL https://example.org/nextcloud/remote.php/dav/calendars/username/personal/: 404 Not Found")
The page returned is this:
HTTP/1.1 404 Not Found
Date: Tue, 28 Apr 2020 18:24:52 GMT
Server: Apache/2.4.41 (Ubuntu)
Strict-Transport-Security: max-age=15552000; includeSubDomains
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-XSS-Protection: 1; mode=block
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: default-src 'none';
Content-Length: 238
Keep-Alive: timeout=5, max=95
Connection: Keep-Alive
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
<s:message>File with name /calendars could not be located</s:message>
</d:error>But the calendar url works:
> curl -D - -X OPTIONS --basic -u username:password https://example.org/nextcloud/remote.php/dav/calendars/username/personal
HTTP/1.1 200 OK
Date: Tue, 28 Apr 2020 14:47:11 GMT
Server: Apache/2.4.41 (Ubuntu)
Strict-Transport-Security: max-age=15552000; includeSubDomains
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-XSS-Protection: 1; mode=block
Set-Cookie: oc7560nmwcl0=n0hl0n2827e8ctcblap2pdgXXX; path=/nextcloud; secure; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: oc_sessionPassphrase=WFQL1x74d73gkdw5CFKv%2BViqMEGkK0Kt%2FXJp7PKng4eF1VSDGtsHhLGuRH8UKQQ9Rkbu613ufNBQDR4mv06f9YJvkYBEH2Upg7qrq9dS9bjAIgT8X1E6Cs4sQZihwtSV; path=/nextcloud; secure; HttpOnly
Content-Security-Policy: default-src 'none';
Set-Cookie: nc_sameSiteCookielax=true; path=/nextcloud; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
Set-Cookie: nc_sameSiteCookiestrict=true; path=/nextcloud; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
Set-Cookie: oc7z3znmwcl0=7e3uq2lqshf6l75m45nd95e3is; path=/nextcloud; secure; HttpOnly
Set-Cookie: cookie_test=test; expires=Tue, 28-Apr-2020 15:47:11 GMT; Max-Age=3600
Allow: OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT
DAV: 1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-auto-schedule, calendar-availability, nc-calendar-webcal-cache, calendarserver-subscribed, oc-resource-sharing, oc-calendar-publishing, calendarserver-sharing, nc-calendar-search, nc-enable-birthday-calendar
MS-Author-Via: DAV
Accept-Ranges: bytes
Content-Length: 0
Content-Type: text/html; charset=UTF-8A clue?
.authinfo.gpg works for email, mu4e, etc and has always worked for org-caldav. But setting auth-source-debug t does not add information to the message buffer when I call org-caldav-sync. I do get messages from auth-source when using my email through mu4e. I've tried regular auth-source with .authinfo.gpg and auth-source-pass putting the secretes in a file named by host. same result.
Error backtrace from debug-on-error:
Debugger entered--Lisp error: (error "Error while checking for OPTIONS at URL https://example.org/nextcloud/remote.php/dav/calendars/username/personal/: 404 Not Found")
signal(error ("Error while checking for OPTIONS at URL https://example.org/nextcloud/remote.php/dav/calendars/username/personal/: 404 Not Found"))
error("Error while checking for OPTIONS at URL %s: %s" "https://example.org/nextcloud/remote.php/dav/calendars/username/personal/" "404 Not Found")
(progn (switch-to-buffer buffer) (error "Error while checking for OPTIONS at URL %s: %s" url response))
(if (not (string-match "2[0-9][0-9].*" response)) (progn (switch-to-buffer buffer) (error "Error while checking for OPTIONS at URL %s: %s" url response)))
(let ((response (match-string 1))) (if (not (string-match "2[0-9][0-9].*" response)) (progn (switch-to-buffer buffer) (error "Error while checking for OPTIONS at URL %s: %s" url response))))
(save-current-buffer (set-buffer buffer) (if (= 0 (buffer-size)) (progn (error "Not data received for URL %s (maybe TLS problem)." url))) (goto-char (point-min)) (if (not (re-search-forward "^HTTP[^ ]* \\([0-9]+ .*\\)$" (point-at-eol) t)) (progn (switch-to-buffer buffer) (error "No valid HTTP response from URL %s." url))) (let ((response (match-string 1))) (if (not (string-match "2[0-9][0-9].*" response)) (progn (switch-to-buffer buffer) (error "Error while checking for OPTIONS at URL %s: %s" url response)))) (mail-narrow-to-head) (let ((davheader (mail-fetch-field "dav"))) (if (not davheader) (progn (switch-to-buffer buffer) (error "The URL %s does not accept DAV requests" url)))))
(let* ((buffer (org-caldav-url-retrieve-synchronously url "OPTIONS")) (header nil) (options nil)) (if (not buffer) (progn (error "Retrieving URL %s failed." url))) (save-current-buffer (set-buffer buffer) (if (= 0 (buffer-size)) (progn (error "Not data received for URL %s (maybe TLS problem)." url))) (goto-char (point-min)) (if (not (re-search-forward "^HTTP[^ ]* \\([0-9]+ .*\\)$" (point-at-eol) t)) (progn (switch-to-buffer buffer) (error "No valid HTTP response from URL %s." url))) (let ((response (match-string 1))) (if (not (string-match "2[0-9][0-9].*" response)) (progn (switch-to-buffer buffer) (error "Error while checking for OPTIONS at URL %s: %s" url response)))) (mail-narrow-to-head) (let ((davheader (mail-fetch-field "dav"))) (if (not davheader) (progn (switch-to-buffer buffer) (error "The URL %s does not accept DAV requests" url))))))
org-caldav-check-dav("https://example.org/nextcloud/remote.php/dav/calendars/username/personal/")
org-caldav-check-connection()
(if (= numretry (1- org-caldav-retry-attempts)) (org-caldav-check-connection) (org-caldav-debug-print 1 "Got error while checking connection (will try again):" err) (setq numretry (1+ numretry)))
(condition-case err (progn (org-caldav-check-connection) (setq success t)) (error (if (= numretry (1- org-caldav-retry-attempts)) (org-caldav-check-connection) (org-caldav-debug-print 1 "Got error while checking connection (will try again):" err) (setq numretry (1+ numretry)))))
(while (null success) (condition-case err (progn (org-caldav-check-connection) (setq success t)) (error (if (= numretry (1- org-caldav-retry-attempts)) (org-caldav-check-connection) (org-caldav-debug-print 1 "Got error while checking connection (will try again):" err) (setq numretry (1+ numretry))))))
(let ((numretry 0) success) (while (null success) (condition-case err (progn (org-caldav-check-connection) (setq success t)) (error (if (= numretry (1- org-caldav-retry-attempts)) (org-caldav-check-connection) (org-caldav-debug-print 1 "Got error while checking connection (will try again):" err) (setq numretry (1+ numretry)))))))
(lambda nil (if (org-caldav-sync-do-org->cal) (progn (let ((--dolist-tail-- (org-caldav-get-org-files-for-sync)) filename) (while --dolist-tail-- (setq filename (car --dolist-tail--)) (if (not (file-exists-p filename)) (progn (if ... ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (if (org-caldav-use-oauth2) (progn (org-caldav-check-oauth2 org-caldav-url) (org-caldav-retrieve-oauth2-token org-caldav-url org-caldav-calendar-id))) (let ((numretry 0) success) (while (null success) (condition-case err (progn (org-caldav-check-connection) (setq success t)) (error (if (= numretry (1- org-caldav-retry-attempts)) (org-caldav-check-connection) (org-caldav-debug-print 1 "Got error while checking connection (will try again):" err) (setq numretry (1+ numretry))))))) (if resume nil (setq org-caldav-event-list nil org-caldav-previous-files nil) (org-caldav-load-sync-state) (if org-caldav-previous-files (progn (let ((missing (cl-set-difference org-caldav-previous-files org-caldav-files :test ...))) (if (and missing (not ...)) (progn (user-error "Sync aborted")))))) (let ((--dolist-tail-- org-caldav-event-list) cur) (while --dolist-tail-- (setq cur (car --dolist-tail--)) (if (eq (org-caldav-event-status cur) (quote ignored)) nil (org-caldav-event-set-status cur nil)) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if (org-caldav-sync-do-org->cal) (progn (setq org-caldav-ics-buffer (org-caldav-generate-ics)) (org-caldav-update-eventdb-from-org org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-eventdb-from-cal)))) (if (org-caldav-sync-do-org->cal) (progn (org-caldav-update-events-in-cal org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-events-in-org))) (org-caldav-save-sync-state) (setq org-caldav-event-list nil) (if (org-caldav-sync-do-org->cal) (progn (save-current-buffer (set-buffer org-caldav-ics-buffer) (set-buffer-modified-p nil) (kill-buffer)) (delete-file (buffer-file-name org-caldav-ics-buffer)))))()
funcall((lambda nil (if (org-caldav-sync-do-org->cal) (progn (let ((--dolist-tail-- (org-caldav-get-org-files-for-sync)) filename) (while --dolist-tail-- (setq filename (car --dolist-tail--)) (if (not ...) (progn ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (if (org-caldav-use-oauth2) (progn (org-caldav-check-oauth2 org-caldav-url) (org-caldav-retrieve-oauth2-token org-caldav-url org-caldav-calendar-id))) (let ((numretry 0) success) (while (null success) (condition-case err (progn (org-caldav-check-connection) (setq success t)) (error (if (= numretry ...) (org-caldav-check-connection) (org-caldav-debug-print 1 "Got error while checking connection (will try again):" err) (setq numretry ...)))))) (if resume nil (setq org-caldav-event-list nil org-caldav-previous-files nil) (org-caldav-load-sync-state) (if org-caldav-previous-files (progn (let ((missing ...)) (if (and missing ...) (progn ...))))) (let ((--dolist-tail-- org-caldav-event-list) cur) (while --dolist-tail-- (setq cur (car --dolist-tail--)) (if (eq (org-caldav-event-status cur) (quote ignored)) nil (org-caldav-event-set-status cur nil)) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if (org-caldav-sync-do-org->cal) (progn (setq org-caldav-ics-buffer (org-caldav-generate-ics)) (org-caldav-update-eventdb-from-org org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-eventdb-from-cal)))) (if (org-caldav-sync-do-org->cal) (progn (org-caldav-update-events-in-cal org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-events-in-org))) (org-caldav-save-sync-state) (setq org-caldav-event-list nil) (if (org-caldav-sync-do-org->cal) (progn (save-current-buffer (set-buffer org-caldav-ics-buffer) (set-buffer-modified-p nil) (kill-buffer)) (delete-file (buffer-file-name org-caldav-ics-buffer))))))
(let ((org-caldav-skip-conditions (quote (nottimestamp))) (org-caldav-inbox (quote "~/org/personal-cal-inbox.org")) (org-caldav-files (quote ("~/org/personal.org"))) (org-caldav-calendar-id (quote "personal"))) (funcall (quote (lambda nil (if (org-caldav-sync-do-org->cal) (progn (let (... filename) (while --dolist-tail-- ... ... ...)))) (if (org-caldav-use-oauth2) (progn (org-caldav-check-oauth2 org-caldav-url) (org-caldav-retrieve-oauth2-token org-caldav-url org-caldav-calendar-id))) (let ((numretry 0) success) (while (null success) (condition-case err (progn ... ...) (error ...)))) (if resume nil (setq org-caldav-event-list nil org-caldav-previous-files nil) (org-caldav-load-sync-state) (if org-caldav-previous-files (progn (let ... ...))) (let ((--dolist-tail-- org-caldav-event-list) cur) (while --dolist-tail-- (setq cur ...) (if ... nil ...) (setq --dolist-tail-- ...))) (if (org-caldav-sync-do-org->cal) (progn (setq org-caldav-ics-buffer ...) (org-caldav-update-eventdb-from-org org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-eventdb-from-cal)))) (if (org-caldav-sync-do-org->cal) (progn (org-caldav-update-events-in-cal org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-events-in-org))) (org-caldav-save-sync-state) (setq org-caldav-event-list nil) (if (org-caldav-sync-do-org->cal) (progn (save-current-buffer (set-buffer org-caldav-ics-buffer) (set-buffer-modified-p nil) (kill-buffer)) (delete-file (buffer-file-name org-caldav-ics-buffer))))))))
eval((let ((org-caldav-skip-conditions (quote (nottimestamp))) (org-caldav-inbox (quote "~/org/personal-cal-inbox.org")) (org-caldav-files (quote ("~/org/personal.org"))) (org-caldav-calendar-id (quote "personal"))) (funcall (quote (lambda nil (if (org-caldav-sync-do-org->cal) (progn (let ... ...))) (if (org-caldav-use-oauth2) (progn (org-caldav-check-oauth2 org-caldav-url) (org-caldav-retrieve-oauth2-token org-caldav-url org-caldav-calendar-id))) (let ((numretry 0) success) (while (null success) (condition-case err ... ...))) (if resume nil (setq org-caldav-event-list nil org-caldav-previous-files nil) (org-caldav-load-sync-state) (if org-caldav-previous-files (progn ...)) (let (... cur) (while --dolist-tail-- ... ... ...)) (if (org-caldav-sync-do-org->cal) (progn ... ...)) (if (org-caldav-sync-do-cal->org) (progn ...))) (if (org-caldav-sync-do-org->cal) (progn (org-caldav-update-events-in-cal org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-events-in-org))) (org-caldav-save-sync-state) (setq org-caldav-event-list nil) (if (org-caldav-sync-do-org->cal) (progn (save-current-buffer ... ... ...) (delete-file ...))))))))
(let* ((syms (mapcar (quote org-caldav-var-for-key) calkeys)) (vals calvalues) (body (function (lambda nil (if (org-caldav-sync-do-org->cal) (progn (let ... ...))) (if (org-caldav-use-oauth2) (progn (org-caldav-check-oauth2 org-caldav-url) (org-caldav-retrieve-oauth2-token org-caldav-url org-caldav-calendar-id))) (let ((numretry 0) success) (while (null success) (condition-case err ... ...))) (if resume nil (setq org-caldav-event-list nil org-caldav-previous-files nil) (org-caldav-load-sync-state) (if org-caldav-previous-files (progn ...)) (let (... cur) (while --dolist-tail-- ... ... ...)) (if (org-caldav-sync-do-org->cal) (progn ... ...)) (if (org-caldav-sync-do-cal->org) (progn ...))) (if (org-caldav-sync-do-org->cal) (progn (org-caldav-update-events-in-cal org-caldav-ics-buffer))) (if (org-caldav-sync-do-cal->org) (progn (org-caldav-update-events-in-org))) (org-caldav-save-sync-state) (setq org-caldav-event-list nil) (if (org-caldav-sync-do-org->cal) (progn (save-current-buffer ... ... ...) (delete-file ...)))))) (binds nil)) (while syms (setq binds (cons (list (car-safe (prog1 syms (setq syms ...))) (list (quote quote) (car-safe (prog1 vals ...)))) binds))) (eval (list (quote let) binds (list (quote funcall) (list (quote quote) body)))))
(progn (let* ((syms (mapcar (quote org-caldav-var-for-key) calkeys)) (vals calvalues) (body (function (lambda nil (if (org-caldav-sync-do-org->cal) (progn ...)) (if (org-caldav-use-oauth2) (progn ... ...)) (let (... success) (while ... ...)) (if resume nil (setq org-caldav-event-list nil org-caldav-previous-files nil) (org-caldav-load-sync-state) (if org-caldav-previous-files ...) (let ... ...) (if ... ...) (if ... ...)) (if (org-caldav-sync-do-org->cal) (progn ...)) (if (org-caldav-sync-do-cal->org) (progn ...)) (org-caldav-save-sync-state) (setq org-caldav-event-list nil) (if (org-caldav-sync-do-org->cal) (progn ... ...))))) (binds nil)) (while syms (setq binds (cons (list (car-safe (prog1 syms ...)) (list (quote quote) (car-safe ...))) binds))) (eval (list (quote let) binds (list (quote funcall) (list (quote quote) body))))))
(let (calkeys calvalues oauth-enable) (let ((--dolist-tail-- (number-sequence 0 (1- (length calendar)) 2)) i) (while --dolist-tail-- (setq i (car --dolist-tail--)) (setq calkeys (append calkeys (list (nth i calendar))) calvalues (append calvalues (list (nth (1+ i) calendar)))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (progn (let* ((syms (mapcar (quote org-caldav-var-for-key) calkeys)) (vals calvalues) (body (function (lambda nil (if ... ...) (if ... ...) (let ... ...) (if resume nil ... ... ... ... ... ...) (if ... ...) (if ... ...) (org-caldav-save-sync-state) (setq org-caldav-event-list nil) (if ... ...)))) (binds nil)) (while syms (setq binds (cons (list (car-safe ...) (list ... ...)) binds))) (eval (list (quote let) binds (list (quote funcall) (list (quote quote) body)))))))
org-caldav-sync-calendar((:calendar-id "personal" :files ("~/org/personal.org") :inbox "~/org/personal-cal-inbox.org" :skip-conditions (nottimestamp)))
(while --dolist-tail-- (setq calendar (car --dolist-tail--)) (org-caldav-debug-print 1 "Syncing first calendar entry:" calendar) (org-caldav-sync-calendar calendar) (setq --dolist-tail-- (cdr --dolist-tail--)))
(let ((--dolist-tail-- org-caldav-calendars) calendar) (while --dolist-tail-- (setq calendar (car --dolist-tail--)) (org-caldav-debug-print 1 "Syncing first calendar entry:" calendar) (org-caldav-sync-calendar calendar) (setq --dolist-tail-- (cdr --dolist-tail--))))
(if (null org-caldav-calendars) (org-caldav-sync-calendar) (let ((--dolist-tail-- org-caldav-calendars) calendar) (while --dolist-tail-- (setq calendar (car --dolist-tail--)) (org-caldav-debug-print 1 "Syncing first calendar entry:" calendar) (org-caldav-sync-calendar calendar) (setq --dolist-tail-- (cdr --dolist-tail--)))))
(if (and org-caldav-event-list (not (eq org-caldav-resume-aborted (quote never))) (or (eq org-caldav-resume-aborted (quote always)) (and (eq org-caldav-resume-aborted (quote ask)) (y-or-n-p "Last sync seems to have been aborted. Should I try to resume? ")))) (org-caldav-sync-calendar org-caldav-previous-calendar t) (setq org-caldav-sync-result nil) (if (null org-caldav-calendars) (org-caldav-sync-calendar) (let ((--dolist-tail-- org-caldav-calendars) calendar) (while --dolist-tail-- (setq calendar (car --dolist-tail--)) (org-caldav-debug-print 1 "Syncing first calendar entry:" calendar) (org-caldav-sync-calendar calendar) (setq --dolist-tail-- (cdr --dolist-tail--))))))
org-caldav-sync()
funcall-interactively(org-caldav-sync)
call-interactively(org-caldav-sync record nil)
command-execute(org-caldav-sync record)
counsel-M-x-action("org-caldav-sync")
ivy-call()
ivy-read("M-x " [shr-image-fetched connection-failed diary-included-files epg-context-signers locals 0 rng-what-schema vc-git-stash-snapshot noheader tls-format-message tramp-adb-parse-device-names tramp-find-user bbdb-current-record duplicate magit-wip-buffer-backed-up gnus-info-set-score tramp-gvfs-handle-copy-file desktop-lazy-create-buffer gnus-agent-group-covered-p vc-src-log-switches prequery ess-inside-comment-p web-mode-warning-face local-only cl-print--preprocess matched-string font-name-1 counsel-evil-register-face org-agenda-regexp-filter-preset vc-git-conflicted-files 0 post-deadline ---- shr-parse-image-data \" quality message-kill-actions time-format & \' nnoo-import-1 gnus-summary-catchup-from-here tramp-cache-data rx-trans-forms Original\ sort magit-diff-wash-hunk not-at-beginning-of-line log-edit-set-header mu4e-view-image-max-height doc-view-pdf/ps->png ...] :predicate #f(compiled-function (sym) #<bytecode 0x1bf3121>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
counsel-M-x()
funcall-interactively(counsel-M-x)
call-interactively(counsel-M-x nil nil)
command-execute(counsel-M-x)