Davdroid crashes on calendar sync



  • Hi,

    I'm using davdroid on omnirom for Galaxy S2 and on this platform it crashes on sync. I have no idea, on which entry it has this problem even if it depends on a calendar entry or on the changed rom.

    may I do something to get better information for you?

    Bye

    D/davdroid.SyncManager( 8496): Adding owncloud-0d676ad9ec114cd331679ffdd65eedea.ics
    I/ActivityManager( 2265): Killing 7395:com.google.android.googlequicksearchbox/u0a21 (adj 15): empty #17
    W/dalvikvm( 8496): threadid=12: thread exiting with uncaught exception (group=0x41553ba8)
    E/AndroidRuntime( 8496): FATAL EXCEPTION: SyncAdapterThread-1
    E/AndroidRuntime( 8496): Process: at.bitfire.davdroid:sync, PID: 8496
    E/AndroidRuntime( 8496): java.lang.NullPointerException
    E/AndroidRuntime( 8496):        at at.bitfire.davdroid.resource.Event.hasTime(Event.java:319)
    E/AndroidRuntime( 8496):        at at.bitfire.davdroid.resource.Event.isAllDay(Event.java:315)
    E/AndroidRuntime( 8496):        at at.bitfire.davdroid.resource.LocalCalendar.buildEntry(LocalCalendar.java:422)
    E/AndroidRuntime( 8496):        at at.bitfire.davdroid.resource.LocalCollection.add(LocalCollection.java:194)
    E/AndroidRuntime( 8496):        at at.bitfire.davdroid.syncadapter.SyncManager.pullNew(SyncManager.java:185)
    E/AndroidRuntime( 8496):        at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:88)
    E/AndroidRuntime( 8496):        at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:71)
    E/AndroidRuntime( 8496):        at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    


  • I'm having the same problem on a Nexus 4 !



  • I got the same issue, it is caused by an invalid or mishandled VTODO entry.
    These patches helped me and now it is syncing fine:

    --- a/src/at/bitfire/davdroid/resource/Event.java
    +++ b/src/at/bitfire/davdroid/resource/Event.java
    @@ -272,7 +272,7 @@ public class Event extends Resource {
     
            
            public long getDtStartInMillis() {
    -               return dtStart.getDate().getTime();
    +               return dtStart!=null ? dtStart.getDate().getTime(): 0;
            }
            
            public String getDtStartTzID() {
    @@ -291,7 +291,7 @@ public class Event extends Resource {
            
            
            public long getDtEndInMillis() {
    -               return dtEnd.getDate().getTime();
    +               return dtEnd != null ? dtEnd.getDate().getTime() : 0;
            }
            
            public String getDtEndTzID() {
    @@ -316,11 +316,11 @@ public class Event extends Resource {
            }
     
            protected static boolean hasTime(DateProperty date) {
    -               return date.getDate() instanceof DateTime;
    +               return (date==null) || date.getDate() instanceof DateTime;
            }
     
            protected static String getTzId(DateProperty date) {
    -               if (date.isUtc() || !hasTime(date))
    +               if (date == null || date.isUtc() || !hasTime(date))
                            return Time.TIMEZONE_UTC;
                    else if (date.getTimeZone() != null)
                            return date.getTimeZone().getID();
    

  • developer

    Thanks for the reports.

    The next release will correct this by ignoring entries that don't have a valid dtStart. I want to get rid of the null values so an exception will be thrown when a record has no VEVENT component, causing this iCal to be ignored.


  • developer

    Which DAVdroid version did you use?



  • Latest from google app store, 0.5.8a.


  • developer

    @Messinger And can you tell me the contents of owncloud-0d676ad9ec114cd331679ffdd65eedea.ics?

    I couldn't reproduce this with a VTODO entry, it was ignored as it is supposed to.

    @All: Can you give me exact steps to reproduce, i.e. which .ics I have to put on the server so that the crash occurs? I have very little time at the moment so (unfortunately) I don't have the possibility to do much research.



  • Here we go:

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ownCloud//NONSGML Journal 0.3.2//EN
    BEGIN:VJOURNAL
    DTSTART;VALUE=DATE-TIME;TZID=UTC:20131031T113526
    CREATED;VALUE=DATE-TIME:20131031T113526Z
    UID:8c3d2c0190
    ORGANIZER:MAILTO:xxx@yyyyy.de
    UID:ecd1e5a182
    SUMMARY:Completed task: 
    END:VJOURNAL
    END:VCALENDAR
    


  • Also on SOGo:

    BEGIN:VCALENDAR
    PRODID:-//Inverse inc./SOGo 2.1.1b//EN
    VERSION:2.0
    BEGIN:VTODO
    UID:1A4-53025300-11-13B2F340
    SUMMARY:Test
    LOCATION:Test
    CLASS:PUBLIC
    CREATED:20140217T182101Z
    DTSTAMP:20140217T182101Z
    LAST-MODIFIED:20140217T182101Z
    END:VTODO
    END:VCALENDAR
    

    ...and with adding start and end date:

    BEGIN:VCALENDAR
    PRODID:-//Inverse inc./SOGo 2.1.1b//EN
    VERSION:2.0
    BEGIN:VTODO
    UID:1A4-53025300-11-13B2F340
    SUMMARY:Test
    LOCATION:Test
    CLASS:PUBLIC
    CREATED:20140217T182101Z
    DTSTAMP:20140217T182101Z
    LAST-MODIFIED:20140217T182332Z
    DTSTART:20140217T183000Z
    DUE:20140218T183000Z
    END:VTODO
    END:VCALENDAR
    


  • DAVdroid crash on sync. NullPointerException, source class: davdroid.resource.Event, line: 319.
    Latest version from the appstore.


  • developer

    This is really strange. I can reproduce this issue with 0.5.8 from Play Store, but not with 0.5.8 from source, so I guess that this issue has been fixed with the latest commit and I have uploaded a version between commits to Play Store. This is backed up by the fact that it works with 0.5.8 from FDroid (I use this version myself).

    I will close this as I can test with 0.5.9 in Play Store.


Log in to reply
 

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