Sync Tasks failed with java-exception



  • Hi!

    I start to use DAVDroid with our eGroupware installation. Syncing Calendar works well, address book may work (currently no content on eGroupware) but syncing tasks fails with a java-exception.
    Could you please check if this an error in DAVDroid (seems to me) or should I search in eGroupware .....

    Thank, You
    Peter Mueller

    Here are the install details and the error log:

    Device: LG G4
    Android: 5.1
    Kernel: 3.10.49
    Build-Number: LMY47D
    Software-Version: V10d-232-10
    
    DAVdroid: 0.9
    eGroupware: ComunityVersion 1.8.007
    
    

    Output in /storage/emulated/0/Android/data/at.bitfire/davdroid/files:

    ...
    [debug] Received <response> for https://marietta.elimpex.lan/egroupware/groupdav.php/peter/infolog/1189.ics, status: null, properties: [getcontenttype(DAV:): GetContentType(type=text/calendar; charset=utf-8; component=VTODO),
    getetag(DAV:): GetETag(eTag=1189:1433770337),
    calendar-data(urn:ietf:params:xml:ns:caldav): CalendarData(iCalendar=BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//EGroupware//NONSGML EGroupware InfoLog 1.9.003//DE
    BEGIN:VTODO
    SUMMARY:Beschaffung HIPAX
    DESCRIPTION:Erledigt durch GMU
    UID:infolog-1189-c35f22ece85ff82d679299fc3263b59a
    CATEGORIES:Kunden-Auftrag
    DTSTART;VALUE=DATE:20150601
    COMPLETED;VALUE=DATE:20150607T220000Z
    DTSTAMP:20151027T124529Z
    CREATED:20150601T121219Z
    LAST-MODIFIED:20150608T133217Z
    CLASS:PUBLIC
    STATUS:COMPLETED
    X-INFOLOG-STATUS:done
    PERCENT-COMPLETE:100
    PRIORITY:5
    ORGANIZER;CN=Herr Peter
      Müller;X-EGROUPWARE-UID=7:MAILTO:Peter.Mueller@elimpex.com
    ATTENDEE;CN=Gabriele
      Müller;CUTYPE=INDIVIDUAL;X-EGROUPWARE-UID=9:MAILTO:gabriele.mueller@elimpe
     x.com
    END:VTODO
    END:VCALENDAR
    )]
    [info ] Adding 1189.ics to local task list
    [error] Unknown sync error - EXCEPTION:
    java.lang.ClassCastException: net.fortuna.ical4j.model.Date cannot be cast to net.fortuna.ical4j.model.DateTime
            at net.fortuna.ical4j.model.property.UtcProperty.getDateTime(UtcProperty.java:73)
            at at.bitfire.ical4android.AndroidTask.buildTask(AndroidTask.java:290)
            at at.bitfire.davdroid.resource.LocalTask.buildTask(LocalTask.java:75)
            at at.bitfire.ical4android.AndroidTask.add(AndroidTask.java:226)
            at at.bitfire.davdroid.syncadapter.TasksSyncManager.processVTodo(TasksSyncManager.java:214)
            at at.bitfire.davdroid.syncadapter.TasksSyncManager.downloadRemote(TasksSyncManager.java:180)
            at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:179)
            at at.bitfire.davdroid.syncadapter.TasksSyncAdapterService$SyncAdapter.onPerformSync(TasksSyncAdapterService.java:63)
            at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    java.lang.ClassCastException: net.fortuna.ical4j.model.Date cannot be cast to net.fortuna.ical4j.model.DateTime
            at net.fortuna.ical4j.model.property.UtcProperty.getDateTime(UtcProperty.java:73)
            at at.bitfire.ical4android.AndroidTask.buildTask(AndroidTask.java:290)
            at at.bitfire.davdroid.resource.LocalTask.buildTask(LocalTask.java:75)
            at at.bitfire.ical4android.AndroidTask.add(AndroidTask.java:226)
            at at.bitfire.davdroid.syncadapter.TasksSyncManager.processVTodo(TasksSyncManager.java:214)
            at at.bitfire.davdroid.syncadapter.TasksSyncManager.downloadRemote(TasksSyncManager.java:180)
            at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:179)
            at at.bitfire.davdroid.syncadapter.TasksSyncAdapterService$SyncAdapter.onPerformSync(TasksSyncAdapterService.java:63)
            at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    

  • developer

    Hello,

    Thanks for your report. Your VTODO is invalid: COMPLETED must be of type DATE-TIME (not DATE).

    DAVdroid (ical4android) expects a DATE-TIME, so it fails.

    Please fix your VTODO.

    However, DAVdroid should be more resilient, so I'll consider a workaround for invalid COMPLETED-AT values in the next DAVdroid version.



  • Thanks for the quick answer!
    I will look into eGrouware data if there is a problem.



  • This post is deleted!

  • developer

    @Peter-Mueller said:

    I tried to eliminate all date-only values by giving all date/time values a time not 00:00:00 but DAVDroid still crashes with this java-exception.

    What exactly did you do? In your iCalendar, there is this line:

    COMPLETED;VALUE=DATE:20150607T220000Z
    
    1. It says that COMPLETED is of type DATE, but when you look at the value 20150607T220000Z, it's a DATE-TIME.
    2. COMPLETED must be of type DATE-TIME, so the correct line would be:
    COMPLETED:20150607T220000Z
    

    The time may of course be 00:00:00, too.

    Could you please post your current iCalendar? If it's correctly formatted, DAVdroid should be able to parse it.

    Could you please put some code to cope this problem into your next version?

    I will consider working around invalid data as much as possible, but DAVdroid uses ical4j for iCalendar parsing, so it depends on this library.

    I agree that DAVdroid should be more resilient against such errors, but nevertheless the error is in the iCalendar files and they should be fixed to get it working.



  • As I can't easily change the eGroupware output as a user, it would be very nice if you could add some code to DAVdroid to accept DATE values where DATE-TIME is requested.

    I tried to set all date-time values to times other than 00:00:00 .


  • developer

    @Peter-Mueller said:

    As I can't easily change the eGroupware output as a user, it would be very nice if you could add some code to DAVdroid to accept DATE values where DATE-TIME is requested.

    I guess it won't be more work to change eGroupware to generate valid VTODOs than to change DAVdroid to accept invalid ones. Of course, both would be nice to have, but in my opinion, the first is more important. Did you already report this problem to eGroupware?

    I tried to set all date-time values to times other than 00:00:00 .

    As said before, it doesn't matter, 00:00:00 will work, too. The important thing is the value type, and it should be a valid DATE-TIME.



  • The more I understand what happens, the more I think this is a fundamental bug in eGroupware. I never fiddled with their code so it would take a while to find out what's going wrong there. I will also look into their forum but last time it seemed to me that there is no longer much support for the community release ... let's see.


  • developer

    @Peter-Mueller I see. Please report this to eGroupware nevertheless.

    I will try to consider this case of invalid data in the next DAVdroid version, but I don't know when I will find time (and please understand that I can't do this with high priority as it is not a DAVdroid problem).



  • Thank your for your great and quick support!

    I think I found a hack to force eGroupware to always use DATE-TIME with correct value format.

    At least it did work for me synchronizing calendar, address book and tasks (infolog in eGroupware) .

    When it proofs to be stable, I will send it to the eGroupware community site - maybe they are interested ...

    Btw. we are not so far apart, I live in Mödling ;-)

    Bye, Peter 2.0


Log in to reply
 

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