dengste / org-caldav

Caldav sync for Emacs orgmode
GNU General Public License v3.0
724 stars 105 forks source link

No sync with sogo and gandi HTTP/1.1 400 Bad Request #177

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hello, I am trying to sync with sogo with the gandi registrar. I have followed the kolab documentation to configure org-caldav-sync with sogo.

== Calendar URL under Sogo == My calendar has this url under Sogo : https://webmail.gandi.net/SOGo/dav/joe@foo.org/Calendar/personal/

== ~/.emacs == Here is my emacs init : ;; The CalDAV URL with your full and primary email address at the end. (setq org-caldav-url "https://webmail.gandi.net/SOGo/dav/joe@foo.org/Calendar")

;; The name of your calendar, typically "Calendar" or similar (setq org-caldav-calendar-id "personal")

== Output error == When I launch org-caldav-sync here is the output : HTTP/1.1 400 Bad Request ========== Started sync. Check connection for https://webmail.gandi.net/SOGo/dav/joe@foo.org/Calendar/. Got error while checking connection (will try again): (error "Error while checking for OPTIONS at URL https://webmail.gandi.net/SOGo/dav/joe@foo.org/Calendar/: 401 Authorization Required") Check connection for https://webmail.gandi.net/SOGo/dav/joe@foo.org/Calendar/. Got error while checking connection (will try again): (error "Error while checking for OPTIONS at URL https://webmail.gandi.net/SOGo/dav/joe@foo.org/Calendar/: 400 Bad Request")

== Same error with %40 instead of @ : == ;; The CalDAV URL with your full and primary email address at the end. (setq org-caldav-url "https://webmail.gandi.net/SOGo/dav/joe**%40**foo.org/Calendar")

;; The name of your calendar, typically "Calendar" or similar (setq org-caldav-calendar-id "personal")

== Same error with : another URL with the email at the end == ;; The CalDAV URL with your full and primary email address at the end. (setq org-caldav-url "https://webmail.gandi.net/SOGo/dav/**joe@foo.org**")

;; The name of your calendar, typically "Calendar" or similar (setq org-caldav-calendar-id "Calendar")

Any clues ?

dengste commented 5 years ago

This could be the same issue as #178.

Does

(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

fix this?

ghost commented 5 years ago

This could be the same issue as #178.

Does

(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

fix this?

It does not fix it unfortunately.

Here is the org-caldav-debug output :

========== Started sync. Check connection for https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/. Got error while checking connection (will try again): (error "Error while checking for OPTIONS at URL https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/: 401 Authorization Required") Check connection for https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/. Got error while checking connection (will try again): (error "Error while checking for OPTIONS at URL https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/: 400 Bad Request") Check connection for https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/. Got error while checking connection (will try again): (error "Error while checking for OPTIONS at URL https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/: 400 Bad Request") Check connection for https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/. Got error while checking connection (will try again): (error "Error while checking for OPTIONS at URL https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/: 400 Bad Request") Check connection for https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/. Check connection for https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/Calendar/.

For your information when typing : curl -D - -X OPTIONS --basic -u test@email.io:[password] https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal/

I got this :

HTTP/1.1 200 OK Date: Tue, 06 Aug 2019 15:31:59 GMT Server: Apache Sogo-Request-Duration: 0.197205 Content-Type: text/plain; charset=UTF-8 Allow: GET, HEAD, POST, OPTIONS, MKCOL, MKCALENDAR, DELETE, PUT, LOCK, UNLOCK, COPY, MOVE, REPORT, PROPFIND, SEARCH Content-Length: 0 DAV: 1, 2, access-control, calendar-access, calendar-schedule, calendar-auto-schedule, calendar-proxy, calendar-query-extended, extended-mkcol, calendarserver-principal-property-search Via: 1.1 varnish-v4, 1.1 varnish-v4 X-Cache-Hits: 0 X-Cache: MISS Accept-Ranges: bytes Age: 0 Connection: keep-alive

dengste commented 5 years ago

org-caldav tries to connect to

https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal//Calendar/

This looks wrong. Why is there a '//Calendar/' appended to the URL? I don't see where that would be coming from.

grauschnabel commented 5 years ago

I tried different things, only upgrade to emacs 27.x worked for me.

ghost commented 5 years ago

org-caldav tries to connect to

https://webmail.gandi.net/SOGo/dav/test@email.io/Calendar/personal//Calendar/

This looks wrong. Why is there a '//Calendar/' appended to the URL? I don't see where that would be coming from.

You are right, I made a typo in my init.el org-caldav settings. I have corrected this and get the same error as displayed above (I edit the previous comment regarding this typo).

====

I tried different things, only upgrade to emacs 27.x worked for me.

I do want to jump in an unstable thing sorry ;)

dengste commented 5 years ago

You can also upgrade to the current Emacs preset 26.2.90, which is just a minor upgrade from Emacs 26.2. This at least will fix problems with connecting via TLS v1.3, but it might well be that you have another problem, but since I cannot test it I'm afraud there's not much I can do.

ghost commented 5 years ago

You can also upgrade to the current Emacs preset 26.2.90, which is just a minor upgrade from Emacs 26.2. This at least will fix problems with connecting via TLS v1.3, but it might well be that you have another problem, but since I cannot test it I'm afraud there's not much I can do.

Hello same error on emacs 26.3, I can provide you a test account if needed.

dengste commented 5 years ago

I can provide you a test account if needed.

OK, please send login data to deng@randomsample.de and I'll take a look.

dengste commented 5 years ago

Thanks for the account. Using Emacs 26.3, syncing worked for me using the following configuration:

(setq org-caldav-url "https://webmail.gandi.net/SOGo/dav/admin@ninix.io/Calendar"
    org-caldav-calendar-id "personal"
    org-caldav-inbox "/home/void/org/sogo-inbox.org"
    org-caldav-files '("/home/void/org/to-sogo.org")
    org-icalendar-timezone "Europe/Berlin"
    org-caldav-calendars nil)

and in .authinfo:

machine webmail.gandi.net:443 port https login admin@ninix.io password THE_PASSWORD

So I'm afraid I'm unable to reproduce your problem. This is on a Debian 10 box, which has gnutls 3.6.7-4.

dengste commented 4 years ago

Closed as not reproducible from my side.