Sync with Cozycloud



  • Hello there,

    Thank you for DAVDroid that is probably a great software. I'm trying to sync my Cozy with a new phone based on Android 4.4.

    The DAVDroid installation worked fine but when I try to configure a new account, It keeps on telling that the host is wrong. It can't find mycozy.cozycloud.cchttps. It looks like the host string is wrongly built.

    Did I miss something or is that a bug?


  • developer

    1. Redirections MUST always contain absolute URLs. However, cozycloud does not, so DAVdroid tried to build one, which failed. I have fixed the DAVdroid mistake and we should notify Cozy about their mistake (using relative redirection URLs).
    2. Even after fixing this, it doesn't work because cozycloud returns /public/sync as the CalDAV/CardDAV service path, although this is apparently wrong:
    $ curl -vX PROPFIND --data @cup.xml -u xxx:xxx https://xxx.cozycloud.cc/.well-known/caldav
    > PROPFIND /.well-known/caldav HTTP/1.1
    > Authorization: Basic xxxxxxxxxxxxx
    > User-Agent: curl/7.32.0
    > Host: xxx.cozycloud.cc
    > Content-Length: 73
    > Content-Type: application/x-www-form-urlencoded
    > Accept: */*
    > 
    < HTTP/1.1 302 Moved Temporarily
    < Server: nginx
    < Date: Sun, 20 Jul 2014 12:22:57 GMT
    < Content-Type: text/plain; charset=UTF-8
    < Content-Length: 47
    < Connection: keep-alive
    < Location: /public/sync/
    

    (Note the incorrect relative Location URL.)

    The contents of cup.xml are:

    <propfind xmlns="DAV:">
    	<prop>
    		<current-user-principal />
    	</prop>
    </propfind>
    

    When trying /public/sync:

    $ curl -vX PROPFIND -u xxx:xxx --data @cup.xml https://xxx.cozycloud.cc/public/sync/
    > PROPFIND /public/sync/ HTTP/1.1
    > Authorization: Basic xxxxxxxxxxxxxx
    > User-Agent: curl/7.32.0
    > Host: xxx.cozycloud.cc
    > Accept: */*
    > Content-Length: 73
    > Content-Type: application/x-www-form-urlencoded
    > 
    < HTTP/1.1 404 Not Found
    < Server: nginx
    < Date: Sun, 20 Jul 2014 12:27:29 GMT
    < Content-Type: text/html; charset=utf-8
    < Content-Length: 746
    < Connection: keep-alive
    

    So this is a CozyCloud error. Would you mind reporting the problem to CozyCloud, referencing this issue for technical details?



  • Ok I work at Cozy Cloud, I'm not the guy responsible for the Sync module. So, I will pass the information. Thank you.

    There is already an issue open mentioning problems syncing DAV. https://github.com/cozy/cozy-sync/issues/24 . We'll work on it and then come back to you soon after.



  • Hi @rfc2822, I am the cozy developper responsible for the Sync module.
    Ok for your first point, we will change the 302 to an absolute path.

    However, for your second, I couldn't reproduce on frank's instance. (cf curl stack below). On what cozy instance did you test ? The demo or do you have your own ? If so, have you installed the cozy-sync module ? We recently updated it to rename it from cozy-webdav to cozy-sync, so if you installed it more than a month ago, you might have to uninstall-reinstall it.

    Thanks for helping us with cozy's compatibility.

    curl -vLX PROPFIND --user me:notmypassword https://XXXXXXXXXX.cozycloud.cc/.well-known/caldav
    > PROPFIND /.well-known/caldav HTTP/1.1
    > Authorization: Basic bWU6bm90bXlwYXNzd29yZA==
    > User-Agent: curl/7.26.0
    > Host: XXXXXXXXXXXX.cozycloud.cc
    > Accept: */*
    >
    < HTTP/1.1 302 Moved Temporarily
    < Server: nginx
    < Date: Mon, 21 Jul 2014 10:32:00 GMT
    < Content-Type: text/plain; charset=UTF-8
    < Content-Length: 47
    < Connection: keep-alive
    < Location: /public/sync/
    < Vary: Accept
    < Set-Cookie: XXXXXXXXXXX; HttpOnly
    <
    > PROPFIND /public/sync/ HTTP/1.1
    > Authorization: Basic XXXXXXXXXXXXXXXXXX==
    > User-Agent: curl/7.26.0
    > Host: XXXXXXXXXX.cozycloud.cc
    > Accept: */*
    >
    < HTTP/1.1 401 Unauthorized
    < Server: nginx
    < Date: Mon, 21 Jul 2014 10:32:00 GMT
    < Content-Type: application/xml; charset=utf-8
    < Transfer-Encoding: chunked
    < Connection: keep-alive
    * Authentication problem. Ignoring this.
    < www-authenticate: Basic realm="jsDAV"
    < Set-Cookie: XXXXXXXXXXX; HttpOnly
    <
    <?xml version="1.0" encoding="utf-8"?>
    <d:error xmlns:d="DAV:" xmlns:a="http://ajax.org/2005/aml">
        <a:exception>NotAuthenticated</a:exception>
        <a:message>Username or password does not match</a:message>
    <a:jsdav-version>0.3.2</a:jsdav-version>
    </d:error>
    

  • developer

    On what cozy instance did you test ?

    "dkm.cozycloud.cc", provided by a user.


  • developer

    @aenario, where you able to reproduce the problem with the dkm instance?

    Or can you maybe provide a test account for us so that we can test DAVdroid against Cozycloud?



  • Could you provide us with an email? So we could create an instance for you.


  • developer

    Of course, please send the details to play@bitfire.at


  • developer

    @frankrousseau @aenario Thanks! But I got the 404 error on PROPFIND /public/sync for our instance, too. (At the moment, I get Bad Gateway, but I guess that will be temporary.)


  • developer

    Any news on this?



  • We didn't find time to investigate it. We'll work on it next week. Sorry for the delay.



  • Hi rfc2822, it appears you havent installed the webdav module in your cozy instance.
    You need to go to https://play.cozycloud.cc/#applications and choose the "sync" module from the list.


  • developer

    Hi rfc2822, it appears you havent installed the webdav module in your cozy instance.
    You need to go to https://play.cozycloud.cc/#applications and choose the "sync" module from the list.

    Thanks, I was now able to get it working by installing the Sync module. I'll add instructions to http://davdroid.bitfire.at/configuration


Log in to reply
 

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