Sync Android contacts with CardDAV-Sync – disappearing contacts

I had to reset my phone over suspicious behavior. Either some bug has surfaced, or my telephone was broken into, but the camera started to say that it is “in use by another program”. To avoid unnecessary doubts, I simply erased the whole thing and started all over.

I can do that because my contacts are synchronized to DAV server using CardDAV-Sync free address book synchronization tool. It works well and synchronizes my contacts fairly well. When I need to start all over, I install it again and it pulls my contacts from the server. Nice.

This time, I set it up as usual and it synchronized, apparently, at least it did something for a long time… but no contacts appeared in the address book. Well, so I deleted the CardDAV-Sync, reinstalled it and configured again, with the same result half an hour later.

So, now I went to the server to check the logs. Everything looked normal, no errors. Reconfigured it all again, restarted the sync and watched in amazement how the phone pulled the address records but they were not appearing in the address book. After a very long search on the Internet and desperate walk through all possible and impossible settings in the phone I finally found what the problem was.

Address book has a filter accessible through Settings->Filter in the Address Book. Somehow, the filter was set not to show the entries from the CardDAV account. Once I switched on the contacts filter for the CardDAV, the address book was there. Several hours filled with desperation over a simple setting that got set wrong. But, next time I’ll know where to look.… -->

continue reading →

Broken events in ownCloud calendar

Suddenly the synchronization with the ownCloud calendar stopped working. It gave me a strange message in the logs:

{“reqId”:”epU4rqrz1maFuP9hBxmu”,”remoteAddr”:”127.0.0.1″,”app”:”calendar”,”message”:”Event (20150807T141714Z-27435_7a94261e27f2b60.ics) contains invalid data: End of document reached prematurely”,”level”:2,”time”:”2015-09-03T06:00:26+00:00″}

The interesting part here is the error message that says “Event contains invalid data: End of document reached prematurely”. Looking around I found out that there are some reports of broken VCalendar events stored in the database. So, using the mighty SQL statement

mysql -u owncloud -p ownclouddb -e “SELECT * FROM oc_clndr_objects WHERE calendardata NOT LIKE ‘%END:VCALENDAR%’;”

I found that the database contains 218 events without a closing END:VCALENDAR statement. All of the events were for the same event that I created recently mercilessly duplicated. And the event was not showing on the calendar, of course.

As soon as I deleted all of those broken entries from the database, everything came back to normal. Sync works again. My guess for the reason? Graphical smileys in the title. Try to stick to the pure ASCII there next time, I guess.… -->

continue reading →