We have moved to a new Sailfish OS Forum. Please start new discussions there.
87

New CardDav/CalDav support got to it working with owncloud?

asked 2014-10-24 20:19:56 +0300

FloR707 gravatar image

updated 2015-11-21 10:20:34 +0300

Hi does anyone got the new CalDav/CardDav support working with owncloud? I am not sure what URLs to enter. I also do not like that you do not see if the system is trying to sync. Is there a log file I could check?

I am using OC 8.0.2 on a hosted server with a self signed SSL certificate.

I also dislike that it is not possible to edit the server information after the account was set up. I always have to delete the account and start from scratch. =(

[edit]

I spend another two days looking at OC to get it working. Finally I gave up. The Jolla functions do not work for me and I do not know why. SyncEvolution gives me a 403 error.

I think it is a problem on several sides. 1. The Jolla client is not ready, 2. OC is not working if self-singed certificates are used. I will wait for updates on both sides and hope that it will work at some point in the future...

[edit 2014-12-12] The last days I spend some more time trying to get this working. I updated to OC 7.0.4 but with Syncevolution I still get an 403 access denied error and CalDav account still does nothing. Is it possible to see in an OC log if there was a sync attempt?

[edit 2014-12-13] I downgraded to OC 6.0.6 and switched to a MySQL DB and now the CalDav works for me as well with cdv's settings. At last =)

[edit 2015-01-04] Looks like the problem was not with the OC version but with the database. I did a new setup with OC 7.0.4 and MySQL (first try was SQLite) and it works for me with a self-signed certificate. What I did prior to setting up the account is to open the OC web interface with a browser to "install" the SSL certificates. Looks like the CalDav client is not capable of doing that.

[edit 2015-04-18] Calendar still works with OC 8.0.2 on a hosted server with self-signed SSL certificate. Looks like people got contacts so sync as well as long they do not use SSL and OC 8.x. I hope that the SSL issue with contacts will be solved in the next update.

[edit 2015-11-21] Since the update to 2.0 I think owncloud is working fine. Both caldav and carddav with a self-signed cert.

edit retag flag offensive close delete

Comments

8

Agreed -some kind of sync notification or progress would certainly be helpful.

Malakim ( 2014-10-24 21:03:40 +0300 )edit
3

I got CalDav to work with path: /owncloud/remote.php/caldav/calendars/-username- Still no luck with CardDav though.

Maldela ( 2014-10-24 21:17:30 +0300 )edit

I got the error message from dbus-monitor.

gehowa ( 2014-10-25 00:12:08 +0300 )edit

The contact addressbook set path is determined using DAV discovery (ie, automatically during sync). If that is not working, can you get the log of the sync (see raven24's answer below) which may help you determine what is going wrong for CardDAV sync?

chris.adams ( 2014-10-28 03:46:34 +0300 )edit

I am still getting nowhere here. I followed raven's instructions but I cannot set up the service. I always get an error after accepting the login and server details. The log says the following:

caldav-client[16157]: [D] main:70 - attempting to register dbus service: "com.buteo.msyncd.plugin.caldav-sync-100" 
caldav-client[16157]: [D] main:77 - Plugin  "caldav"  with profile  "caldav-sync-100"  registered at dbus  "com.buteo.msyncd.plugin.caldav-sync-100"  and path  /
caldav-client[16157]: [D] Buteo::ProfileManagerPrivate::loadLog:167 - No sync log found for profile: "caldav-sync-100"

OC gives me a warning after each try:

Warning core    isWebDAVWorking: NO - Reason: [CURL] Error while making request: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (error code: 35) (Sabre\DAV\Exception)

I guess that is due to the fact that I am using a self signed SSL certificate. I also found a solution for that warning but that did not work. The warning is still there and I cannot connect.

I used to be able to sync using SyncEvolution but only until I upgraded to 7.0.0

FloR707 ( 2014-10-28 19:06:37 +0300 )edit

12 Answers

Sort by » oldest newest most voted
0

answered 2015-11-26 00:30:17 +0300

antoniovr gravatar image

I have tested every combination (server name / path) for a caldav owncloud account without success. Something is going wrong at some point, as it detects the names of the calendars, but it is not able to sync. Carddav has been synced without problems.

Errors in sync are always the following

nov 25 23:26:29 Jolla estart[6144]: [W] Buteo::ProfileManagerPrivate::writeProfileFile:1153 - writeProfileFile() called, forcing disk write: "/home/nemo/.cache/msyncd/sync/caldav-sync-44.xml" 
nov 25 23:26:29 Jolla [2195]: [W] Buteo::ProfileManagerPrivate::writeProfileFile:1153 - writeProfileFile() called, forcing disk write: "/home/nemo/.cache/msyncd/sync/caldav-sync-44.xml" 
nov 25 23:26:29 Jolla [2195]: [W] Buteo::ProfileManagerPrivate::writeProfileFile:1153 - writeProfileFile() called, forcing disk write: "/home/nemo/.cache/msyncd/sync/caldav-sync-44.xml" 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::ConnectionManager::setupSocketConnection:106 - connection-manager.cpp 106 setupSocketConnection p2p error: QDBusError("org.freedesktop.DBus.Error.FileNotFound", "Failed to connect to socket /run/user/100000/signond/socket: No existe el fichero o el directorio") 1 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::ConnectionManager::init:132 - connection-manager.cpp 132 init Peer connection unavailable, activating service 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::IdentityImpl::updateState:96 - identityimpl.cpp 96 updateState Updating state:  "PendingRegistration" SignOn::IdentityImpl(0x1055300) 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::AuthSessionImpl::initInterface:94 - authsessionimpl.cpp 94 initInterface 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::AuthSessionImpl::initInterface:94 - authsessionimpl.cpp 94 initInterface 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::ConnectionManager::init:150 - connection-manager.cpp 150 init Connected to "libsignon-qt1" 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::IdentityImpl::updateState:96 - identityimpl.cpp 96 updateState Updating state:  "Ready" SignOn::IdentityImpl(0x1055300) 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::IdentityImpl::updateState:96 - identityimpl.cpp 96 updateState Updating state:  "NeedsUpdate" SignOn::IdentityImpl(0x1055300) 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::IdentityImpl::updateState:96 - identityimpl.cpp 96 updateState Updating state:  "PendingUpdate" SignOn::IdentityImpl(0x1055300) 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::IdentityImpl::infoUpdated:442 - identityimpl.cpp 442 infoUpdated SERVER INFO UPDATED. NeedsUpdate " 50 " 
nov 25 23:26:31 Jolla caldav-client[20923]: [W] mKCal::SqliteStorage::open:193 - sqlitestorage.cpp: 193 - database "/home/nemo/.local/share/system/privileged/Calendar/mkcal/db" opened 
nov 25 23:26:31 Jolla caldav-client[20923]: [W] CalDavClient::cleanSyncRequired:185 - Deleting caldav notebooks associated with this account: 44 due to clean sync 
nov 25 23:26:31 Jolla caldav-client[20923]: [W] CalDavClient::cleanSyncRequired:188 - Deleting caldav notebooks associated with nonexistent accounts due to clean sync 
nov 25 23:26:31 Jolla caldav-client[20923]: [W] CalDavClient::cleanSyncRequired:223 - Finished pre-sync cleanup with caldav account 44 
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::IdentityImpl::getInfoReply:381 - identityimpl.cpp 381 getInfoReply QMap(("ACL", QVariant(QStringList, () ) ) ( "AuthMethods" ,  QVariant(QDBusArgument, ) ) ( "Caption" ,  QVariant(QString, "Jolla") ) ( "Id" ,  QVariant(uint, 50) ) ( "Owner" ,  QVariant(QStringList, () ) ) ( "Realms" ,  QVariant(QStringList, () ) ) ( "RefCount" ,  QVariant(int, 0) ) ( "StoreSecret" ,  QVariant(bool, true) ) ( "Type" ,  QVariant(int, 0) ) ( "UserName" ,  QVariant(QString, "antviro") ) ( "UserNameSecret" ,  QVariant(bool, false) ) ( "Validated" ,  QVariant(bool, true) ) )  
nov 25 23:26:31 Jolla caldav-client[20923]: [D] SignOn::IdentityImpl::updateState:96 - identityimpl.cpp 96 updateState Updating state:  "Ready" SignOn::IdentityImpl(0x1055300) 
nov 25 23:26:32 Jolla caldav-client[20923]: [C] Request::finishedWithError:100 - "REPORT" request failed. 401 "Network request failed with QNetworkReply::NetworkError: 299" 
nov 25 23:26:32 Jolla caldav-client[20923]: [C] CalDavClient::syncFinished:370 - CalDAV sync failed: 401 "Network request failed with QNetworkReply::NetworkError: 299"

Last lines show the error, and always that I get set up the account same error appears when synchronizing. Are you having any problems at that?

edit flag offensive delete publish link more

Comments

From the documentation: QNetworkReply::UnknownContentError 299 an unknown error related to the remote content was detected So I don't think it is a jolla bug. Its more likely that there is something wrong with your owncloud setup. Do you have other clients using the sync functionality from your server and do they work?

Salzi ( 2015-11-26 09:06:00 +0300 )edit
3

answered 2015-08-26 11:31:32 +0300

stateoftheart gravatar image

updated 2015-08-26 12:55:59 +0300

Just wanted to update this four months old thread with the following Info.

(I hope it's helpfull for those people who got problems setting up a caldav/carddav account like me...)

caldav & carddav works for me with the following set-up: (except the caldav bug as stated here: https://together.jolla.com/question/60486/all-dates-shifted-by-one-hour-in-calendar-after-updating-to-11038/)


Testing Environment:

  • Sailfish OS 1.1.6.27
  • owncloud 8.1.1 (with self-signed certificate)

owncloud setup:

http -> https fix after upgrade from oc7 to oc8 (forcessl=true was removed from config file)

add this at the top of the .htaccess file in the owncloud web directory: (Please note that the following code should be used if the owncloud installation is under "/owncloud". If you set-up owncloud in the webroot directory, remove the "/owncloud".)

<IfModule mod_rewrite.c>
#rewrites owncloud http request to https
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/owncloud/$1 [R,L]
</IfModule>

Jolla certificate import:

Steps to import a self-signed certificate:

1.create a hash from your self-signed certificate:

$ openssl x509 -in {your_certificate}.crt -noout -hash

2.copy your self-signed certificate into the trusted certs folder

$ cp {path_to_your_certificate}/{your_certificate}.crt /etc/pki/tls/certs/

3.create a link inside the same directory to your self-signed certificate with the previously generated hash:

$ ln -s {your_certificate}.crt {your_certificate_hash}.0

4.now you are ready to connect to owncloud without activating the "Ignore SSL errors" button

Jolla caldav/carddav setup:

Account Settings: (Please note that the following links should be used if the owncloud installation is under "/owncloud". If you set-up owncloud in the webroot directory, remove the "/owncloud".)


[edit 2015-08-26]

Carddav doesn't automatically start the sync process after triggering the contact sync. The sync only starts if I manually start it from the account settings.

Jolla [1232]: [W] CDExporterController::onSyncTimeout:1067 - CDExport: triggering contacts sync "carddav"

(caldav syncs is not affected, it has it's own timeout setting which operates normally)

edit flag offensive delete publish link more

Comments

That last issue was fixed a little while ago, but apparently wasn't released in the most update. See https://github.com/nemomobile/contactsd/commit/8151c16ff37f22a5d7f4a0ef902eecae4b0b7bb7 for that one.

chris.adams ( 2015-08-26 16:08:52 +0300 )edit

Thanks a lot for your reply. Let's hope the daemon will be updated in the next Sailfish OS release. :-)

stateoftheart ( 2015-08-26 17:03:40 +0300 )edit

Hi stateoftheheart,

I'm running oC 7 and SFOS 1.1.7.28, and on the Jolla I set up separate accounts for CalDAV and CardDAV using your suggestions. It seems to be working perfectly.

Before using your settings, I used some that were suggested earlier in the thread, and they were fine on 1.1.6. On 1.1.7 CardDAV would work alright, but after the initial sync, the calendars wouldn't update any further, no matter if events were added/modified from oC or the Jolla.

So many thanks for sharing your findings :)

Piero ( 2015-09-05 21:26:43 +0300 )edit

I am still struggling with OC. I tried to follow your description but I already get lost at the first step. openssl does not work on my Jolla bash: openssl: command not found Also I do not understand where the crt file needs to be. On the server, on the phone or on a computer?

The path for calendar and contacts has been changed with the latest update. What settings do you use now?

FloR707 ( 2015-09-10 23:15:38 +0300 )edit

@Piero

I am glad I could help you out.

@FloR707

1.you can install openssl with the following commands:

//this command refreshes/updates the package managers software list
$ pkcon refresh
//this command installs openssl
$ pkcon install openssl

just fyi:

//this command will update all installed packages to the newest version
$ pkcon update

2.the crt file needs the be on the phone (under: /etc/pki/tls/certs/). You should already have the certificate file from your webserver.

3.with the latest update you mean sailfish 1.1.7.28, right? I haven't changed the settings and it still works for me with this version.

stateoftheart ( 2015-09-11 14:56:45 +0300 )edit
28

answered 2015-04-16 17:19:50 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2015-05-03 23:30:59 +0300

Andy Branson gravatar image

CardDAV works with ownCloud 1.1.4 (Update 13 , provided you don't use a self-signed SSL cert...)!

The ownCloud .htaccess file already handles the RFC5785 'well-known' URLs for both CardDAV and CalDAV, so you don't have to set up any paths. Leave the 'calendar path' blank, and it'll work fine for both calendar and contacts.

NOTE: Do not use the CardDav or CalDav paths you get from the Owncloud web interface, just the owncloud root URL, which is the part you see before the 'index.php' on your owncloud website address.

Even more thanks, Chris!

Example (brackets are comments):

Username: (your owncloud username)
Password: (your owncloud password)
Server address:http://your.owncloud.server/
Calendar path: (blank) (yes, completely blank)

CardDAV and CalDAV enabled.

If your owncloud is NOT installed on the root directory:

  • Include the installation path + remote.php in the server address, e.g. ''http://example.org/owncloud/remote.php/".
  • If that doesn't work: make separate CardDAV/CalDAV accounts.
    • For CalDAV put the following to server path "http://example.org/owncloud/remote.php/caldav/"
    • For CardDAV use "http://example.org/owncloud/remote.php/carddav/"

As an alternative you may also do redirecting of the ./well-known-URL from within the server root in an .htaccess-file, like so:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well-known/carddav /owncloud/remote.php/carddav/ [R]
RewriteRule ^\.well-known/caldav /owncloud/remote.php/caldav/ [R]
</IfModule>

If you must use self-signed SSL certificate, you must add your server certificate to your phone's trusted cert list.

Update 2015-04-22 - Chris (from Jolla) is working on both last issues: Ignoring SSL certificate errors and the trailing slash '/'. He is aware of the problems and working on them. Ignoring SSL errors is working from buteo-sync-plugin-carddav-0.0.10 on. Unfortunately the current version did not make it into the latest update (1.1.4, u13) leaving us with buteo-sync-plugin-carddav-0.0.9-1.4.1.

edit flag offensive delete publish link more

Comments

Hi Andy,

could you be so nice and explain a litte more in detail what you did?

  1. What is 1.1.4?
  2. Where did you setup the redirect rule?
  3. What did you put in the server path?

Thanks

FloR707 ( 2015-04-16 18:19:37 +0300 )edit

In my case it working too, but only if I don't use ssl. Ignoring ssl-errors didn't help. I'm using a local owncloud 8.03 server with no internet access on a synology nas.

As URL I used the given address from owncloud only with http instead of https.

LordRooster ( 2015-04-16 19:53:25 +0300 )edit
1

For me it also seems to work without https. Syncing with https produces following error on the log: Apr 16 22:23:04 Jolla carddav-client[10726]: [W] CardDav::userInformationResponse:342 - void CardDav::userInformationResponse() error: 6 ( 0 ) to request "..."

As I understand it, error 6 is SslHandshakeFailedError, so it seems 'ignore ssl errors' still doesn't work on all cases.

JPS ( 2015-04-16 22:28:17 +0300 )edit

Could somebody give some instructions? Just the fields and dummyvalues?

lispy ( 2015-04-17 12:02:52 +0300 )edit

What type of server are you using? In case of owncloud, just log in, go to your calendar and it will give you the url in the settings-section like shown in this picture.

LordRooster ( 2015-04-17 12:06:49 +0300 )edit
2

answered 2015-01-04 23:43:49 +0300

frisskiss gravatar image

Hi! I've got a Jolla phone since 1 week and I updated to 1.1.1.27. With Openmailbox service, I can set my caldav acount with:

USER: PASS: SERV: https://cloud.openmailbox.org PATH: /remote.php/caldav/calendars/user@openmailbox.org/calendarname

At the moment I can't sync the carddav account

edit flag offensive delete publish link more

Comments

There was a bug in the account creation code. Attempting to enable both caldav and carddav with one account does not work. Instead, you need to create one account for caldav, and a separate one for carddav. This bug has been fixed internally and will be released in an upcoming update.

chris.adams ( 2015-03-13 03:52:52 +0300 )edit

Hi Chris, can you please write down the explicit credentials for CardDAV on Owncloud? I have true trouble with setting up CardDAV on my OwnCloud.

ds1979 ( 2015-03-24 15:46:40 +0300 )edit

You need to wait for the upcoming update. It contains fixes in the jolla-accounts code and in the buteo-sync-plugin-carddav code which fixes all of the known issues when connecting to OwnCloud CardDAV endpoints.

chris.adams ( 2015-04-07 10:28:01 +0300 )edit
5

answered 2014-12-21 21:48:08 +0300

anyc gravatar image

updated 2014-12-21 21:48:26 +0300

I wrote a patch that results in one successful CardDav sync with owncloud. A guide, the patch (and a RPM) is available here: https://github.com/nemomobile/buteo-sync-plugin-carddav/pull/5

Unfortunately, further syncs fail so far but at least I get my current contacts. I will look into this.

edit flag offensive delete publish link more
1

answered 2014-12-11 20:14:59 +0300

Micha_Btz gravatar image

updated 2015-04-22 14:41:06 +0300

Yo gravatar image

i there a fix for carddav sync with owncloud?

Buteo::ProfileManagerPrivate::ProfileManagerPrivate:126 - Primary profile path set to "/home/nemo/.cache/msyncd" 
Buteo::ProfileManagerPrivate::ProfileManagerPrivate:127 - Secondary profile path set to "/etc/buteo/profiles" 
Buteo::LogTimer::LogTimer:72 - "Buteo::ProfileManager::ProfileManager(const QString&, const QString&)" :Entry 
Buteo::LogTimer::~LogTimer:83 - "Buteo::ProfileManager::ProfileManager(const QString&, const QString&)" :Exit, execution time: 0 ms 
Buteo::ProfileManagerPrivate::loadLog:167 - No sync log found for profile: "carddav.Contacts-21" 
Buteo::LogTimer::LogTimer:72 - "CardDavClient::CardDavClient(const QString&, const Buteo::SyncProfile&, Buteo::PluginCbInterface*)" :Entry 
Buteo::LogTimer::~LogTimer:83 - "CardDavClient::CardDavClient(const QString&, const Buteo::SyncProfile&, Buteo::PluginCbInterface*)" :Exit, execution time: 0 ms 
Buteo::LogTimer::LogTimer:72 - "virtual Buteo::ProfileManager::~ProfileManager()" :Entry 
Buteo::LogTimer::~LogTimer:83 - "virtual Buteo::ProfileManager::~ProfileManager()" :Exit, execution time: 0 ms 
Buteo::LogTimer::LogTimer:72 - "virtual bool CardDavClient::init()" :Entry 
Buteo::LogTimer::~LogTimer:83 - "virtual bool CardDavClient::init()" :Exit, execution time: 0 ms 
ContactsEngine::ContactsEngine:803 - The 'mergePresenceChanges' option has not been configured - presence changes will only be reported via ContactManagerEngine::contactsPresenceChanged()
Buteo::LogTimer::LogTimer:72 - "bool PluginServiceObj::startSync()" :Entry 
Buteo::LogTimer::~LogTimer:83 - "bool PluginServiceObj::startSync()" :Exit, execution time: 0 ms 
Buteo::LogTimer::LogTimer:72 - "virtual bool CardDavClient::startSync()" :Entry 
Buteo::LogTimer::~LogTimer:83 - "virtual bool CardDavClient::startSync()" :Exit, execution time: 0 ms 
Syncer::startSync:83 - void Syncer::startSync(int) starting carddav sync with account 21 
SignOn::IdentityImpl::updateState:103 - identityimpl.cpp 103 updateState Updating state:  PendingRegistration 
SignOn::AuthSessionImpl::initInterface:174 - authsessionimpl.cpp 174 initInterface 
SignOn::AuthSessionImpl::process:270 - authsessionimpl.cpp 270 process sending to queue 
SignOn::IdentityImpl::updateState:103 - identityimpl.cpp 103 updateState Updating state:  Ready 
SignOn::DBusOperationQueueHandler::execQueuedOperations:137 - dbusoperationqueuehandler.cpp 137 execQueuedOperations Executing cached oparation: SIGNATURE: "process(SessionData,QString)" 
SignOn::DBusOperationQueueHandler::execQueuedOperations:149 - dbusoperationqueuehandler.cpp 149 execQueuedOperations 
SignOn::AuthSessionImpl::process:265 - authsessionimpl.cpp 265 process sending to daemon 
CardDav::fetchUserInformation:290 - void CardDav::fetchUserInformation() requesting principal urls for user 
RequestGenerator::generateRequest:88 - generateRequest(): "" "https://myowncloud.server.de" "" "0" "PROPFIND" "<d:propfind xmlns:d="DAV:"><d:prop><d:current-user-principal /></d:prop></d:propfind>" 
CardDav::userInformationResponse:306 - void CardDav::userInformationResponse() error: 3 ( 0 ) 
Buteo::LogTimer::LogTimer:72 - "void CardDavClient::syncFinished(int, const QString&)" :Entry 
Buteo::LogTimer::~LogTimer:83 - "void CardDavClient::syncFinished(int, const QString&)" :Exit, execution time: 1 ms 
CardDavClient::syncFinished:137 - CardDAV sync failed: 401 ""
edit flag offensive delete publish link more

Comments

2

i have created an issue, maybe we get a workaround https://github.com/nemomobile/buteo-sync-plugin-carddav/issues

Micha_Btz ( 2014-12-11 21:02:41 +0300 )edit
1

the answer is, that the version in jolla quite old is. can anyone build a package for jolla from the new version?

Micha_Btz ( 2014-12-13 22:17:35 +0300 )edit

Version in u10: buteo-sync-plugin-carddav-0.0.6-1.2.2.armv7hl

Seems to be the most recent on github, released in September. I tried switching Carddav on in the account settings, but it didn't work. Might try recreating the account.

Andy Branson ( 2014-12-19 11:51:19 +0300 )edit
1

answered 2014-11-05 12:19:24 +0300

sidv gravatar image

Unfortunately, self-signed certificates are always a bit troublesome. Also those shady buttons to accept them labelled "ignore SSL errors" and "trust all certificates" personally made me a bit uncomfortable. That is why I gave in, got myself a signed certificate (they retail starting at $9/year, so it is not that much money) and all my issues went away. Honestly, I can only recommend that.

I should add, that OC7.2 w/ contacts and calendar sync works for me (w/ the Nginx workaround discussed above) on the Jolla w/o SyncEvolution.

edit flag offensive delete publish link more
13

answered 2014-10-28 13:12:33 +0300

Sailor gravatar image

updated 2015-04-06 00:34:52 +0300

I just got carddav support to work with Jolla. It's a bit of hacky thing but it works right now ;)

set $request_url $request_uri;
    if ($request_uri ~ /owncloud/remote\.php/carddav///owncloud/remote\.php/carddav/(.*)$) {
            set $request_url /owncloud/remote.php/carddav/$1;
    }

   if ($request_uri ~ /owncloud/remote\.php/carddav/principals/(.*)/owncloud/remote\.php/carddav/addressbooks(.*)$) {
                set $request_url /owncloud/remote.php/carddav/addressbooks$2;
        }
           location ~ /owncloud/remote\.php/carddav/principals/(.*)/owncloud/remote\.php/carddav/addressbooks(.*)$ {
                rewrite ^/owncloud/remote\.php/carddav/principals/(.*)/owncloud/remote\.php/carddav/addressbooks(.*)$ /owncloud/remote.php/carddav/addressbooks$2 last;
        }

    location  ~ /owncloud/remote\.php/carddav///owncloud/remote\.php/carddav/(.*)$ {
            rewrite ^/owncloud/remote\.php/carddav///owncloud/remote\.php/carddav/(.*)$ /owncloud/remote.php/carddav/principals$1 last;
    }

    location ~ ^(.+?\.php)(/.*)?$ {
            try_files $1 = 404;

            include fastcgi_params;
            fastcgi_param REQUEST_URI $request_url;
            fastcgi_param SCRIPT_FILENAME $document_root$1;
            fastcgi_param PATH_INFO $2;
            fastcgi_pass 127.0.0.1:9025;
    }

The solution was to rewrite Jollas requests to the right format on nginx level. Added another rule so you can configure https://myserver.com/owncloud/remote.php/carddav/ to your Jolla.

edit flag offensive delete publish link more

Comments

1

First of all: thanks for the detailed answer! Could you clarify what you put where in the Jolla interface as I have owncloud+nginx and didn't get it to work in the last few hours?

Also, did you mark this account CardDAV only or do you also sync CalDAV (which worked for me before)?

I see these kind of entries in my nginx-access log:

"PROPFIND /owncloud/remote.php/carddav/ HTTP/1.1" 401 304 "-" "Mozilla/5.0"
sidv ( 2014-10-28 22:50:04 +0300 )edit
2

I have added two accounts on my Jolla. One with only Carddav enabled and as server url: https://myserver.com/owncloud/remote.php/carddav and one with only caldav enabled with serverpath and serverurl https://myserver.com. The combined option does not work at the moment.

Sailor ( 2014-10-28 22:57:32 +0300 )edit

Thanks! Still doesn't work:

"PROPFIND /owncloud/remote.php/carddav HTTP/1.1" 401 304 "-" "Mozilla/5.0"
"PROPFIND /owncloud/remote.php/carddav HTTP/1.1" 207 443 "-" "Mozilla/5.0"
"PROPFIND /owncloud/remote.php/carddav//owncloud/remote.php/carddav/principals/MYUSER/ HTTP/1.1" 404 288 "-" "Mozilla/5.0"

when manually triggering sync. Well, guess there is something wrong w/ my nginx.conf.

sidv ( 2014-10-28 23:14:50 +0300 )edit

If anyone should run into the same problem with an existing nginx.conf: the

fastcgi_param REQUEST_URI $request_url;

is really important. Works! :-)

sidv ( 2014-10-29 00:07:31 +0300 )edit
1

I got the CalDAV sync to work with ownCloud quite easily by adding a CalDAV account (Settings -> Accounts). All of my calendars are synced bidirectionally.

I cannot figure what you did to get CardDAV working. Are you using an app for that? I can only recommend to put that much information there that also a newbie can figure it out without asking strange questions... :-)

ABeam ( 2014-12-15 13:16:53 +0300 )edit
2

answered 2014-10-25 12:42:12 +0300

cy8aer gravatar image

updated 2014-10-25 12:43:29 +0300

I stated in two threads allready (moderators: help!) and this will be the main thread for me https://together.jolla.com/question/59893/wiki-11038-first-hiccups/

  • For carddav I needed to write the full url into the server address section and nothing into the server path section (and caldav switched off). The server path seems to be ignored (someone mentioned it in some ot the other Carddav threads)
  • then (and only then) I can see connections from my device to my owncloud server. It fetches the address list and tries to connect to the principals-url but creates a double server path entry owncloud/remote.php/carddav/principals/blaablaa//owncloud/principals/blaablaa which creates a 404 on the owncloud server.

Maybe it would work if you try to redirect the double url path to a single one on the server's apache/lighty/nginx/whatever if you are brave enough

edit flag offensive delete publish link more

Comments

The server address for CardDAV should just be the host. The CardDAV sync adapter performs DAV discovery to determine what the addressbook path should be. So, you need to omit the addressbook path from your server path.

chris.adams ( 2014-10-28 03:37:42 +0300 )edit

In short, let's say you have an owncloud server at https://your.owncloud.tld And let us say that it hosts two DAV resources: a calendar set and an addressbook set, at: /carddav/principals/user_id/ and /caldav/principals/user_id respectively, then you should set up your account so that the server path is https://your.owncloud.tld and the calendar path is /caldav/principals/user_id

Then both CalDAV and CardDAV synchronization should work (assuming that OwnCloud is RFC compliant...)

chris.adams ( 2014-10-28 03:39:57 +0300 )edit
3

https://myserver/owncloud/remote.php/carddav is the corresponding URL for owncloud. But Jolla does not handle the url right if I insert it this way :-/. It always appends https://myserver/owncloud/remote.php/carddav///owncloud/remote.php/carddav/principals/user which is wrong.

Sailor ( 2014-10-28 10:03:00 +0300 )edit

Definitely sounds like a bug in the sync plugin. Can you file an issue at https://github.com/nemomobile/buteo-sync-plugin-carddav/issues for this one? It seems as if it only subtracts the host rather than the host+basepath from the returned URL, when building the new path.

chris.adams ( 2014-10-30 05:39:17 +0300 )edit
1

I don't think it's a bug of the buteo sync plugin. But rather the accounts tool which does not provide a field for the carddav path. Eg calendar path is provided.

Sailor ( 2014-10-30 11:31:42 +0300 )edit
10

answered 2014-10-25 03:11:53 +0300

raven24 gravatar image

updated 2014-10-25 13:52:17 +0300

CalDAV is working fine (so far) with OwnCloud 7.0.2 on Sailfish 1.1.0.39, I got all my calendars to sync.

CalDAV with OwnCloud (works for me)

user: username
pass: password
server address: https://your.cloud.tld
calendar path: /remote.php/caldav/calendars/[username]
de-select CardDAV

CardDAV?

Unfortunately, when I tried the same for CardDAV (on a separate account) I never got any results. I tried entering many combinations of server addresses, with port/path but for some reason I never even get any requests to show up in the OwnCloud server logs. In the phone logs it says "CardDAV sync failed: 401" ... but that's not something I can find anywhere in my owncloud servers log.

CardDAV Sync Logs

You can watch the sync process on the Jolla as described in this post but I had to change the command that starts msyncd. So here is what I did (via SSH on the phone):

systemctl --user stop msyncd
devel-su killall msyncd
MSYNCD_LOGGING_LEVEL=9 devel-su --privileged msyncd

and then in another terminal:

devel-su journalctl -a -f | grep carddav

The journal of the Jolla for one of the sync attempts with carddav is as follows (url redacted)


Oct 25 02:01:00 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "virtual bool CardDavClient::init()" :Entry 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "virtual bool CardDavClient::init()" :Exit, execution time: 0 ms 
Oct 25 02:01:00 Jolla carddav-client[11638]: [W] ContactsEngine::ContactsEngine:803 - The 'mergePresenceChanges' option has not been configured - presence changes will only be reported via ContactManagerEngine::contactsPresenceChanged()
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "bool PluginServiceObj::startSync()" :Entry 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "bool PluginServiceObj::startSync()" :Exit, execution time: 0 ms 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "virtual bool CardDavClient::startSync()" :Entry 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "virtual bool CardDavClient::startSync()" :Exit, execution time: 0 ms 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] Syncer::startSync:83 - void Syncer::startSync(int) starting carddav sync with account 18 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] SignOn::IdentityImpl::updateState:103 - identityimpl.cpp 103 updateState Updating state:  PendingRegistration 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] SignOn::AuthSessionImpl::initInterface:174 - authsessionimpl.cpp 174 initInterface 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] SignOn::AuthSessionImpl::process:270 - authsessionimpl.cpp 270 process sending to queue 
Oct 25 02:01:00 Jolla carddav-client[11638]: [D] SignOn::IdentityImpl::updateState:103 - identityimpl.cpp 103 updateState Updating state:  Ready 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] SignOn::DBusOperationQueueHandler::execQueuedOperations:137 - dbusoperationqueuehandler.cpp 137 execQueuedOperations Executing cached oparation: SIGNATURE: "process(SessionData,QString)" 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] SignOn::DBusOperationQueueHandler::execQueuedOperations:149 - dbusoperationqueuehandler.cpp 149 execQueuedOperations 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] SignOn::AuthSessionImpl::process:265 - authsessionimpl.cpp 265 process sending to daemon 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] CardDav::fetchUserInformation:290 - void CardDav::fetchUserInformation() requesting principal urls for user 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] RequestGenerator::generateRequest:88 - generateRequest(): "" "https://your.cloud.tld/remote.php/carddav" "" "0" "PROPFIND" "<d:propfind xmlns:d="DAV:"><d:prop><d:current-user-principal /></d:prop></d:propfind>" 
Oct 25 02:01:01 Jolla carddav-client[11638]: [W] CardDav::userInformationResponse:306 - void CardDav::userInformationResponse() error: 6 ( 0 ) 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "void CardDavClient::syncFinished(int, const QString&)" :Entry 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "void CardDavClient::syncFinished(int, const QString&)" :Exit, execution time: 0 ms 
Oct 25 02:01:01 Jolla carddav-client[11638]: [C] CardDavClient::syncFinished:137 - CardDAV sync failed: 401 "" 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "QString PluginServiceObj::getSyncResults()" :Entry 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "QString PluginServiceObj::getSyncResults()" :Exit, execution time: 1 ms 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "virtual Buteo::SyncResults CardDavClient::getSyncResults() const" :Entry 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "virtual Buteo::SyncResults CardDavClient::getSyncResults() const" :Exit, execution time: 0 ms 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "QString PluginServiceObj::getSyncResults()" :Entry 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "QString PluginServiceObj::getSyncResults()" :Exit, execution time: 0 ms 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "virtual Buteo::SyncResults CardDavClient::getSyncResults() const" :Entry 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "virtual Buteo::SyncResults CardDavClient::getSyncResults() const" :Exit, execution time: 0 ms 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "bool PluginServiceObj::uninit()" :Entry 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "bool PluginServiceObj::uninit()" :Exit, execution time: 1 ms 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::LogTimer:72 - "virtual bool CardDavClient::uninit()" :Entry 
Oct 25 02:01:01 Jolla carddav-client[11638]: [D] Buteo::LogTimer::~LogTimer:83 - "virtual bool CardDavClient::uninit()" :Exit, execution time: 0 ms
edit flag offensive delete publish link more

Comments

Where did you find the log file?

That does not work for me. I do net get a connection. The setup tells me that there was an error while trying to find a calendar. =(

FloR707 ( 2014-10-25 09:47:25 +0300 )edit

sorry, it was a little late yesterday. I updated my answer

raven24 ( 2014-10-25 13:52:51 +0300 )edit

From http://qt-project.org/doc/qt-5/qnetworkreply.html#NetworkError-enum the error code 6 is an SSL Handshake error. Are you certain that your system date/time is set up correctly on your device? Are you certain that your server is responding to https requests properly?

QNetworkReply::SslHandshakeFailedError 6 the SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted.

chris.adams ( 2014-10-28 03:42:32 +0300 )edit
1

I use the same self-signed cert for CalDAV as for CardDAV... but I can also try it again without SSL (just for gathering information, I'd actually really like my traffic encrypted) and report the results later.

raven24 ( 2014-10-28 17:30:04 +0300 )edit
Login/Signup to Answer

Question tools

Follow
62 followers

Stats

Asked: 2014-10-24 20:19:56 +0300

Seen: 17,686 times

Last updated: Nov 26 '15