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
296 stars 33 forks source link

Getting '500 Internal Server Error' during Sync Phase #212

Closed justjulian closed 1 year ago

justjulian commented 1 year ago

I try to import my contacts to etesync via another account (DAVx5). The import is finished successfully. However, during the sync phase when trying to push the new entries to the server, I get an error. Here is the debug info:

--- BEGIN DEBUG INFO ---
SYNCHRONIZATION INFO
Synchronization phase: pushing entries
Account name: <>
Authority: com.android.contacts
Debug activity source: class com.etesync.syncadapter.syncadapter.SyncNotification$NotificationHandlerActivity (Kotlin reflection is not available)

EXCEPTION:
com.etebase.client.exceptions.ServerErrorException: Server error
    at com.etebase.client.ItemManager.do_batch(Native Method)
    at com.etebase.client.ItemManager.batch(ItemManager.java:96)
    at com.etebase.client.ItemManager.batch(ItemManager.java:189)
    at com.etesync.syncadapter.syncadapter.SyncManager.pushItems(SyncManager.kt:593)
    at com.etesync.syncadapter.syncadapter.SyncManager.performSync(SyncManager.kt:235)
    at com.etesync.syncadapter.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSyncDo(ContactsSyncAdapterService.kt:54)
    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.3.0 (20300) 
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: denied
org.tasks.permission.WRITE_TASKS permission: denied
System-wide synchronization: automatically
Account: <>
  Address book sync. interval: 240 min
  Calendar     sync. interval: 240 min
  OpenTasks    sync. interval: —
  Tasks.org    sync. interval: —
  WiFi only: false
  [CardDAV] Contact group method: GROUP_VCARDS
           Manage calendar colors: true
Address book account: <>
  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: 13 (TP1A.221005.002.2022101500)
Device: Google Pixel 4a (sunfish)

--- END DEBUG INFO ---

And here is the relevant part of the log file:

2022-10-17 10:42:43 185 [com.etesync.syncadapter.syncadapter.SyncManager] Sync phase: pushing entries
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] --> POST https://api.etebase.com/partner/etesync/api/v1/collection/<>/item/batch/
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] Content-Type: application/msgpack
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] Content-Length: 39796
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] ACCEPT: application/msgpack
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] Authorization: Token <>
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] 
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] --> END POST (binary 39796-byte body omitted)
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] <-- 500 https://api.etebase.com/partner/etesync/api/v1/collection/<>/item/batch/ (114ms)
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] server: nginx
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] date: Mon, 17 Oct 2022 08:42:43 GMT
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] content-type: text/html
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] content-length: 170
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] 
2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] <html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx</center>
</body>
</html>

2022-10-17 10:42:43 185 [com.etesync.syncadapter.HttpClient] <-- END HTTP (170-byte body)
2022-10-17 10:42:43 185 [com.etesync.syncadapter.syncadapter.SyncNotification] HTTP Exception during sync
EXCEPTION com.etebase.client.exceptions.ServerErrorException: Server error
    at com.etebase.client.ItemManager.do_batch(Native Method)
    at com.etebase.client.ItemManager.batch(ItemManager.java:96)
    at com.etebase.client.ItemManager.batch(ItemManager.java:189)
    at com.etesync.syncadapter.syncadapter.SyncManager.pushItems(SyncManager.kt:593)
    at com.etesync.syncadapter.syncadapter.SyncManager.performSync(SyncManager.kt:235)
    at com.etesync.syncadapter.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSyncDo(ContactsSyncAdapterService.kt:54)
    at com.etesync.syncadapter.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.kt:117)
    at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:354)

2022-10-17 10:42:43 185 [com.etesync.syncadapter.syncadapter.ContactsSyncAdapterService] Contacts sync complete
2022-10-17 10:42:43 34 [com.etesync.syncadapter.AccountSettings] Account <> has version 2, current version: 2

Please note that I redacted some parts, marked with <> Could you have a look at your server log files around that time stamp if there is some helpful information in them?

sandr01d commented 1 year ago

I'm getting the same error when trying to synchronize after importing from another account or a file. Seems like the database is empty. The import shows that events were added successfully, but they don't show up in the etesync calendar. Here is my device information (everything else is equal to justjulians debug info):

Android version: 12 (00WW_3_380_SP05) Device: HMD Global Nokia 8.3 5G (BGT_sprout)

mileskrell commented 1 year ago

Same issue here - began seeing this error within the past week or so. But this is with an account that had been syncing properly up until I started seeing the error, not an account I just added.

Update: I hadn't checked until now, but it appears that (at least for me), this doesn't actually indicate that syncing has failed as I'd assumed. I can see newly created events on https://pim.etesync.com as well as in Thunderbird (which I use to access my calendar via etesync-dav). So it's just an annoyance, not something that totally breaks the app. For now, I'll just turn off the "Synchronization errors" notification channel.

Mispille commented 1 year ago

I have exactly the same error during sync,

It's an account I've been using for at least a year without issue

Using version 2.2.4 on Android 12

The log shows the same information as @justjulian

com.etebase.client.exceptions.ServerErrorException: Server error
justjulian commented 1 year ago

Seems to be resolved now! No more server errors and sync works.