Request for Feedback: New CalDAV and CardDAV implementation for Kopano
-
I have another error:
23.08.2018 14:40:42 [ 1474] [TRACE] dav KopanoDavBackend->GetIdOfMapiMessage(): Finding ID of Resource id #4575
23.08.2018 14:40:42 [ 1474] [DEBUG] dav KopanoDavBackend->GetIdOfMapiMessage(): Found PROP_APPTTSREF: fc13f44b-29cf-4beb-903b-011b24cdec1f
23.08.2018 14:40:42 [ 1474] [TRACE] cal KopanoCalDavBackend->getCalendarObject(): returned data id: fc13f44b-29cf-4beb-903b-011b24cdec1f - size: 1822 - etag: “1453797237”
23.08.2018 14:40:42 [ 1474] [DEBUG] main KLogger->LogOutgoing(): OUTPUT:
HTTP/1.1 500 Internal Server Error
X-KDAV-Version: GIT
X-Sabre-Version: 3.2.2
Content-Type: application/xml; charset=utf-8<?xml version=“1.0” encoding=“utf-8”?>
<d:error xmlns:d=“DAV:” xmlns:s=“http://sabredav.org/ns”>
<s:sabredav-version>3.2.2</s:sabredav-version>
<s:exception>InvalidArgumentException</s:exception>
<s:message>The objectData argument must contain an ‘uri’ property</s:message>
</d:error>23.08.2018 14:40:42 [ 1474] [DEBUG] main httpcode=‘500’ memory=‘6.47 MiB/8.00 MiB’ time=‘40.49s’
23.08.2018 14:40:42 [ 1474] [DEBUG] main ------------------ EndUlrich.
-
Just a follow up on my findings with eM Client :)
Strange enough eM client offers fruux as a pre configured service, and this is actually the the company (original?) behind the sabre dav / main developer. Meaning you can expect em Client works oke Sabre (Card)dav.
Reading old and resolved issues @sabre dav it seems to boil down to specific behavior of em Client:
It “PUT”(s) a vCard and immediately after confirmation of creation tries to “GET” it, if this “GET” fails it removes the new contact (vCard).
... 13.08.2018 13:38:17 [ 4640] [DEBUG] main KLogger->LogIncoming(): INPUT PUT /kdav/addressbooks/kopano_user/Contacts/ede4362c-9a8d-4e49-8f5f-27cc3c7296ca.vcf HTTP/1.1 ... 13.08.2018 13:38:17 [ 4640] [TRACE] card KopanoCardDavBackend->getCard(): addressBookId: principals/kopano_user:d3b2f10bf8604f25be6070fe96590b342b0000000000 - cardUri: ede4362c-9a8d-4e49-8f5f-27cc3c7296ca.vcf ... 13.08.2018 13:38:17 [ 4640] [TRACE] card KopanoCardDavBackend->setData(): mapimessage: Resource id #172 - vcf: BEGIN:VCARD VERSION:4.0 PRODID:-//MailClient.VObject/7.1.33101.0 UID:urn:uuid:081044be-a742-4f4b-a5ba-f6011679d9bb N;SORT-AS="User, Test":User;Test;;; FN:Test User EMAIL;TYPE=WORK;PREF=1:test.user@example.com END:VCARD 13.08.2018 13:38:17 [ 4640] [TRACE] dav KopanoDavBackend->GetStore(): storename kopano_user 13.08.2018 13:38:17 [ 4640] [DEBUG] main KLogger->LogOutgoing(): OUTPUT: HTTP/1.1 201 Created X-KDAV-Version: GIT X-Sabre-Version: 3.2.2 Content-Length: 0 13.08.2018 13:38:17 [ 4640] [DEBUG] main httpcode='201' memory='3.95 MiB/4.00 MiB' time='0.21s' 13.08.2018 13:38:17 [ 4640] [DEBUG] main ------------------ End 13.08.2018 13:38:17 [ 4641] [DEBUG] main ------------------ Start 13.08.2018 13:38:17 [ 4641] [DEBUG] main GET /kdav/addressbooks/kopano_user/Contacts/ede4362c-9a8d-4e49-8f5f-27cc3c7296ca.vcf 13.08.2018 13:38:17 [ 4641] [DEBUG] main KDAV version GIT 13.08.2018 13:38:17 [ 4641] [DEBUG] main SabreDAV version 3.2.2 13.08.2018 13:38:17 [ 4641] [TRACE] dav KopanoSyncState->__construct(): Using db sqlite:/var/lib/kopano/kdav/syncstate.db 13.08.2018 13:38:17 [ 4641] [TRACE] dav KopanoSyncState->__construct(): well db sqlite:/var/lib/kopano/kdav/syncstate.db 13.08.2018 13:38:17 [ 4641] [DEBUG] main KLogger->LogIncoming(): INPUT GET /kdav/addressbooks/kopano_user/Contacts/ede4362c-9a8d-4e49-8f5f-27cc3c7296ca.vcf HTTP/1.1 Host: my.kopanohost.lan Accept: text/calendar Accept-Encoding: gzip, deflate User-Agent: eM Client/7.1.33101.0 Authorization: Basic REDACTED ...
This GET fails, can not pin point it though (full log of event)
- From a far past there where timing issues not able to serve a newly created vCards although this only seemed to happen with mass synchronization.
- and the already mentioned differences in UID:urn:uuid ( 081044be-a742-4f4b-a5ba-f6011679d9bb) and cardUri: ede4362c-9a8d-4e49-8f5f-27cc3c7296ca.vcf. My knowledge of this technolgy comes to short to judge if this is a issue
Playing with it i really grown like kdav, what can we do to bring it closer to a test/alpha/… release?
-
@markvnl said in Request for Feedback: New CalDAV and CardDAV implementation for Kopano:
Playing with it i really grown like kdav, what can we do to bring it closer to a test/alpha/… release?
for us the next step is to complete packaging for it (maybe that has already happened, just catching up on holiday emails). After that we have to check what needs to be adapted. One word of advice though, as stated above our focus client for this are the bultin MacOS clients and these are also the only clients that we are actively testing. PRs for other clients are welcome, though.
-
Thanx for the heads up
@fbartels said in Request for Feedback: New CalDAV and CardDAV implementation for Kopano:
One word of advice though, as stated above our focus client for this are the bultin MacOS clients and these are also the only clients that we are actively testing. PRs for other clients are welcome, though.
Understandable,
although I think the open-source community would appreciate if TB {lightning, cardbook} support can be improved in the future. -
Thanks for the installation info (https://stash.kopano.io/projects/KC/repos/kdav/browse)!
Here are some suggestions for improvement:
- Info: Installation of SQLite / PDO
- Info: Installation of mod_rewrite
- Info: Usage chusr/chmod on “main kDAV directory”
- Info: Web Server has to listen on port 8123 “Listen 8123” (in the Virtual Host example)
- “ln -s /usr/share/kopano/php/mapi /var/www/kdav”: mapi directory doesn’t exist on my server, main kDAV directory is selectable in the start of the installation guide
- “In your CalDAV client, set the server URL to http://develop.local/calendars/<user>/Calendar/”: No port 8123 in the url
- “The DAV_ROOT_URI parameter must match your webserver configuration”: relative path to the DocumentRoot!
-
Hi @norman,
thanks for your feeback. I have adopted the readme a bit.
@norman said in Request for Feedback: New CalDAV and CardDAV implementation for Kopano:
“ln -s /usr/share/kopano/php/mapi /var/www/kdav”: mapi directory doesn’t exist on my server, main kDAV directory is selectable in the start of the installation guide
I think this is probably because of your old Kopano installation, for me this path exists.
-
One thing I noticed:
In my main calender there ist a folder “Abfall”. In “principals/norman” “/calendars/norman/Abfall/” is the “schedule-default-calendar-URL”.
d:owner /principals/norman/ cal:schedule-outbox-URL /calendars/norman/outbox/ cal:schedule-inbox-URL /calendars/norman/inbox/ cal:schedule-default-calendar-URL /calendars/norman/Abfall/
Norman
-
Hi,
First of all I am very happy that Kopano has decided to implement CardDAV! Now I do not need MS Exchange anymore which I cannot get to work on my Android cell anymore since Oreo, so this is great.
However, I have two points of feedback / bugs which need to be ironed out before I can use it productively:
- International characters like german umlaut ä, ö, ß or others like ć are not working for names, addresses, it’s a total mess. They can be stored like that in the webapp, but once transfered to a cellphone it’s not working.
Using export2csv.php file shows that everything is correct, all the umlaute are there. But they appear not to be UTF encoded - my Ubuntu terminal shows a slight difference in how a character is displayed in terminal in case of ASCII or UTF, the later being more “drawn” style and a bit bolder. However, this download works.
To test kdav I used on my Android cellphone:
a) Davdroid - cannot communicate with kdav (but works fine for my Nextcloud Server)
b) contactsync (https://play.google.com/store/apps/details?id=com.vcard.android.free) - works for downloads of contacts. Uploads do do not work well. Looking at the kdav logs I can see that contactsync is sending the VCF data with a “characterset UTF-8” in the HTTP header, but the result is that the kopano database gets data which is not double byte but two single bytes.
Consequences:- The characters are not “ä” anymore but are two digits which are the two single bytes of the unicode character - export2csv.php also shows the same result
- The contact in the webapp is a new contact if the name was changed causing a different ID (with the old contact remaining)
- Upon a new sync to contactsync the “ä” is now also replaces with the two single bytes
- In turn, upon sycing with kdav the two single bytes which contactsync sends are now each replaced with two new single bytes - so in total taking it from 1 character to 2 characters and now to 4 characters. You can imagine what happens upon the new download and upload I guess?
To me it looks like kopano does not interpret the codepage in which the client sent the data (I can clearly see the double byte character in my terminal as it’s a different visual style as normal) - kdav always converts the input in some way which is wrong / not required causing serious problems.
- Birthdays
These are stored as UTC timestamps in Kopano. Nothing wrong with that.
What is wrong however is that these birthdays are not sent in an expected format “YYYY-mm-dd” - they also contain a timezone… This may be OK based on e.g. rfc6474 for “deathdate”. But the problem is that using a UTC timestamp usually triggers code to do a conversion into the timezone of the client - this is the correct behaviour. But this requires that the client and server both “understand” what each one does, if one does it differently then there will be problems.
For me, a contact has the bday “1990-09-05”. This is how I see it in the webapp. When I export this contact it is sent with a UTC timestamp of 4th september 11:00pm. This makes the client set the bday as 4th September. In other cases kdav sends it as 0:00am - no idea why, maybe due to DST?
Now one can start arguing “kdav is doing it right, the client should fix it”. But the trivial approach is just to always STORE the bday in UTC+0 and send the bday as YYYY-mm-dd - without ANY conversion at all to the client. Then there can never be any mixup as no client will do any timezone adjustments as it doesn’t know the timezone.
And another argument - Nextcloud, which also uses sabreDav, works perfectly fine also for the birthdays of my contacts.
This should be trivial to reproduce. TIll these issues are solved, I’m using my Nextcloud Server for my contacts.
-
I’ve tried but always get:
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [14] unable to open database file in /var/www/kdav/lib/KopanoSyncState.php:45 Stack trace: #0 /var/www/kdav/lib/KopanoSyncState.php(45): PDO->__construct(‘sqlite:/var/lib…’) #1 /var/www/kdav/lib/KopanoDavBackend.php(48): Kopano\DAV\KopanoSyncState->__construct(Object(Kopano\DAV\KLogger), ‘sqlite:/var/lib…’) #2 /var/www/kdav/server.php(54): Kopano\DAV\KopanoDavBackend->__construct(Object(Kopano\DAV\KLogger)) #3 {main} thrown in /var/www/kdav/lib/KopanoSyncState.php on line 45
/var/lib/kopano/kdav is owned by www-data:
drwxr-xr-x 2 www-data www-data 4096 Dez 11 17:28 kdav
php-sqlite3 is installed. System is devuan ascii. Kopano 8.6.81, php7.2
Can anyone help? Thanks in advance!
-
@Fux how are the permissions of the file itself? so
/var/lib/kopano/kdav/syncstate.db
? -
@fbartels said in Request for Feedback: New CalDAV and CardDAV implementation for Kopano:
“ln -s /usr/share/kopano/php/mapi /var/www/kdav”: mapi directory doesn’t exist on my server, main kDAV directory is selectable in the start of the installation guide
just a node on that. since we recently removed the mapi classes from php-mapi they are now part of the repo itself and no symlinking is required anymore.
-
The file /var/lib/kopano/kdav/syncstate.db doesn’t exist yet. I tried to create (with touch) and set the right permissions - but no success.
I thought it would be created at first time kdav runs? -
@Fux said in Request for Feedback: New CalDAV and CardDAV implementation for Kopano:
I thought it would be created at first time kdav runs?
Yes, that is indeed what should be the case. The remaining conclusion is that you are running apparmor or something similar and that prevents php from writing into this folder.
Solution: adapt your apparmor config or change the location of the file into /var/www in the config of kdav
-
After changing the path to /tmp only for testing) it works and file is created. Must be something wrong with my /var/lib/kopano/kdav.
Although I have no apparmor installed (selinux either) and the permissions look good.
OK, but this seem to bbe a special problem with my system.Thanks for your help!
-
Hi,
thank you for working on a complete dav implementation for kopano. It is appreciated!
In my test installation it works fine for the most part. However I do encounter similar problems with special characters (ä/ö/ü/…) as described by MichaelAnders2.
Entering a name with “ä” in kopano webapp and syncing it to android ==> OK, correctly displayed in android.
Entering a name with “ä” in android an syncing it to kopano server/webapp ==> Not OK, Character is displayed like “ä” in webapp.
I am using Kopano Core: 8.6.82 and WebApp 3.4.3.1137+674.1, running on nginx 1.10.
My smartphone uses android 8.1 and DavDroid (I also tried CardDav with the same result).
Thanks for your good work! -
When I try to access contacts via kdav I get the following error at a few contacts - the others work:
<?xml version="1.0" encoding="utf-8"?> <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> <s:sabredav-version>3.2.2</s:sabredav-version> <s:exception>Sabre\VObject\ParseException</s:exception> <s:message>Invalid Mimedir file. Line starting at 19 did not follow iCalendar/vCard conventions</s:message> </d:error> 22.02.2019 14:50:13 [29577] [DEBUG] main httpcode='500' memory='1.25 MiB/2.00 MiB' time='0.06s' 22.02.2019 14:50:13 [29577] [DEBUG] main ------------------ End
Does anyone know where to search for a solution?
-
@Fux said in Request for Feedback: New CalDAV and CardDAV implementation for Kopano:
Invalid Mimedir file
Hi @Fux
I get exactly the same error, did you find an answer for the problem?
Regards,
Joachim -
Unfortunatly not. Most of my contacts work. But some of them produce this errror. I cannot see why.
-
@Fux @SchweidJ can you provide an export of your contacts. it seems there is something in one of your contacts that cannot be handled by libical.
To export you can use
kopano-backup
. The command to only backup contacts would bekopano-backup -u user1 -f Contacts -l debug
. If would help if you could send your contacts (or even better only a subset of failing contacts) to feedback at kopano dot io. -
Hello,
very amazing - the KDav-package is very helpful.Unfortunatelly I found an issue, but I am not really sure, whether it is caused by emClient or Kdav or something else:
My szenario exists of my UCS-Kopano server, two client computers and an Android phone.- PC1: Windows 10, Outlook 2007 (IMAP) with CalDAV-Synchronizer as Addin
- PC2: Windows 10, eClient (IMAP) with builtin CalDAV/CardDAV
- UCS-Server with Kopmano, Caldav and KDav
- Huawei P10 with latest Android
I can create Tasks and Calendar-entries on all devices and they become synchronized without problems.
I can create contacts on Android and PC1 with Outlook 2007 and they become synchronized to all devices - even to PC2.
If I create a contact on PC2 it appears for one second and becomes deleted, after synchronizing with KDav-server.
Strange: Deleting a contact works, so it seems not to be a permission-problem.The setting of the contact-access is the same on PC1 and PC2:
https://dav.meinserver.de:8443/addressbooks/vw/KontakteEnclosure you will find the links to my kdav.log files, because my posting will be too large, if I post the logs.
PC1 Outlook 2007 with DAV-Synchronizer, where sync works:
https://www.dropbox.com/s/5ws1sbdjprdulzr/CalDAV-Synchronizer.txt?dl=0
and now the log of PC2-sync, where the added contact becomes deleted after sync:
https://www.dropbox.com/s/6fxrf83b478d6vl/CARDDAV-emClient_deletes_Vcards .txt?dl=0
I found an older thread in emClient-forum, where a similar problem appeared caused by bugs in horde (not on my UCS-server) and sabre:
https://forum.emclient.com/emclient/topics/carddav_server_contacts_not_showing_in_em_but_when_we_create_contact_on_em_it_is_getting_synced_on_carddavI will be very appreciated, if you can help me.