GNOME Bugzilla – Bug 675712
Won't modify Google contact because the server rejects one parameter
Last modified: 2012-08-22 23:16:13 UTC
Steps: 1. Have a contact a phone number that has a strange type (imported from the N900 at some point and possibly important from another phone through some strange means). 2. try to link that contact with something else using gnome-contacts (accessing eds through libfolks). Except: the modification to go through Actual: an error: ** (gnome-contacts:13469): WARNING **: contacts-linking.vala:300: Unable to set im address when linking: Unknown error setting property ‘im-addresses’: Cannot modify contacts: Invalid request URI or header, or unsupported nonstandard parameter: Exactly one of non-empty rel, label is required for phone number.
I also had something similar with Google complaining about addresses being "". I guess EDS can either modify the contact's info.. or somehow maybe it can avoid trying to modify that bit?
I also get loads of those when starting gnome-contacts. (gnome-contacts:13631): folks-WARNING **: postal-address-details.vala:283: Empty postal address passed to PostalAddressFieldDetails.
Thanks for a bug report. I would try even lower in the stack, in libgdata. Philip, do you have an idea on this, please?
(In reply to comment #2) > I also get loads of those when starting gnome-contacts. > > > (gnome-contacts:13631): folks-WARNING **: postal-address-details.vala:283: > Empty postal address passed to PostalAddressFieldDetails. That’s a separate bug. Would you mind opening a new bug about it (against libfolks) and providing a stack trace? Either folks or gnome-contacts needs to be fixed. (In reply to comment #3) > Thanks for a bug report. I would try even lower in the stack, in libgdata. > Philip, do you have an idea on this, please? It’s a libgdata bug, but I’ll need a protocol trace to work out the best way to fix it. Olivier, can you run e-addressbook-factory with the following command: LIBGDATA_DEBUG=3 GOOGLE_DEBUG=1 G_MESSAGES_DEBUG=all e-addressbook-factory > gdata.log and post the relevant bits here please? There should be an XML blob referring to “<gd:phoneNumber” right before the error message; I need the entire XML blob (though any personal data can be redacted). Thanks.
Oh, also, what version of libgdata are you using?
Created attachment 214015 [details] eds log libgdata-0.12.0-1.fc17.x86_64 I guess label="VOICE" isn't valid.
Created attachment 214016 [details] gnome-contacts log here is the gnome-contacts log, although I see nothing of interest in there. It's 4 megs, so I bzip2'd it
(In reply to comment #6) > Created an attachment (id=214015) [details] > eds log > > libgdata-0.12.0-1.fc17.x86_64 > > I guess label="VOICE" isn't valid. Yeah, it looks like[1] the ‘rel’ and ‘label’ attributes have been made mutually exclusive, which is contradictory to their original definition[2] and is going to be a pain to fix cleanly. I don’t think it’ll be possible to make a fix in libgdata itself due to the incompatibility between those two specifications (the phone number code is theoretically more general than just for Google Contacts). Making the right fix in EDS (to prefer the rel over the label, or vice-versa) probably depends on what the vCard looks like. Could you please provide the relevant lines from the vCard? Should be somewhere in the XML in ~/.cache/evolution/addressbook/my_google_account/cache.xml. Thanks.
(In reply to comment #8) References: [1]: https://developers.google.com/google-apps/contacts/v3/reference#extraRestrictionsOnSomeElements [2]: https://developers.google.com/gdata/docs/2.0/elements#gdPhoneNumber
Here is the relevant vcard... I guess one shoudl prefer LABEL as it's been entered by a user probably. That said, what other service than Contacts uses gd:PhoneNumber ? <object uid="http://www.google.com/m8/feeds/contacts/thetester%40gmail.com/full/39daca6a8fdfe68b">BEGIN:VCARD VERSION:3.0 .X-GDATA-ENTRY-LINK:https://www.google.com/m8/feeds/contacts/thetester%40gm ail.com/full/39daca6a8fdfe68b .X-GDATA-ENTRY-XML:<?xml version='1.0' encoding='UTF-8'?><entry xmlns='http ://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact /2008' xmlns:gd='http://schemas.google.com/g/2005' xmlns:app='http://www.w 3.org/2007/app' gd:etag='&quot\;Rn8yfTVSLit7I2A9WhdSE00MTwA.&quot\;'><titl e type='text'>Allassane Touré</title><id>http://www.google.com/m8/feeds/co ntacts/thetester%40gmail.com/full/39daca6a8fdfe68b</id><updated>2011-07-22 T03:54:07Z</updated><category term='http://schemas.google.com/contact/2008 #contact' scheme='http://schemas.google.com/g/2005#kind'/><link href='http s://www.google.com/m8/feeds/photos/media/thetester%40gmail.com/39daca6a8fd fe68b' rel='http://schemas.google.com/contacts/2008/rel#photo' type='image /*'/><link href='https://www.google.com/m8/feeds/contacts/thetester%40gmai l.com/full/39daca6a8fdfe68b' rel='http://www.iana.org/assignments/relation /self' type='application/atom+xml'/><link href='https://www.google.com/m8/ feeds/contacts/thetester%40gmail.com/full/39daca6a8fdfe68b' rel='http://ww w.iana.org/assignments/relation/edit' type='application/atom+xml'/><gd:nam e><gd:givenName>Allassane</gd:givenName><gd:familyName>Touré</gd:familyNam e><gd:fullName>Allassane Touré</gd:fullName></gd:name><gd:phoneNumber labe l='VOICE' primary='true'>+15144736800</gd:phoneNumber><gContact:website hr ef='www.myspace.com/allydsexy' rel='home-page' primary='false'/><gContact: website href='http://www.facebook.com/Dutchking86' rel='home-page' primary ='false'/><gContact:groupMembershipInfo href='http://www.google.com/m8/fee ds/groups/thetester%40gmail.com/base/6'/><gContact:birthday when='1986-09- 30'/></entry> X-URIS:http://www.facebook.com/Dutchking86 TEL;X-GOOGLE-LABEL=VOICE;TYPE=PREF;X-EVOLUTION-UI-SLOT=1:+15144736800 UID:http://www.google.com/m8/feeds/contacts/thetester%40gmail.com/full/39da ca6a8fdfe68b FN:Allassane Touré N:Touré;Allassane;;; X-EVOLUTION-FILE-AS:Touré\, Allassane CATEGORIES:Personal URL:www.myspace.com/allydsexy BDAY:1986-09-30
(In reply to comment #10) > Here is the relevant vcard... I guess one shoudl prefer LABEL as it's been > entered by a user probably. Yeah, probably. I’ll try and fix it in a way that ensures no data loss. I’ll try and find time this weekend for it. (Thanks for the data; really helpful.) > That said, what other service than Contacts uses gd:PhoneNumber ? None that are implemented in libgdata at the moment, but gd:PhoneNumber is still the wrong layer to fix the bug at. It’s a pain. :-(
Fixed in EDS master: commit fb69c042a35a6e578b76d5b6073905384ded5b47 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sat Jun 16 11:45:56 2012 +0100 google: Make ‘rel’ and ‘label’ mutually exclusive for certain elements Google lovingly decided to add an extra restriction on use of ‘rel’ and ‘label’ properties of elements in their Google Contacts API[1], meaning that we need to prefer vCard X-GOOGLE-LABEL values over TYPE values and ignore the TYPE values. If we don’t, the server will reject contact entries. Closes: https://bugzilla.gnome.org/show_bug.cgi?id=675712 [1]: https://developers.google.com/google-apps/contacts/v3/reference#extraRestrictionsOnSomeElements addressbook/backends/google/e-book-google-utils.c | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) commit 5eed3f9f327cd2d057a0459f4e2bbccaeac95d17 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sat Jun 16 11:34:41 2012 +0100 google: Add some tests to Google address book backend This is necessary to try and prevent regressions on the tangle of GData–vCard conversion code which the backend is built around. These few tests check the behaviour of phone numbers. Helps: https://bugzilla.gnome.org/show_bug.cgi?id=675712. addressbook/backends/google/Makefile.am | 2 + addressbook/backends/google/tests/Makefile.am | 28 +++++ addressbook/backends/google/tests/phone-numbers.c | 124 +++++++++++++++++++++ configure.ac | 1 + 4 files changed, 155 insertions(+), 0 deletions(-) commit 3faf31be2d30e48ee8dffef021ab91c424f69d49 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sat May 19 23:45:27 2012 +0100 google: Split conversion functions from Google backend into a util lib This is step 1 of the plan to add unit tests for the Google backend. This is necessary to try and prevent regressions on the tangle of GData–vCard conversion code which the backend is built around. This was prompted by https://bugzilla.gnome.org/show_bug.cgi?id=675712. addressbook/backends/google/Makefile.am | 38 + .../backends/google/e-book-backend-google.c | 1605 +------------------- addressbook/backends/google/e-book-google-utils.c | 1587 +++++++++++++++++++ addressbook/backends/google/e-book-google-utils.h | 51 + po/POTFILES.in | 1 + 5 files changed, 1713 insertions(+), 1569 deletions(-)
*** Bug 681572 has been marked as a duplicate of this bug. ***