Coder Social home page Coder Social logo

Error syncing about org-caldav HOT 7 CLOSED

dengste avatar dengste commented on August 21, 2024
Error syncing

from org-caldav.

Comments (7)

dengste avatar dengste commented on August 21, 2024

It's not a problem in org-caldav but in the url-dav package which ships with Emacs.

When this happens, could you take a look at the buffer which appears as the first argument to url-dav-process-response? In the above backtrace, it's " http owncloud.e6h.org:443" (note the leading space!).

from org-caldav.

egh avatar egh commented on August 21, 2024

Oh, you're right. Sorry.

That buffer is empty and has no process. If I remove the unwind-protect from url-dav-process-response we can see the real problem:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (save-current-buffer (set-buffer buffer) (goto-char url-http-end-of-headers) (indent-rigidly (point) (point-max) -1000) (save-excursion (while (re-s$
  (progn (save-current-buffer (set-buffer buffer) (goto-char url-http-end-of-headers) (indent-rigidly (point) (point-max) -1000) (save-excursion (whil$
  (if buffer (progn (save-current-buffer (set-buffer buffer) (goto-char url-http-end-of-headers) (indent-rigidly (point) (point-max) -1000) (save-excu$
  (let ((tree nil) (overall-status nil)) (sleep-for 5) (message "%s" url) (message "%s" buffer) (if buffer (progn (save-current-buffer (set-buffer buf$
  url-dav-process-response(#<buffer  *http owncloud.e6h.org:443*-923814> "https://owncloud.e6h.org/remote.php/caldav/calendars/egh/org/")
  url-dav-request("https://owncloud.e6h.org/remote.php/caldav/calendars/egh/org/" "PROPFIND" DAV:propfind "<DAV:prop><DAV:getetag/></DAV:prop>" 1 nil $
  url-dav-get-properties("https://owncloud.e6h.org/remote.php/caldav/calendars/egh/org/" (DAV:getetag) 1)
  org-caldav-get-event-etag-list()
  org-caldav-update-eventdb-from-cal()
  org-caldav-sync()

I did notice that org-caldav-get-event-etag-list gets called a number of times, and I think the problem may be url-http reusing connections. The following hack fixes the error by caching the return value of org-caldav-get-event-etag-list, but it obviously doesn't fix the underlying problem.

(defvar egh:org-caldav-get-event-etag-list-cache nil)

(defadvice org-caldav-get-event-etag-list (around org-caldav-get-event-etag-list-around activate)
  (if (null egh:org-caldav-get-event-etag-list-cache)
      (setq egh:org-caldav-get-event-etag-list-cache
            ad-do-it))
  (setq ad-return-value egh:org-caldav-get-event-etag-list-cache))

but that is obviously not the right solution.

from org-caldav.

egh avatar egh commented on August 21, 2024

In fact, that doesn't seem to fix the error, except that calling the function org-caldav-get-event-etag-list before calling org-caldav-sync works. So if you cache the result of that call, the call to org-caldav-sync works.

from org-caldav.

dengste avatar dengste commented on August 21, 2024

As you might have seen, url-dav-request calls url-retrieve-synchronously to do the DAV request, and it seems that this fails. The question is why that happens. I wouldn't know why reusing a http connection could cause this. Unfortunately, url-dav does not care much for error handling, but usually assumes that everything just works... Since I cannot reproduce this, it's hard for me to guess what's going on. All you can do is to try to figure out why the call to url-retrieve-synchronously fails and returns an empty buffer.

from org-caldav.

egh avatar egh commented on August 21, 2024

Thanks. If I rewrite url-http-find-free-connection to not reuse connections, syncing works. It looks like a problem with url-http. I'll report upstream.

from org-caldav.

egh avatar egh commented on August 21, 2024

Filed emacs bug. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14983

from org-caldav.

dengste avatar dengste commented on August 21, 2024

OK, I'll close it here, then.

from org-caldav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.