Caldav/carddav combined not found, but separated found



  • Using davdroid 0.6 Android 4.4.4 (omni-rom) and owncloud 6.0.4, I can find ans sync my calendars under /remote.php/caldav, find and sync my contacts under remote.php/carddav, but if I enter just /remote.php after my server address, davdroid keeps telling me that "Invalid DAV response: Weder CalDAV noch Carddav ist installiert".

    I don't know what I do wrong here (I think nothing as the links work perfectly when separated) - I always (still) have to use 2 caldav accounts to keep it both syncronized.


  • developer

    Have you set up well-known URLs like described on http://davdroid.bitfire.at/configuration?

    Please give detailled steps to reproduce and optimally include logs.



  • Oh. Surely not. Didn't know that this should be done server side. Sorrrrry, my fault.



  • Oh. I just saw that owncloud per se defines these rewrites (and hence redirects). So owncloud SHOULD work out of the box, right?
    See my log attached:

    D/davdroid.SNISocketFactory( 6461): Preparing direct SSL connection (without proxy) to https://example.at:443
    D/davdroid.SNISocketFactory( 6461): Using documented SNI with host name example.at
    I/davdroid.SNISocketFactory( 6461): Established TLSv1 connection with example.at using SSL_RSA_WITH_RC4_128_MD5
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "PROPFIND /owncloud/ HTTP/1.1[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "Depth: 0[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "Content-Length: 88[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "Host: example.at[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "Connection: Keep-Alive[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "User-Agent: DAVdroid/0.6[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "Authorization: Basic XXXXXXXXXXXXXXXXX=[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "<propfind xmlns="DAV:">[\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "   <prop>[\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "      <current-user-principal/>[\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "   </prop>[\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 >> "</propfind>"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "HTTP/1.1 405 Method Not Allowed[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Date: Sun, 20 Jul 2014 18:34:20 GMT[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Server: Apache[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "X-Powered-By: PHP/5.4.17[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Expires: Thu, 19 Nov 1981 08:52:00 GMT[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Pragma: no-cache[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Strict-Transport-Security: max-age=31536000[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "X-XSS-Protection: 1; mode=block[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "X-Content-Type-Options: nosniff[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "X-Frame-Options: Sameorigin[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: 5261821e2dc17=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; path=/owncloud; HttpOnly[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: 5261821e2dc17=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; path=/owncloud; secure; HttpOnly[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: oc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/owncloud[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: oc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/owncloud[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: oc_remember_login=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/owncloud[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: oc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/owncloud/[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: oc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/owncloud/[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Set-Cookie: oc_remember_login=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/owncloud/[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Vary: Accept-Encoding[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Content-Length: 0[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Keep-Alive: timeout=4, max=300[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Connection: Keep-Alive[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "Content-Type: text/html; charset=utf-8[\r][\n]"
    D/ch.boye.httpclientandroidlib.wire( 6461): http-outgoing-12 << "[\r][\n]"
    D/davdroid.ServerInfoLoader( 6461): Service detection failed with HTTP error
    

  • developer

    Oh. I just saw that owncloud per se defines these rewrites (and hence redirects). So owncloud SHOULD work out of the box, right?

    Honestly, I don't know. The OwnCloud installation manual will be the right place to look this up ;)

    However, according to your logs, DAVdroid tries the /owncloud/ path which is not DAV-capable according to the server's response.



  • Then this is the problem. I can use owncloud in the /owncloud/ subfolder very well for DAV-sync - IF I provide the full caldav and carddav URLs. But then I need 2 accounts again.
    I'll try to ask at owncloud If they have an idea (or wether subfolders are supported for owncloud installation with DAV capability). In meantime we can close this bug again, as it has really nothing to do with davdroid.
    Thanks for your help and quick response.



  • Hello!
    I just reinstalled DAVdroid and tried to use the new method with .well-known addresses. I am using OwnCloud 7, installed on a /ownlcoud/ subfolder, and the .htaccess file was changed accordingly. But I got the same HTTP 405 error as the bug reporter.

    An excerpt from my example.com/owncloud/.htaccess:

    RewriteEngine on
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^\.well-known/host-meta /owncloud/public.php?service=host-meta [QSA,L]
    RewriteRule ^\.well-known/host-meta\.json /owncloud/public.php?service=host-meta-json [QSA,L]
    RewriteRule ^\.well-known/carddav /owncloud/remote.php/carddav/ [R]
    RewriteRule ^\.well-known/caldav /owncloud/remote.php/caldav/ [R]
    

    When calling the domain manually in a browser, something like example.com/owncloud/.well-known/carddav is redirected correctly to example.com/owncloud/remote.php/carddav. But it doesn’t work in DAVdroid. Please note that everything is done with https.

    Maybe it has something to do with the first RewriteRule. I don’t know what it does, and since the manual request works, I did not investigate there further. But then I had an idea. What if DAVdroid really needs a server address without subdirectories?

    I added the four lines with .well-known addresses to my .htaccess file in root folder (example.com/.htaccess), tried again: works! DAVdroid found my OwnCloud caldav and carddav addresses, everything fine. Afterwards you can remove these lines again.

    So the question is, error on htaccess configuration or in DAVdroid?


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.