Syncing of large contact phots from Radicale to Android fails



  • Hi,

    I am using DAVx5 to sync contacts between my Pixel 2 and a Radicale server. After having to re-sync everything from the server to the phone I noticed that not all contacts were being synced. I get an “unexpected end of stream” error in DAVx5 (see debug output below).

    I could narrow down the issue to contacts with “large” contact photos. A contact with a photo and an overall size of 7256 synced fine, while a contact with an overall size of 44475 byte did not.

    Radicale version is 2.1.11.

    --- BEGIN DEBUG INFO ---
    SYNCHRONIZATION INFO
    Account name: Alle Adressen (<redacted>)
    Authority: com.android.contacts
    
    REMOTE RESOURCE:
    http://<redacted>:5232/<redacted>/8c857694-573b-4878-b363-3c4fbc3ac147/622c4da1-b941-47d8-bc31-a6c59263a837.vcf
    
    EXCEPTION:
    java.net.ProtocolException: unexpected end of stream
    	at okhttp3.internal.http1.Http1Codec$FixedLengthSource.read(Http1Codec.java:409)
    	at okio.RealBufferedSource$inputStream$1.read(RealBufferedSource.kt:158)
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:291)
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:355)
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:181)
    	at sun.nio.cs.StreamDecoder.read0(StreamDecoder.java:130)
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:174)
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)
    	at okhttp3.ResponseBody$BomAwareReader.read(ResponseBody.java:259)
    	at java.io.Reader.read(Reader.java:121)
    	at com.github.mangstadt.vinnie.io.VObjectReader.nextChar(VObjectReader.java:814)
    	at com.github.mangstadt.vinnie.io.VObjectReader.parseProperty(VObjectReader.java:537)
    	at com.github.mangstadt.vinnie.io.VObjectReader.parse(VObjectReader.java:404)
    	at ezvcard.io.text.VCardReader._readNext(VCardReader.java:223)
    	at ezvcard.io.StreamReader.readNext(StreamReader.java:78)
    	at ezvcard.io.chain.ChainingParser.all(ChainingParser.java:152)
    	at at.bitfire.vcard4android.Contact$Companion.fromReader(Contact.kt:120)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.processVCard(ContactsSyncManager.kt:332)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.access$processVCard(ContactsSyncManager.kt:75)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager$downloadRemote$1$1.invoke(ContactsSyncManager.kt:283)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager$downloadRemote$1$1.invoke(ContactsSyncManager.kt:75)
    	at at.bitfire.dav4jvm.DavResource.get(DavResource.kt:211)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager$downloadRemote$1.invoke(ContactsSyncManager.kt:277)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager$downloadRemote$1.invoke(ContactsSyncManager.kt:75)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemote(SyncManager.kt:812)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.downloadRemote(ContactsSyncManager.kt:276)
    	at at.bitfire.davdroid.syncadapter.SyncManager$syncRemote$1$1.run(SyncManager.kt:454)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	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:919)
    
    SOFTWARE INFORMATION
    * at.bitfire.davdroid 2.6.1.1-gplay (315) from com.android.vending
    * org.dmfs.tasks 1.2.3 (77600) from com.android.vending
    * com.android.providers.contacts 10 (29)
    * com.android.providers.calendar 10 (29)
    * com.google.android.contacts 3.13.0.281119312 (2299151) from com.android.vending
    * com.google.android.calendar 2019.45.1-279921459-release (2016416004) from com.android.vending
    * org.withouthat.acalendarplus 2.2.7 (2002013) from com.android.vending
    
    CONNECTIVITY (at the moment)
    - [ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -71]
    
    CONFIGURATION
    Power saving disabled: yes
    android.permission.READ_CONTACTS: granted
    android.permission.WRITE_CONTACTS: granted
    android.permission.READ_CALENDAR: granted
    android.permission.WRITE_CALENDAR: granted
    org.dmfs.permission.READ_TASKS: granted
    org.dmfs.permission.WRITE_TASKS: granted
    android.permission.ACCESS_COARSE_LOCATION: granted
    System-wide synchronization: automatically
    Account: <redacted>
      Address book sync. interval: manually
      Calendar     sync. interval: manually
      OpenTasks    sync. interval: manually
      WiFi only: true, SSIDs: [Hubble]
      [CardDAV] Contact group method: GROUP_VCARDS
      [CalDAV] Time range (past days): 90
               Manage calendar colors: true
               Use event colors: false
    Address book account: Alle Adressen (<redacted>)
      Main account: Account {name=<redacted>, type=bitfire.at.davdroid}
      URL: http://<redacted>:5232/<redacted>/8c857694-573b-4878-b363-3c4fbc3ac147/
      Sync automatically: true
    
    SQLITE DUMP
    android_metadata
    	|  locale |
    	|  de_DE |
    ----------
    sqlite_sequence
    	|  name | seq |
    	|  service | 10 |
    	|  homeset | 13 |
    	|  collection | 28 |
    ----------
    service
    	|  id | accountName | type | principal |
    	|  9 | <redacted> | carddav | http://<redacted>:5232/<redacted>/ |
    	|  10 | <redacted> | caldav | http://<redacted>:5232/<redacted>/ |
    ----------
    homeset
    	|  id | serviceId | url | privBind | displayName |
    	|  12 | 9 | http://<redacted>:5232/<redacted>/ | 1 | <null> |
    	|  13 | 10 | http://<redacted>:5232/<redacted>/ | 1 | <null> |
    ----------
    collection
    	|  id | serviceId | type | url | privWriteContent | privUnbind | forceReadOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | supportsVJOURNAL | source | sync |
    	|  24 | 9 | ADDRESS_BOOK | http://<redacted>:5232/<redacted>/8c857694-573b-4878-b363-3c4fbc3ac147/ | 1 | 1 | 0 | Alle Adressen | <null> | <null> | <null> | <null> | <null> | <null> | <null> | 1 |
    	|  25 | 10 | CALENDAR | http://<redacted>:5232/<redacted>/ef0cd162-ea01-4b15-b276-99adf6e70bb9/ | 1 | 1 | 0 | Professional | <null> | -16764481 | <null> | 1 | 0 | 0 | <null> | 1 |
    	|  26 | 10 | CALENDAR | http://<redacted>:5232/<redacted>/f868dfaa-ccc6-4498-a376-80d903570c94/ | 1 | 1 | 0 | Aufgaben | <null> | -11410432 | <null> | 0 | 1 | 0 | <null> | 1 |
    	|  27 | 10 | CALENDAR | http://<redacted>:5232/<redacted>/6503424f-9e54-49c4-b207-02b7bd2fd7d6/ | 1 | 1 | 0 | Persönlich | <null> | -37632 | <null> | 1 | 0 | 0 | <null> | 1 |
    	|  28 | 10 | CALENDAR | http://<redacted>:5232/<redacted>/8420d1d3-4022-4e1d-b44d-2605f79ec6c7/ | 1 | 1 | 0 | Sport | <null> | -4652873 | <null> | 1 | 0 | 0 | <null> | 1 |
    ----------
    room_master_table
    	|  id | identity_hash |
    	|  42 | a7554d1ebc5ecfe0c7aefe271485d63c |
    ----------
    
    SYSTEM INFORMATION
    Android version: 10 (QP1A.191105.004)
    Device: Google Pixel 2 (walleye)
    
    --- END DEBUG INFO ---
    
    

  • developer

    @quasiorthogonal said in Syncing of large contact phots from Radicale to Android fails:

    java.net.ProtocolException: unexpected end of stream
    at okhttp3.internal.http1.Http1Codec$FixedLengthSource.read(Http1Codec.java:409)

    This means that the server interrupts the connection while the transfer. I guess it’s a problem either of Radicale of your intermediate Web server (if you have used one). Did you have a look at the Radicale / Web server logs (maybe you have to increase verbosity)?


Log in to reply
 

Similar topics