Contact Sync is ignoring contacts with Google Plus URL (from Google Contacts export)



  • I have some exported contacts from Google, and imported into Owncloud. Owncloud did not choke on them, but Davrdoid does.

    When it encounters a Google Plust URL, it says it's unparsable and ignores the contact altogether.

    Here's (part of) the logcat output. It's repeated hundreds of times for each similar contact:

    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): </card:address-data><d:getetag>"f540cd3c89dcf243c83b9658e00f237c"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/owncloud/remote.php/carddav/addressbooks/admin/android/d29950ea12.vcf</d:href><d:propstat><d:prop><card:address-data>BEGIN:VCARD&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): VERSION:3.0&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): FN:xxxxx xx xxx&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): N:xxx;xxxxx;xx;;&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): EMAIL;TYPE=INTERNET;TYPE=HOME:xxxxx_xxx@hotmail.com&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): EMAIL;TYPE=INTERNET;TYPE=HOME:xxxxxxxx@gmail.com&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): X-MSN;TYPE=HOME:xxxxx_xxx@hotmail.com&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): TEL;TYPE=CELL:xxx-xxx-xx&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): TEL;TYPE=HOME:xxxxxxxxxxxxx&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): ITEM1.URL:http\\://www.google.com/profiles/1167xxxxxxxxxxxxxx386&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): ITEM1.X-ABLABEL:_$!&lt;HomePage&gt;!$_&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): UID:d29950ea12&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): REV:2013-09-30T05:30:27+00:00&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): PRODID:-//ownCloud//NONSGML Contacts 0.2.5//EN&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): CATEGORIES:Family&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): END:VCARD&#13;
    11-10 19:05:37.919 D/davdroid.WebDavCollection(7454): </card:address-data><d:getetag>"cfc353a298991ffa4bd1cc05928eae8a"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/owncloud/remote.php/carddav/addressbooks/admin/android
    11-10 19:05:38.739 E/davdroid.Contact(7454): VCard parser exception
    11-10 19:05:38.739 E/davdroid.Contact(7454): net.fortuna.ical4j.data.ParserException: Error at line 6:Error parsing line
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at net.fortuna.ical4j.vcard.VCardBuilder.build(VCardBuilder.java:200)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at net.fortuna.ical4j.vcard.VCardBuilder.build(VCardBuilder.java:137)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at at.bitfire.davdroid.resource.Contact.parseEntity(Contact.java:134)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at at.bitfire.davdroid.resource.RemoteCollection.multiGet(RemoteCollection.java:86)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:138)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:54)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:254)
    11-10 19:05:38.739 E/davdroid.Contact(7454): Caused by: java.net.URISyntaxException: Illegal character in scheme at index 0: http\\://www.google.com/profiles/1144xxxxxxxxxxxxxx283
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at java.net.URI.validateScheme(URI.java:419)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at java.net.URI.parseURI(URI.java:363)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at java.net.URI.<init>(URI.java:204)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at net.fortuna.ical4j.vcard.property.Url.<init>(Url.java:80)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at net.fortuna.ical4j.vcard.property.Url$Factory.createProperty(Url.java:114)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at net.fortuna.ical4j.vcard.property.Url$Factory.createProperty(Url.java:1)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at net.fortuna.ical4j.vcard.VCardBuilder.parseProperty(VCardBuilder.java:261)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	at net.fortuna.ical4j.vcard.VCardBuilder.build(VCardBuilder.java:197)
    11-10 19:05:38.739 E/davdroid.Contact(7454): 	... 6 more
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): Ignoring unparseable entity in multi-response
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): net.fortuna.ical4j.data.ParserException: Error at line -1:VCard parser crashed
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at at.bitfire.davdroid.resource.Contact.parseEntity(Contact.java:139)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at at.bitfire.davdroid.resource.RemoteCollection.multiGet(RemoteCollection.java:86)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:138)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:54)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:254)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): Caused by: net.fortuna.ical4j.data.ParserException: Error at line 6:Error parsing line
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at net.fortuna.ical4j.vcard.VCardBuilder.build(VCardBuilder.java:200)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at net.fortuna.ical4j.vcard.VCardBuilder.build(VCardBuilder.java:137)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	at at.bitfire.davdroid.resource.Contact.parseEntity(Contact.java:134)
    11-10 19:05:38.769 E/davdroid.RemoteCollection(7454): 	... 4 more
    

    So basically there's a java.net.URISyntaxException: Illegal character in scheme at index 0: http\\://www.google.com/profiles/1144xxxxxxxxxxxxxx283 exception that triggers a VCard parser exception.

    I don't know whether or not it's an illegal character in the standards, but can it at least ignore the field and not the whole contact?

    I'm on 0.3.7-alpha from f-droid, if that matters.

    Thanks in advance! And thanks for your awesome work in general!


  • developer

    Can you please send such a VCard to play@bitfire.at for further investigation?


  • developer

    Thanks for your files. The problem is that colons must not be escaped in VCard 4 but must be escaped in VCard 3. ical4j-vcard (the library used for VCard parsing) only understand VCard 4 while strictly speaking, CardDAV clients MUST be able to understand VCard 3 but MAY be able to understand VCard 4.

    So, the solution will be to implement mandatory VCard 3 support or at least reject/warn when the server doesn't support/send VCard4. See issue #67.



  • You have to parse the whole vCard directly, right? So you don't have the choice to ignore single properties...

    I'll try to come up with a script to update the vCards for them to be compatible, or update them directly on ownCloud. I can link to it here if it can help others in the mean time.

    By the way, ownCloud parsed the vCard without error, but kept the value as is (with the backslash before the colon). I didn't find whether it's using vCard 3 or 4.

    And again thanks for your work.


  • developer

    @jadkik Yes, ical4j-vcard always parses the whole VCard.

    I will close this now – for further updates about this topic, please see issue #67.



  • Just for those who stumble upon this issue before you implement vCard 3 support: I used a regex to remove all the Google Plus profiles from my address book.

    • Download and back up the vcf file.
    • Use the regular expression to find and replace by nothing (did this in Geany, but any other reg exp find/replace will do)
    • Save vcf file, check diff just in case, re-upload.

    Did this with ownCloud, and all my contacts seem to show on my device now.

    Here's the reg exp:

    ^ITEM[0-9]+\.URL\:http(\\*)\:\/\/www\.google\.com\/profiles\/.+[\r\n]+ITEM[0-9].X-ABLABEL:.+[\r\n]+
    

Log in to reply
 

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