Error 500 when syncing calendar/tasks (DAVDroid 0.9.13, OwnDrive 8.2.2 (stable))



  • @breversa

    Oui je suis français et utilisateur Archlinux/KDE 🙂
    Pour l’export je suis simplement allé dans mon espace web owncloud, calendrier, et il y a une option pour exporter le calendrier en ics là dedans 🙂 Ensuite je reimporte aussi depuis owncloud et c’est fini.



  • I knew you were a fellow countryman ! ^^

    I gave your workaround a try, but no luck : I get a “file not found” when trying to download my calendar as .ics file. If I create a new calendar, no problem, so I guess there’s something fishy about that particular calendar. I emailed tech support on that and will try again after their reply. Merci camarade ! 🙂



  • “File not found” ? That’s weird.

    When I go to my calendar in my owncloud web account, I click to export the calendar, then it goes as an ics file in the owncloud root directory.
    Then I reimport it by clicking it. And that does the trick.



  • @Topper
    Apparently only that one calendar is buggy. Any other calendar works fine. I emailed support about it and they’ll do something about it next week.



  • My issue was caused by a broken event in the calendar. It did not show up, so I had my provider support delete it for me.

    Once deleted, I could download, rename and resync my calendar. 🙂

    (Now how do I change this topic’s title to add “[SOLVED]” ?)


  • developer

    @breversa Thanks for telling us the solution of your problem. I have flagged the topic as solved.



  • But come to think of it : isn’t there room for improvement to avoid such behavior (or maybe just more useful messages) with broken events ?


  • developer

    @breversa +1 The server should return a better message than “500 Internal Server Error” without further details.



  • Sorry about the thread necromancy, but I have some news :
    After checking with my OwnCloud (8.2.2) provider, I confirm that creating a calendar event with emoji in the title (I’m using v1.2.2-ose) actually creates an event that doesn’t properly end with ‘END:VCALENDAR’.

    Such events are invisible in the calendar web UI (since they don’t have an end date, I guess ?) and hence cannot be deleted by end users such as myself.

    Also, they break downloading the entire calendar file and thus sync with other devices.

    I’ve had to contact my support service several times already to ask them to find and delete those events for me, which is a major drag for everyone and takes several days each time, during which I cannot sync events to my devices (I can sync from a device to the server, but no longer from the server to the devices).

    I hence believe this is a breaking bug that should be addressed.


  • developer

    I can’t reproduce that here, iCals with emojis are created and sent correctly.

    Did you check the iCal on the server or in DAVdroid’s verbose logs? Please always provide verbose logs.



  • @rfc2822
    My bad, here are the error logs on my devices when trying to sync from the server :

    SYNCHRONIZATION INFO
    Synchronization phase: 7
    Account name: ***
    Authority: org.dmfs.tasks
    
    HTTP REQUEST:
    REPORT /remote.php/caldav/calendars/***/calendrierowndrive/
    Depth: 1
    
    <?xml version='1.0' encoding='UTF-8' ?><CAL:calendar-query xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav"><prop><getetag /></prop><CAL:filter><CAL:comp-filter name="VCALENDAR"><CAL:comp-filter name="VTODO" /></CAL:comp-filter></CAL:filter></CAL:calendar-query>
    
    HTTP RESPONSE:
    http/1.1 500 Internal Server Error
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Connection: keep-alive
    Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
    Content-Type: application/xml; charset=utf-8
    Date: Mon, 08 Aug 2016 22:24:00 GMT
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Pragma: no-cache
    Server: Apache
    Transfer-Encoding: chunked
    X-Content-Type-Options: nosniff
    X-Frame-Options: Sameorigin
    X-Robots-Tag: none
    X-Sabre-Version: 2.1.7
    X-XSS-Protection: 1; mode=block
    
    <?xml version="1.0" encoding="utf-8"?>[LF]
    <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">[LF]
      <s:sabredav-version>2.1.7</s:sabredav-version>[LF]
      <s:exception>Sabre\VObject\EofException</s:exception>[LF]
      <s:message>End of document reached prematurely</s:message>[LF]
    </d:error>[LF]
    
    
    EXCEPTION:
    at.bitfire.dav4android.exception.HttpException: 500 Internal Server Error
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:316)
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:289)
    	at at.bitfire.dav4android.DavCalendar.calendarQuery(DavCalendar.java:88)
    	at at.bitfire.davdroid.syncadapter.TasksSyncManager.listRemote(TasksSyncManager.java:108)
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:161)
    	at at.bitfire.davdroid.syncadapter.TasksSyncAdapterService$SyncAdapter.onPerformSync(TasksSyncAdapterService.java:78)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
    
    SOFTWARE INFORMATION
    DAVdroid version: 1.2.2-ose (111) Thu Aug 04 15:39:02 GMT+02:00 2016
    Installed from: org.fdroid.fdroid
    JB Workaround installed: no
    
    CONFIGURATION
    System-wide synchronization: automatically
    Account: ***
      Address book sync. interval: 240 min
      Calendar     sync. interval: 240 min
      OpenTasks    sync. interval: 240 min
      Preemptive auth: true
      WiFi only: false
      [CardDAV] Contact group method: CATEGORIES
                RFC 6868 encoding: true
      [CalDAV] Time range (past days): 90
               Manage calendar colors: false
    
    SQLITE DUMP
    android_metadata
    	|  locale |
    	|  fr_FR |
    ----------
    settings
    	|  setting | value |
    ----------
    services
    	|  _id | accountName | service | principal |
    	|  5 | *** | carddav | https://my.owndrive.com/remote.php/carddav/principals/***/ |
    	|  6 | *** | caldav | https://my.owndrive.com/remote.php/caldav/principals/***/ |
    ----------
    sqlite_sequence
    	|  name | seq |
    	|  services | 6 |
    	|  homesets | 9 |
    	|  collections | 14 |
    ----------
    homesets
    	|  _id | serviceID | url |
    	|  8 | 6 | https://my.owndrive.com/remote.php/caldav/calendars/***/ |
    	|  9 | 5 | https://my.owndrive.com/remote.php/carddav/addressbooks/***/ |
    ----------
    collections
    	|  _id | serviceID | url | readOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | sync |
    	|  11 | 6 | https://my.owndrive.com/remote.php/caldav/calendars/***/contact_birthdays/ | 0 | Anniversaires des contacts | <null> | -3355444 | <null> | 1 | 0 | 0 |
    	|  12 | 6 | https://my.owndrive.com/remote.php/caldav/calendars/***/calendrierowndrive/ | 0 | Calendrier OwnDrive | <null> | -65536 | <null> | 1 | 1 | 1 |
    	|  14 | 5 | https://my.owndrive.com/remote.php/carddav/addressbooks/***/4b65d2b6-cd67-47ec-aa1e-cce4fd6ea87b/ | 0 | Contacts OwnDrive | <null> | <null> | <null> | <null> | <null> | 1 |
    ----------
    
    SYSTEM INFORMATION
    Android version: 6.0.1 (cm_i9100-userdebug 6.0.1 MOB30R bbcf972f98 test-keys)
    Device: Samsung GT-I9100 (GT-I9100)
    
    SYNCHRONIZATION INFO
    Synchronization phase: 7
    Account name: ***
    Authority: com.android.calendar
    
    HTTP REQUEST:
    REPORT /remote.php/caldav/calendars/***/calendrierowndrive/
    Depth: 1
    
    <?xml version='1.0' encoding='UTF-8' ?><CAL:calendar-query xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav"><prop><getetag /></prop><CAL:filter><CAL:comp-filter name="VCALENDAR"><CAL:comp-filter name="VEVENT"><CAL:time-range start="20160511T002354Z" /></CAL:comp-filter></CAL:comp-filter></CAL:filter></CAL:calendar-query>
    
    HTTP RESPONSE:
    http/1.1 500 Internal Server Error
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Connection: keep-alive
    Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
    Content-Type: application/xml; charset=utf-8
    Date: Mon, 08 Aug 2016 22:23:56 GMT
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Pragma: no-cache
    Server: Apache
    Transfer-Encoding: chunked
    X-Content-Type-Options: nosniff
    X-Frame-Options: Sameorigin
    X-Robots-Tag: none
    X-Sabre-Version: 2.1.7
    X-XSS-Protection: 1; mode=block
    
    <?xml version="1.0" encoding="utf-8"?>[LF]
    <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">[LF]
      <s:sabredav-version>2.1.7</s:sabredav-version>[LF]
      <s:exception>Sabre\VObject\EofException</s:exception>[LF]
      <s:message>End of document reached prematurely</s:message>[LF]
    </d:error>[LF]
    
    
    EXCEPTION:
    at.bitfire.dav4android.exception.HttpException: 500 Internal Server Error
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:316)
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:289)
    	at at.bitfire.dav4android.DavCalendar.calendarQuery(DavCalendar.java:88)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager.listRemote(CalendarSyncManager.java:126)
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:161)
    	at at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService$SyncAdapter.onPerformSync(CalendarsSyncAdapterService.java:69)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
    
    SOFTWARE INFORMATION
    DAVdroid version: 1.2.2-ose (111) Thu Aug 04 15:39:02 GMT+02:00 2016
    Installed from: org.fdroid.fdroid
    JB Workaround installed: no
    
    CONFIGURATION
    System-wide synchronization: automatically
    Account: ***
      Address book sync. interval: 240 min
      Calendar     sync. interval: 240 min
      OpenTasks    sync. interval: 240 min
      Preemptive auth: true
      WiFi only: false
      [CardDAV] Contact group method: CATEGORIES
                RFC 6868 encoding: true
      [CalDAV] Time range (past days): 90
               Manage calendar colors: false
    
    SQLITE DUMP
    android_metadata
    	|  locale |
    	|  fr_FR |
    ----------
    settings
    	|  setting | value |
    ----------
    services
    	|  _id | accountName | service | principal |
    	|  5 | *** | carddav | https://my.owndrive.com/remote.php/carddav/principals/***/ |
    	|  6 | *** | caldav | https://my.owndrive.com/remote.php/caldav/principals/***/ |
    ----------
    sqlite_sequence
    	|  name | seq |
    	|  services | 6 |
    	|  homesets | 9 |
    	|  collections | 14 |
    ----------
    homesets
    	|  _id | serviceID | url |
    	|  8 | 6 | https://my.owndrive.com/remote.php/caldav/calendars/***/ |
    	|  9 | 5 | https://my.owndrive.com/remote.php/carddav/addressbooks/***/ |
    ----------
    collections
    	|  _id | serviceID | url | readOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | sync |
    	|  11 | 6 | https://my.owndrive.com/remote.php/caldav/calendars/***/contact_birthdays/ | 0 | Anniversaires des contacts | <null> | -3355444 | <null> | 1 | 0 | 0 |
    	|  12 | 6 | https://my.owndrive.com/remote.php/caldav/calendars/***/calendrierowndrive/ | 0 | Calendrier OwnDrive | <null> | -65536 | <null> | 1 | 1 | 1 |
    	|  14 | 5 | https://my.owndrive.com/remote.php/carddav/addressbooks/***/4b65d2b6-cd67-47ec-aa1e-cce4fd6ea87b/ | 0 | Contacts OwnDrive | <null> | <null> | <null> | <null> | <null> | 1 |
    ----------
    
    SYSTEM INFORMATION
    Android version: 6.0.1 (cm_i9100-userdebug 6.0.1 MOB30R bbcf972f98 test-keys)
    Device: Samsung GT-I9100 (GT-I9100)
    

    Please note that I do NOT have access to the admin/system part of the server, only the user interface (otherwise I wouldn’t need to bug the support service !).

    Also, for what it’s worth, I’m using Swiftkey Keyboard to type in emojis. I believe the problematic one represents those two cheering beer mugs : 🍻


  • developer

    @breversa There are not verbose logs, but the debug info. These only show the exceptions reported by the server. To get the verbose logs:

    1. disable global sync on your Android device
    2. enable verbose logs in DAVdroid
    3. create an event with emoji on your device
    4. manually synchronize with DAVdroid
    5. disable verbose logs and re-enable global sync

    The verbose logs will show the network traffic. In my tests, the VEVENT is uploaded correctly, so I’m quite sure it’s an OwnCloud problem, probably caused by the limited Unicode implementation of the MySQL backend.



  • Sorry again for the misunderstanding.

    Here are the logs (there were two files, so only one may be relevant) :

    0_1470740117217_davdroid-9314-20160809-124100.txt

    0_1470740135725_davdroid-6960-20160809-124100.txt

    Thanks for the link. My technical german is a bit flaky, but my may very well be spot on the error cause. 🙂


  • developer

    @breversa As you can see in the logs, the VEVENT is uploaded by DAVdroid correctly:

    2016-08-09 12:45:59 11 [HttpClient$1] BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:+//IDN bitfire.at//DAVdroid/1.2.2-ose ical4android ical4j/2.x
    BEGIN:VEVENT
    …
    SUMMARY:Fête de la bière 🍻 
    STATUS:CONFIRMED
    BEGIN:VALARM
    …
    END:VALARM
    END:VEVENT
    BEGIN:VTIMEZONE
    …
    END:VTIMEZONE
    END:VCALENDAR
    

    I’m quite sure it’s the mentioned MySQL problem.