0.9.0.4 contacts syncing regression / Exception



  • Hi,
    syncing my contacts (sabredav 3.0.5 on the server side) results in the following exception:

    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.squareup.okhttp.HttpUrl.host()' on a null object reference
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager$ResourceDownloader.download(ContactsSyncManager.java:267)
    	at at.bitfire.vcard4android.Contact.fromVCard(Contact.java:279)
    	at at.bitfire.vcard4android.Contact.fromStream(Contact.java:143)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.processVCard(ContactsSyncManager.java:235)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.downloadRemote(ContactsSyncManager.java:200)
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:179)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(ContactsSyncAdapterService.java:52)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.squareup.okhttp.HttpUrl.host()' on a null object reference
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager$ResourceDownloader.download(ContactsSyncManager.java:267)
    	at at.bitfire.vcard4android.Contact.fromVCard(Contact.java:279)
    	at at.bitfire.vcard4android.Contact.fromStream(Contact.java:143)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.processVCard(ContactsSyncManager.java:235)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncManager.downloadRemote(ContactsSyncManager.java:200)
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:179)
    	at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(ContactsSyncAdapterService.java:52)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    

    This is the debug output before the exception happens(anonymized):

    [debug] Received <response> for https://xxx/sabredav/addressbooks/xxx/default/cf6abf80-c6e9-4f7b-82ae-1f86c842d8a2.vcf, status: null, properties: [address-data(urn:ietf:params:xml:ns:carddav): AddressData(vCard=BEGIN:VCARD
    VERSION:4.0
    PRODID:-//Sabre//Sabre VObject 3.4.7//EN
    N:aaa;aaa;;;
    FN:aaa
    EMAIL;TYPE=INTERNET,WORK;PREF=1:aaa@aaa.eu
    EMAIL;TYPE=INTERNET,WORK:aa2@aaa.eu
    EMAIL;TYPE=INTERNET,HOME:aaaa@aaa.eu
    ITEM2.ADR;TYPE=HOME;PREF=1:;;street 43a;city;;zip;Deutschland
    ITEM3.URL;PREF=1:http://www.asdf.de
    URL;TYPE=WORK:http://www.asg.de
    URL;TYPE=WORK:http://www.afgasd.eu
    BDAY;VALUE=DATE:1993-02-12
    PHOTO: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
    X-ICQ;TYPE=HOME;PREF=1:68769876
    IMPP;X-SERVICE-TYPE=ICQ;TYPE=HOME;PREF=1:aim:987987
    UID:6abae1b6-689c-4a8b-a951-b40af5083114
    TEL;TYPE=CELL:+49 171 2394872
    TEL;TYPE=HOME:0951/238
    TEL;TYPE=WORK:0951/23423
    REV:20140104T204251Z
    END:VCARD
    ),
    getcontenttype(DAV:): GetContentType(type=text/vcard; charset=utf-8),
    getetag(DAV:): GetETag(eTag=1e32715262049e866d923f6760de022d)]
    

    This didn't happen on 0.8 version IIRC.
    The exception happens on every sync.

    I am happy to provide further information to get this bug fixed.


  • developer

    Hello,

    Your PHOTO property is invalid. It must be a single URI. The content in your VCard iVBORw0KGgoAAAANSUhE… is not a valid URI. DAVdroid tries to download this URI (interpreting it as an URL) and fails because there's no host name.

    If you use inline data for photos, please use a data URI.



  • Hi,
    thanks for your fast answer and explanation.

    I just checked the vcf by hand, the actual PHOTO line looks like this:
    PHOTO;VALUE=uri:iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6
    The uri: part was missing in the logs.

    Anyway, this still doesn't make it a valid URI (if I'm correct).
    I sadly don't know which client set the PHOTO property like this, I can only say that it was done by a client and definitely not by hand.
    Would it be feasible to provide a workaround for cards which are created by clients with wrong PHOTO properties like this?
    Possible options that come to mind:

    • Only try to open URL with okhttp if it is a http or https URI
    • If it's a invalid URI, guess the PHOTO URI type (this probably is base64 encoded jpeg in >95% of the times anyway)
    • If it's a invalid URI, ignore the PHOTO property and don't show a photo, but don't crash the complete sync

    IIRC this exception didn't occur with davdroid <0.9 and I think the picture of this contact was even shown correctly.


  • developer

    @yannik said:

    I just checked the vcf by hand, the actual PHOTO line looks like this:
    PHOTO;VALUE=uri:iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6
    The uri: part was missing in the logs.

    It probably wasn't sent by the server because the default VALUE type is uri.

    Anyway, this still doesn't make it a valid URI (if I'm correct).

    Indeed, PHOTO ; VALUE=uri : iVBORw0KGgo… (blanks added for clarification) just says that the content type is "uri", which is the default.

    Would it be feasible to provide a workaround for cards which are created by clients with wrong PHOTO properties like this?
    Possible options that come to mind:

    • Only try to open URL with okhttp if it is a http or https URI
    • If it's a invalid URI, guess the PHOTO URI type (this probably is base64 encoded jpeg in >95% of the times anyway)
    • If it's a invalid URI, ignore the PHOTO property and don't show a photo, but don't crash the complete sync

    I'll add this to our ever-growing "work around invalid responses and data" list.

    IIRC this exception didn't occur with davdroid <0.9 and I think the picture of this contact was even shown correctly.

    I can't imagine that. However, this is still clearly a server issue.

    Could you please report this to your server manufacturer? In my opinion, when the client should work around invalid data, the server should at least try not to send invalid data, too. While I agree with you that it would be nice if DAVdroid could be more resilient on such things, I still think it's unfair to burden all the responsibility for invalid data to DAVdroid instead of the ones who generate such invalid data. It's my life hours which go into dealing with invalid data just because somebody else didn't do their homework…



  • @rfc2822 said:

    @yannik said:

    I just checked the vcf by hand, the actual PHOTO line looks like this:
    PHOTO;VALUE=uri:iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6
    The uri: part was missing in the logs.

    It probably wasn't sent by the server because the default VALUE type is uri.

    Anyway, this still doesn't make it a valid URI (if I'm correct).

    Indeed, PHOTO ; VALUE=uri : iVBORw0KGgo… (blanks added for clarification) just says that the content type is "uri", which is the default.

    This is so confusing.
    Leaving 3.0 aside, these are the different formats I could find in my own contacts by randomly checking a few:

    • PHOTO;VALUE=uri:http://domain.com/img.jpg
    • PHOTO:http://www.example.com/pub/photos/jqpublic.gif
    • PHOTO:data:image/jpeg;base64,/9j/4AAQSkZJR...
    • PHOTO;TYPE=image/png:data:application/octet-stream;base64,iVBORw0KG...

    Some prepend VALUE=, others prependTYPE=, some add uri: in front of the uri, others just have the uri. Are these all valid or do they just work due to workarounds?

    Would it be feasible to provide a workaround for cards which are created by clients with wrong PHOTO properties like this?
    Possible options that come to mind:

    • Only try to open URL with okhttp if it is a http or https URI
    • If it's a invalid URI, guess the PHOTO URI type (this probably is base64 encoded jpeg in >95% of the times anyway)
    • If it's a invalid URI, ignore the PHOTO property and don't show a photo, but don't crash the complete sync

    I'll add this to our ever-growing "work around invalid responses and data" list.

    Thanks! Which option is the one that you would want to see implemented?

    I can't imagine that. However, this is still clearly a server issue.

    Could you please report this to your server manufacturer? In my opinion, when the client should work around invalid data, the server should at least try not to send invalid data, too. While I agree with you that it would be nice if DAVdroid could be more resilient on such things, I still think it's unfair to burden all the responsibility for invalid data to DAVdroid instead of the ones who generate such invalid data. It's my life hours which go into dealing with invalid data just because somebody else didn't do their homework…

    What would be the expected server behaviour?


  • developer

    This is so confusing.
    Leaving 3.0 aside, these are the different formats I could find in my own contacts by randomly checking a few:

    Please note that there are different PHOTO formats for VCard 3 and VCard 4:

    If your server is VCard 4-capable, DAVdroid will send VCard 4, i.e. the latter format. In the other case, VCard 3 will be used. The server is responsible for detecting the correct format (if it says it's VCard 4-capable, like OwnCloud), and storing the information in a way that can be served as VCard 3 or VCard 4 correctly.

    • PHOTO;VALUE=uri:http://domain.com/img.jpg

    A valid PHOTO for VCard 3 and VCard 4 (although VALUE=uri is redundant for VCard 4 because it's the default type there), which is stored in an external resource.

    • PHOTO:http://www.example.com/pub/photos/jqpublic.gif

    A valid VCard 4 photo which is stored in an external resource. VCard 3 assumes a binary value by default, so this is invalid in VCard 3.

    • PHOTO:data:image/jpeg;base64,/9j/4AAQSkZJR...

    A valid VCard 4 photo where the URI is a data URI, i.e. the photo is stored inline. VCard 3 assumes a binary value by default, so this is invalid in VCard 3.

    • PHOTO;TYPE=image/png:data:application/octet-stream;base64,iVBORw0KG...

    Not valid. As far as I know, such lines are served/generated by defect OwnClouds.

    Some prepend VALUE=, others prependTYPE=, some add uri: in front of the uri, others just have the uri. Are these all valid or do they just work due to workarounds?

    See the RFC links I have posted above.

    Thanks! Which option is the one that you would want to see implemented?

    I think the most important thing is to add a try/catch for the code that fetches the external resource with okhttp, ignoring any errors which occur when downloading the resource.

    What would be the expected server behaviour?

    See the RFC links I have posted above.


  • developer


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.