Empty result from content provider when adding event


  • When I try to synchronize the public Google calendar at this URL: https://calendar.google.com/calendar/ical/evo2bvtrij51g499agp4pm3jv4@group.calendar.google.com/public/basic.ics
    I get the error, “Empty result from content provider when adding event”.
    I know recurring events are a pain. Sorry.

    The full error message details are below:

    Empty result from content provider when adding event
    
    at.bitfire.ical4android.CalendarStorageException: Empty result from content provider when adding event
    	at at.bitfire.ical4android.AndroidEvent.add(AndroidEvent.kt:516)
    	at at.bitfire.icsdroid.ProcessEventsTask.processEvents(ProcessEventsTask.kt:141)
    	at at.bitfire.icsdroid.ProcessEventsTask.access$processEvents(ProcessEventsTask.kt:22)
    	at at.bitfire.icsdroid.ProcessEventsTask$processEvents$downloader$1.onSuccess(ProcessEventsTask.kt:63)
    	at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork(CalendarFetcher.kt:133)
    	at at.bitfire.icsdroid.CalendarFetcher.run(CalendarFetcher.kt:44)
    	at at.bitfire.icsdroid.ProcessEventsTask.processEvents(ProcessEventsTask.kt:101)
    	at at.bitfire.icsdroid.ProcessEventsTask.run(ProcessEventsTask.kt:34)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    	at java.lang.Thread.run(Thread.java:920)
    
  • developer

    @seigler Hi,

    Which Android version / flavor (vendor) are you using?


  • @rfc2822 Android 12, GrapheneOS stable channel current version, running on a Pixel 5. Kernel 4.19.202

    I am happy/confused to report that the calendar now appears to be syncing successfully, although the same error message remains visible in the app.

  • developer

    It seems like the sync does sync most of the entries, however, 8 (probably) of them seem to be skipped.

    One of them is the following:

    BEGIN:VEVENT
    DTSTART;VALUE=DATE:20121219
    DTEND;VALUE=DATE:20121220
    RDATE;VALUE=DATE:20171218
    RRULE:FREQ=YEARLY
    DTSTAMP:20211210T122447Z
    UID:oj6omr3ui3v2fk9h5jhvsut594@google.com
    CREATED:20120828T180031Z
    DESCRIPTION:
    LAST-MODIFIED:20190523T001931Z
    LOCATION:
    SEQUENCE:0
    STATUS:CONFIRMED
    SUMMARY:St. Nicholas the Wonderworker
    TRANSP:TRANSPARENT
    X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
    BEGIN:VALARM
    ...```
    
    This is the stacktrace of the error of obviously the first one of the  missing ones that cause a problem: 
    ```2021-12-10 15:20:33.011 2770-4430/com.android.providers.calendar W/RecurrenceProcessor: DateException with r=FREQ=YEARLY;WKST=MO rangeStart=135071662080 rangeEnd=9223372036854775807
    2021-12-10 15:20:33.014 2770-4430/com.android.providers.calendar W/CalendarProvider2: Could not calculate last date.
        com.android.calendarcommon2.DateException: No range end provided for a recurrence that has no UNTIL or COUNT.
            at com.android.calendarcommon2.RecurrenceProcessor.expand(RecurrenceProcessor.java:768)
            at com.android.calendarcommon2.RecurrenceProcessor.expand(RecurrenceProcessor.java:663)
            at com.android.calendarcommon2.RecurrenceProcessor.getLastOccurence(RecurrenceProcessor.java:131)
            at com.android.calendarcommon2.RecurrenceProcessor.getLastOccurence(RecurrenceProcessor.java:62)
            at com.android.providers.calendar.CalendarProvider2.calculateLastDate(CalendarProvider2.java:2956)
            at com.android.providers.calendar.CalendarProvider2.updateLastDate(CalendarProvider2.java:2981)
            at com.android.providers.calendar.CalendarProvider2.insertInTransaction(CalendarProvider2.java:2154)
            at com.android.providers.calendar.SQLiteContentProvider.insert(SQLiteContentProvider.java:110)
    

    I have analysed the problem a bit deeper. As given in the stacktrace, the rangeEnd is set to 9223372036854775807. This is the maximum value for Long-fieldtypes. This is set in the RecurrenceProcessor.expand(…) (it is explicitely set to Long.MAX_VALUE): https://android.googlesource.com/platform/frameworks/opt/calendar/+/06b3293d5af3454a39681cfd659271551354b8a0/src/com/android/calendarcommon2/RecurrenceProcessor.java#656

    The actual exception happens here:
    https://android.googlesource.com/platform/frameworks/opt/calendar/+/06b3293d5af3454a39681cfd659271551354b8a0/src/com/android/calendarcommon2/RecurrenceProcessor.java#769

                days.setRecurrence(r);
                if (rangeEndDateValue == Long.MAX_VALUE && r.until == null && r.count == 0) {
                    throw new DateException(
                            "No range end provided for a recurrence that has no UNTIL or COUNT.");
                }
    

    So here I got stuck. If setting rangeEndDateValue to Long.MAX_VALUE is okay, it is clear that r.until and r.count are null/empty for indefinite events. As I expect that basically indefinite events basically work in Android, I guess I have overlooked something… Any other thoughts on this?

  • developer

Similar topics