Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks sync failed #209

Open
delcier opened this issue Jun 15, 2022 · 9 comments
Open

Tasks sync failed #209

delcier opened this issue Jun 15, 2022 · 9 comments

Comments

@delcier
Copy link

delcier commented Jun 15, 2022

I've been getting this error as a notification for a couple of days now. What can I do to fix it?

Here's the debug info:

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

EXCEPTION:
at.bitfire.ical4android.CalendarStorageException: Couldn't apply batch operation
	at at.bitfire.ical4android.BatchOperation.commit(BatchOperation.kt:54)
	at at.bitfire.ical4android.AndroidTask.update(AndroidTask.kt:347)
	at com.etesync.syncadapter.syncadapter.TasksSyncManager.processTask(TasksSyncManager.kt:132)
	at com.etesync.syncadapter.syncadapter.TasksSyncManager.processItem(TasksSyncManager.kt:89)
	at com.etesync.syncadapter.syncadapter.SyncManager.applyRemoteItems(SyncManager.kt:470)
	at com.etesync.syncadapter.syncadapter.SyncManager.performSync(SyncManager.kt:252)
	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:334)
Caused by: android.content.OperationApplicationException: Too many content provider operations between yield points. The maximum number of operations per yield point is 500
	at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(DatabaseUtils.java:163)
	at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:599)
	at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:576)
	at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:564)
	at at.bitfire.ical4android.BatchOperation.runBatch(BatchOperation.kt:80)
	at at.bitfire.ical4android.BatchOperation.commit(BatchOperation.kt:44)
	... 8 more

SOFTWARE INFORMATION
EteSync version: 2.2.4 (20204) 
Installed from: org.fdroid.fdroid.privileged
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](http://tasks.org/)    sync. interval: 240 min
  WiFi only: false
  [CardDAV] Contact group method: GROUP_VCARDS
           Manage calendar colors: true
Address book account: My Contacts (-)
  Main account: Account {name=-, type=com.etesync.syncadapter}
  URL: -
  Sync automatically: true

SQLITE DUMP
android_metadata
	|  locale |
	|  fr_FR |
----------
settings
	|  setting | value |
----------

SERVICES DUMP

JOURNALS DUMP

SYSTEM INFORMATION
Android version: 11 (RQ3A.211001.001.22214000)
Device: Google Pixel 2 (walleye)

--- END DEBUG INFO ---
@delcier
Copy link
Author

delcier commented Jun 15, 2022

Ok, I fixed it by deleting a task that kept on changing its due date on its own after each sync. I tried restoring it through Etesync to check what might have been wrong with it, but the app crashes when I try to do that.

I feel lucky that this task was so easy to spot... Otherwise this could have taken a lot more time to figure out.

@abaker
Copy link
Contributor

abaker commented Jun 15, 2022

Do you happen to have the raw vtodo data for this task?

@AndreasDeschner
Copy link

My phone for a few days now is very often trying to sync my tasks with an error just like the one described in this post. The debug info looks exactly like the one posted here. I don't have any suspicious or unusual tasks. My internet was really spotty, though.
Does anybody know how I should proceed?

@0chroma
Copy link

0chroma commented Sep 18, 2022

also getting the same error, my stack trace is slightly different though:

SYNCHRONIZATION INFO
Synchronization phase: applying remote entries
Account name: 0chroma
Authority: org.tasks.opentasks
Debug activity source: class com.etesync.syncadapter.syncadapter.SyncNotification$NotificationHandlerActivity (Kotlin reflection is not available)

EXCEPTION:
at.bitfire.ical4android.CalendarStorageException: Couldn't apply batch operation
	at at.bitfire.ical4android.BatchOperation.commit(BatchOperation.kt:54)
	at at.bitfire.ical4android.AndroidTask.add(AndroidTask.kt:320)
	at com.etesync.syncadapter.syncadapter.TasksSyncManager.processTask(TasksSyncManager.kt:137)
	at com.etesync.syncadapter.syncadapter.TasksSyncManager.processItem(TasksSyncManager.kt:89)
	at com.etesync.syncadapter.syncadapter.SyncManager.applyRemoteItems(SyncManager.kt:470)
	at com.etesync.syncadapter.syncadapter.SyncManager.performSync(SyncManager.kt:252)
	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:334)
