Task sync: PRIORITY without value



  • I have the same or at least a very similar issue. I get the same error when syncinc tasks.

    This is the respective debug log entry doesn't help me a lot:

    2018-04-24 13:14:00 4699 [HttpClient] BEGIN:VCALENDAR
    VERSION:2.0
    X-WR-CALNAME:Wieseclan
    PRODID:-//The Horde Project//Horde iCalendar Library//EN
    BEGIN:VTODO
    UID:1d58e8e0-4fac-4632-8d43-ec79757490d2.1519164997000
    SUMMARY:Alex Geschenkeliste
    DESCRIPTION:[ ] Tip Toi Rund um die Uhr\n[ ] Ravensburger Wort für Wort\n[
      ] Hula Hoop Reifen\n[ ] Pfeil und Bogen mit Zielscheibe\n[ ] Tip Toi
      Spielwelt Autorennen
    PRIORITY:
    STATUS:NEEDS-ACTION
    END:VTODO
    END:VCALENDAR
    
    2018-04-24 13:14:00 4699 [HttpClient] <-- END HTTP (441-byte body)
    2018-04-24 13:14:00 4699 Error loading custom timezone aliases: Attempt to invoke virtual method 'int java.io.Reader.read(char[])' on a null object reference
    2018-04-24 13:14:00 4699 Unfolding...
    2018-04-24 13:14:00 4699 Unfolding...
    2018-04-24 13:14:00 4699 [syncadapter.SyncManager] Unclassified sync error
    EXCEPTION java.lang.NumberFormatException: For input string: ""
    	at java.lang.Integer.parseInt(Integer.java:620)
    	at java.lang.Integer.parseInt(Integer.java:643)
    	at net.fortuna.ical4j.model.property.Priority.setValue(Priority.java:218)
    	at net.fortuna.ical4j.data.CalendarBuilder$ContentHandlerImpl.propertyValue(CalendarBuilder.java:299)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.parse(CalendarParserImpl.java:282)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.access$1100(CalendarParserImpl.java:229)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:210)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:422)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:406)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:208)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:115)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:180)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:149)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:198)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:178)
    	at at.bitfire.ical4android.Task$Companion.fromReader(Task.kt:66)
    	at at.bitfire.davdroid.syncadapter.TasksSyncManager.processVTodo(TasksSyncManager.kt:149)
    	at at.bitfire.davdroid.syncadapter.TasksSyncManager.access$processVTodo(TasksSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.TasksSyncManager$processRemoteChanges$2.invoke(TasksSyncManager.kt:122)
    	at at.bitfire.davdroid.syncadapter.TasksSyncManager$processRemoteChanges$2.invoke(TasksSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.BaseDavSyncManager.useRemote(BaseDavSyncManager.kt:276)
    	at at.bitfire.davdroid.syncadapter.TasksSyncManager.processRemoteChanges(TasksSyncManager.kt:114)
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.kt:127)
    	at at.bitfire.davdroid.syncadapter.TasksSyncAdapterService$TasksSyncAdapter.sync(TasksSyncAdapterService.kt:63)
    	at at.bitfire.davdroid.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.kt:77)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
    

    Custom Timezone aliases? What is this supposed to mean?

    I encountered this on a plethora of tasks, so I assume there's some error/mistake made during the creation (timezone set incorrectly?). To my knowledge the task has been created via OpenTasks.


  • developer

    Hello,

    The custom timezone alias message is probably not an error message (merely informative). Please always provide the full logs/exception details.

    PRIORITY:
    

    This is an invalid property. PRIORITY must have an Integer value between 0 and 9.

    Please fix your task files. Maybe it helps to edit the tasks with an up-to-date OwnCloud version and/or change the priority. See also https://forums.bitfire.at/topic/1107/tasks-synchronisation-error-with-owncloud-9-priority-must-be-an-integer-between-0-and-9

    Does that help?



  • You got me on the right direction, thanks a lot. For some reason my Horde installation did not properly report its priorities via DAV.

    If people ever come to this post due to similar errors:

    The table nag_tasks in the Horde DB uses the Default 0 for task_priority. If I interpreted the issue correctly, Horde only supports five priorities, 1-5. But as the CalDAV standard(?) expects 0-9, this is evaluated when reported via ics (e.g. priority 2 in the DB and the web interface is reported to DavDroid as a 3 while 3 is reported as 5). Not only are not all values used or usable, the Default of 0 is not evaluated at all (similar to values above 5, it seems) which results in an empty string. To resolve this, I manually changed all the tasks in the DB with task_priority 0 or >5 to 2 and also changed the Default value of the table to 3 (which evaluates to 5).
    These are the commands I used, continue with caution:

    ALTER TABLE nag_tasks CHANGE `task_priority` `task_priority` int(11) NOT NULL DEFAULT '3';
    UPDATE nag_tasks SET task_priority = 3 WHERE task_priority = 0 OR task_priority > 5;
    

    While my Horde installation is up to date, I initially installed it four or five years ago, so perhaps the "new install db scheme" has been changed in the meantime.



  • I couldn't find a way to edit my previous post, so here's an update this way. Please merge if possible.

    Edit for completeness sake:
    I found out that OpenTasks creates tasks with priority 0 by default. This of course results in the same problem as before. To solve this problem for good, one would probably need to create a BEFORE INSERT Trigger in MySQL to change the task_priorityvalue when a new task is added (and perhaps another BEFORE UPDATE Trigger as well).
    Sadly, my host does not support MySQL Triggers. Therefore I simply created a cronjob to run the UPDATE command above every 10 minutes.

    In the meantime I also found a feature request in the Horde bugtracker which is probably connected: https://bugs.horde.org/ticket/14032
    Horde doesn't comply to the RFC yet (and handle's RFC compliant values strangely), while the other applications do.


  • developer

    Thanks for the update and the link!