etesync / android

EteSync - Secure, end-to-end encrypted, and privacy respecting sync for your contacts, calendars and tasks.
https://www.etesync.com
GNU General Public License v3.0
305 stars 34 forks source link

Task sync failed: Error while creating local entries (Android 12, Etesync app 2.4.2) #235

Open flschubert opened 1 year ago

flschubert commented 1 year ago

Unfortunately, EteSync app (version 2.4.2) on Android 12 throws errors on attempted task sync (prior to that, a task was added to an existing task list in OpenTasks). The error log is being uploaded to the developers with reference to this issue number. Am I doing something wrong or is this a bug?

BalooRJ1 commented 1 year ago

I was just going to ask this as well...looks like a bug on Android that is preventing syncing and writing of tasks to the local Android device. I've had this problem for about five days now.

--- BEGIN DEBUG INFO --- SYNCHRONIZATION INFO Synchronization phase: creating local entries Account name: Authority: org.tasks.opentasks Debug activity source: class com.etesync.syncadapter.syncadapter.SyncNotification$NotificationHandlerActivity (Kotlin reflection is not available)

EXCEPTION: java.util.NoSuchElementException at kotlin.collections.CollectionsKt___CollectionsKt.minOrThrow(_Collections.kt:2290) at at.bitfire.ical4android.Task.write(Task.kt:239) at com.etesync.syncadapter.resource.LocalTask.getContent(LocalTask.kt:39) at com.etesync.syncadapter.syncadapter.SyncManager.prepareLocalItemForUpload(SyncManager.kt:664) at com.etesync.syncadapter.syncadapter.SyncManager.createPushItems(SyncManager.kt:699) at com.etesync.syncadapter.syncadapter.SyncManager.performSync(SyncManager.kt:229) at com.etesync.syncadapter.syncadapter.TasksSyncAdapterService$TasksSyncAdapter.onPerformSyncDo(TasksSyncAdapterService.kt:70) at com.etesync.syncadapter.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.kt:117) at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:354)

SOFTWARE INFORMATION EteSync version: 2.4.2 (20402) Installed from: com.android.packageinstaller CONFIGURATION Power saving disabled: yes android.permission.READ_CONTACTS permission: granted android.permission.WRITE_CONTACTS permission: granted android.permission.READ_CALENDAR permission: granted android.permission.WRITE_CALENDAR permission: granted org.dmfs.permission.READ_TASKS permission: denied org.dmfs.permission.WRITE_TASKS permission: denied org.tasks.permission.READ_TASKS permission: granted org.tasks.permission.WRITE_TASKS permission: granted System-wide synchronization: automatically Account: Address book sync. interval: 240 min Calendar sync. interval: 240 min OpenTasks sync. interval: — Tasks.org sync. interval: 240 min WiFi only: false [CardDAV] Contact group method: GROUP_VCARDS Manage calendar colors: true Address book account: Personal Contacts Main account: Account {name=type=com.etesync.syncadapter} URL: Sync automatically: true

SQLITE DUMP android_metadata | locale | | en_US |

settings | setting | value |

SERVICES DUMP

JOURNALS DUMP

SYSTEM INFORMATION Android version: 12 (SP2A.220505.008.2023020600) Device: Google Pixel 3a

--- END DEBUG INFO ---

Sighisorean commented 1 year ago

I get the same error. It would be helpful to also log the entity causing the error.

--- BEGIN DEBUG INFO --- SYNCHRONIZATION INFO Synchronization phase: Erstelle lokale Einträge Account name: juergen Authority: org.dmfs.tasks Debug activity source: class com.etesync.syncadapter.syncadapter.SyncNotification$NotificationHandlerActivity (Kotlin reflection is not available)

EXCEPTION: java.util.NoSuchElementException at kotlin.collections.CollectionsKt___CollectionsKt.minOrThrow(_Collections.kt:2290) at at.bitfire.ical4android.Task.write(Task.kt:239) at com.etesync.syncadapter.resource.LocalTask.getContent(LocalTask.kt:39) at com.etesync.syncadapter.syncadapter.SyncManager.prepareLocalItemForUpload(SyncManager.kt:664) at com.etesync.syncadapter.syncadapter.SyncManager.createPushItems(SyncManager.kt:686) at com.etesync.syncadapter.syncadapter.SyncManager.performSync(SyncManager.kt:229) at com.etesync.syncadapter.syncadapter.TasksSyncAdapterService$TasksSyncAdapter.onPerformSyncDo(TasksSyncAdapterService.kt:70) at com.etesync.syncadapter.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.kt:117) at android.content.AbstractThreadedSyncAdapter$SyncThread.run(Unknown Source:148)