Caused by: android.content.OperationApplicationException: Too many content provider operations between yield points. The maximum number of operations per yield point is 500
	at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(DatabaseUtils.java:161)
	at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:528)
	at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:532)
	at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:520)
	at at.bitfire.ical4android.BatchOperation.runBatch(BatchOperation.kt:80)
	at at.bitfire.ical4android.BatchOperation.commit(BatchOperation.kt:44)
	... 8 more

SOFTWARE INFORMATION
EteSync version: 2.3.0 (20300) 
Installed from: com.google.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: 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: -
  Address book sync. interval: 240 min
  Calendar     sync. interval: 240 min
  OpenTasks    sync. interval: —
  Tasks.org    sync. interval: manually
  WiFi only: false
  [CardDAV] Contact group method: GROUP_VCARDS
           Manage calendar colors: true
Address book account: Personal (0chroma kr)
  Main account: Account {name=0chroma, 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: 10 (QP1A.190711.020.G960U1UES9FVD1)
Device: Samsung SM-G960U1 (starqlteue)

--- END DEBUG INFO ---

I've also had issues with tasks changing due/start dates back like others have mentioned

@0chroma
Copy link

0chroma commented Sep 19, 2022

I think I isolated the vcard that is responsible. For some reason it had X-APPLE-SORT-ORDER:655191476 repeated 1,552 times. I use tasks.org for what it's worth, it could be an upstream bug with them. But it's still frustrating to have sync break when technically it's a valid vcard that other applications can read.

The way I isolated it was by taking a backup of my tasks as an ics, reimporting it through etesync on android, and seeing what task was missing between the two files.

Here's the ics in question:

DTSTAMP:20220918T053603Z
UID:1707289006283413006
SEQUENCE:7
CREATED:20220807T224404Z
LAST-MODIFIED:20220918T053602Z
SUMMARY:redacted
PRIORITY:1
STATUS:NEEDS-ACTION
X-APPLE-SORT-ORDER:655191476
(repeat last line 1551x)
DUE;VALUE=DATE:20220919
BEGIN:VALARM
TRIGGER;RELATED=END:PT0S
ACTION:DISPLAY
DESCRIPTION:Default Tasks.org description
X-EVOLUTION-ALARM-UID:75169867a46d15920217fbf28226703efe77df7f
END:VALARM
BEGIN:VALARM
TRIGGER;RELATED=END:P1D
ACTION:DISPLAY
DESCRIPTION:Default Tasks.org description
X-EVOLUTION-ALARM-UID:608fef114438db924473c76d1464021a19e6217c
END:VALARM
END:VTODO

@abaker
Copy link
Contributor

abaker commented Oct 4, 2022

@0chroma I added a unit test to make sure Tasks wasn't adding multiple X-APPLE-SORT-ORDER properties, so I don't think it's my fault. Any chance you've been able to reproduce this?

@0chroma
Copy link

0chroma commented Oct 5, 2022

ahh yeah it's likely a bug with tasks.org and should be reported to them, though I do feel like ical4android should probably be able to deal with that weird edge case. I haven't had the bug happen to me again since then, but I can keep you posted. Thanks for your work on this!

@delcier
Copy link
Author

delcier commented Oct 11, 2022 via email

@abaker
Copy link
Contributor

abaker commented Oct 11, 2022

@0chroma sorry, I meant I added a test to Tasks.org to verify it wasn't adding multiple X-APPLE-SORT-ORDER properties to the ical4android object

@delcier are you able to reproduce this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants