After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 675712 - Won't modify Google contact because the server rejects one parameter
Won't modify Google contact because the server rejects one parameter
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.4.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
: 681572 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-05-08 22:55 UTC by Olivier Crête
Modified: 2012-08-22 23:16 UTC
See Also:
GNOME target: ---
GNOME version: 3.3/3.4


Attachments
eds log (12.71 KB, text/plain)
2012-05-14 17:52 UTC, Olivier Crête
Details
gnome-contacts log (173.95 KB, application/x-bzip2)
2012-05-14 17:54 UTC, Olivier Crête
Details

Description Olivier Crête 2012-05-08 22:55:37 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.
Comment 1 Olivier Crête 2012-05-08 22:56:37 UTC
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?
Comment 2 Olivier Crête 2012-05-08 22:59:15 UTC
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.
Comment 3 Milan Crha 2012-05-11 11:58:11 UTC
Thanks for a bug report. I would try even lower in the stack, in libgdata. Philip, do you have an idea on this, please?
Comment 4 Philip Withnall 2012-05-13 12:24:49 UTC
(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.
Comment 5 Philip Withnall 2012-05-13 12:28:45 UTC
Oh, also, what version of libgdata are you using?
Comment 6 Olivier Crête 2012-05-14 17:52:39 UTC
Created attachment 214015 [details]
eds log

libgdata-0.12.0-1.fc17.x86_64

I guess label="VOICE" isn't valid.
Comment 7 Olivier Crête 2012-05-14 17:54:04 UTC
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
Comment 8 Philip Withnall 2012-05-14 22:47:57 UTC
(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.
Comment 10 Olivier Crête 2012-05-14 23:00:47 UTC
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&#13;
VERSION:3.0&#13;
.X-GDATA-ENTRY-LINK:https://www.google.com/m8/feeds/contacts/thetester%40gm&#13;
 ail.com/full/39daca6a8fdfe68b&#13;
.X-GDATA-ENTRY-XML:&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;entry xmlns='http&#13;
 ://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact&#13;
 /2008' xmlns:gd='http://schemas.google.com/g/2005' xmlns:app='http://www.w&#13;
 3.org/2007/app' gd:etag='&amp;quot\;Rn8yfTVSLit7I2A9WhdSE00MTwA.&amp;quot\;'&gt;&lt;titl&#13;
 e type='text'&gt;Allassane Touré&lt;/title&gt;&lt;id&gt;http://www.google.com/m8/feeds/co&#13;
 ntacts/thetester%40gmail.com/full/39daca6a8fdfe68b&lt;/id&gt;&lt;updated&gt;2011-07-22&#13;
 T03:54:07Z&lt;/updated&gt;&lt;category term='http://schemas.google.com/contact/2008&#13;
 #contact' scheme='http://schemas.google.com/g/2005#kind'/&gt;&lt;link href='http&#13;
 s://www.google.com/m8/feeds/photos/media/thetester%40gmail.com/39daca6a8fd&#13;
 fe68b' rel='http://schemas.google.com/contacts/2008/rel#photo' type='image&#13;
 /*'/&gt;&lt;link href='https://www.google.com/m8/feeds/contacts/thetester%40gmai&#13;
 l.com/full/39daca6a8fdfe68b' rel='http://www.iana.org/assignments/relation&#13;
 /self' type='application/atom+xml'/&gt;&lt;link href='https://www.google.com/m8/&#13;
 feeds/contacts/thetester%40gmail.com/full/39daca6a8fdfe68b' rel='http://ww&#13;
 w.iana.org/assignments/relation/edit' type='application/atom+xml'/&gt;&lt;gd:nam&#13;
 e&gt;&lt;gd:givenName&gt;Allassane&lt;/gd:givenName&gt;&lt;gd:familyName&gt;Touré&lt;/gd:familyNam&#13;
 e&gt;&lt;gd:fullName&gt;Allassane Touré&lt;/gd:fullName&gt;&lt;/gd:name&gt;&lt;gd:phoneNumber labe&#13;
 l='VOICE' primary='true'&gt;+15144736800&lt;/gd:phoneNumber&gt;&lt;gContact:website hr&#13;
 ef='www.myspace.com/allydsexy' rel='home-page' primary='false'/&gt;&lt;gContact:&#13;
 website href='http://www.facebook.com/Dutchking86' rel='home-page' primary&#13;
 ='false'/&gt;&lt;gContact:groupMembershipInfo href='http://www.google.com/m8/fee&#13;
 ds/groups/thetester%40gmail.com/base/6'/&gt;&lt;gContact:birthday when='1986-09-&#13;
 30'/&gt;&lt;/entry&gt;&#13;
X-URIS:http://www.facebook.com/Dutchking86&#13;
TEL;X-GOOGLE-LABEL=VOICE;TYPE=PREF;X-EVOLUTION-UI-SLOT=1:+15144736800&#13;
UID:http://www.google.com/m8/feeds/contacts/thetester%40gmail.com/full/39da&#13;
 ca6a8fdfe68b&#13;
FN:Allassane Touré&#13;
N:Touré;Allassane;;;&#13;
X-EVOLUTION-FILE-AS:Touré\, Allassane&#13;
CATEGORIES:Personal&#13;
URL:www.myspace.com/allydsexy&#13;
BDAY:1986-09-30&#13;
Comment 11 Philip Withnall 2012-05-16 23:26:02 UTC
(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. :-(
Comment 12 Philip Withnall 2012-06-17 19:00:05 UTC
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(-)
Comment 13 Philip Withnall 2012-08-22 23:16:13 UTC
*** Bug 681572 has been marked as a duplicate of this bug. ***