SOFTWARE INFORMATION EteSync version: 2.4.2 (20402) Installed from: com.miui.packageinstaller CONFIGURATION Power saving disabled: no android.permission.READ_CONTACTS permission: granted android.permission.WRITE_CONTACTS permission: granted android.permission.READ_CALENDAR permission: granted android.permission.WRITE_CALENDAR permission: granted org.dmfs.permission.READ_TASKS permission: granted org.dmfs.permission.WRITE_TASKS permission: granted org.tasks.permission.READ_TASKS permission: granted org.tasks.permission.WRITE_TASKS permission: granted System-wide synchronization: automatically Account: juergen Address book sync. interval: 240 min Calendar sync. interval: 240 min OpenTasks sync. interval: 240 min Tasks.org sync. interval: — WiFi only: false [CardDAV] Contact group method: GROUP_VCARDS Manage calendar colors: true Address book account: 🧛 Jürgen Kontakte (juergen Kp) Main account: Account {name=juergen, type=com.etesync.syncadapter} URL: KpGtgG2yTYq34G-CIyqRMYMKFKzQth-R Sync automatically: true Address book account: 👫 Elternkontakte (juergen L2) Main account: Account {name=juergen, type=com.etesync.syncadapter} URL: L2vy7kAkVqk1myklyVeiG4jvi-SLyw8q Sync automatically: true Address book account: 👨‍👩‍👦‍👦 Familienkontakte (juergen NH) Main account: Account {name=juergen, type=com.etesync.syncadapter} URL: NHTkkw1KrJprIVCvnHE5ZaliZfcEVjQI Sync automatically: true

SQLITE DUMP android_metadata | locale | | de_DE |

settings | setting | value |

SERVICES DUMP

JOURNALS DUMP

SYSTEM INFORMATION Android version: 11 (RKQ1.200826.002 release-keys) Device: Xiaomi M2007J3SG (apollo)

--- END DEBUG INFO ---

barathrm commented 1 year ago

I get the same java.util.NoSuchElementException error with etesync 2.4.2 android 13 (graphene os), but I don't get any UX indication of this error. When removing and re-adding the account in the etesync app, I simply notice that some tasks/one collection doesn't sync at all and I can find the java.util.NoSuchElementException error in the debug logs.

barathrm commented 1 year ago

Maybe duplicates

https://github.com/etesync/android/issues/240 https://github.com/etesync/android/issues/238

0chroma commented 1 year ago

Same error here, I just turned on verbose logging and this was one of the tasks it failed on

BEGIN:VCALENDAR
PRODID:-//Ximian//NONSGML Evolution Calendar//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTODO
DTSTAMP:20230622T060637Z
UID:3559740285597382328
SEQUENCE:12
CREATED:20211124T212248Z
LAST-MODIFIED:20230622T060637Z
SUMMARY:erroring task?
STATUS:NEEDS-ACTION
RELATED-TO;RELTYPE=PARENT:2883718571318830179
X-EVOLUTION-CALDAV-ETAG:
 e113e29854f4c1e4f7603c4574c024e8381f803322954be9b4465941c321a1b0
END:VTODO
END:VCALENDAR

I'm using tasks.org on android for what it's worth. It seems like the task the error occurs on is random each time I remove and re-add the account.

fdroiduser commented 1 year ago

Hi 0chroma, How do you know which of your tasks fails?

barathrm commented 1 year ago

This fixes the NoSuchElementException when creating new tasks https://gitlab.com/tasn/ical4android/-/merge_requests/2

I've also observed that with the above fix I can push new tasks to an existing collection, and I see those tasks being added to a collection in the web client.

I can also create a completely new tasks collection and add new tasks both from KDE and android, and both are fetched and pushed correctly. However, I can not fetch new tasks created from KDE on android, with the above fix...

barathrm commented 1 year ago

Does anyone in this issue still have problems with the latest update, v2.4.3?

BalooRJ1 commented 1 year ago

I am no longer getting this issue thankfully.

fdroiduser commented 1 year ago

It's fine on my side too.