GNOME Bugzilla – Bug 578907
Can not merge the contacts in google address book
Last modified: 2011-11-04 05:07:58 UTC
Please describe the problem: When adding a contact in google address book, if the contact name already exists in the google address book, Evolution will ask user to merge the contacts. But "other error" happens if user try to merge these contacts. Steps to reproduce: 1. Create a user named "test" in google address book. 2. Create another user also named "test" in google address book. 3. Click merge button in the "Duplicate Contact Detected" dialog 4. Click merge button in the "Merge Contact" dialog Actual results: The error diaglog popup. The error message is "other error". Expected results: The contacts merged successfully. Does this happen every time? yes Other information:
Currently, when merging a contact, evolution removes the existing one first and then create a new one asynchronously (addressbook/gui/merging/eab-contact-merging.c) 346 switch (result) 347 { 348 case GTK_RESPONSE_OK: 349 lookup->contact = lookup->match; 350 e_book_async_remove_contact (lookup->book, lookup->match, NULL, lookup); 351 e_book_async_add_contact (lookup->book, lookup->contact, final_id_cb, lookup); 352 value = 1; 353 break; But do it in this way, gmail server will return a conflict error. Norman tried to replace remove and add with e_book_async_commit_contact. But it requires a EBookCallback and a EBookIdCallback is passed when a new contact is created (addressbook/gui/contact-editor/e-contact-editor.c:real_save_contact). So now the problem is: When we create a new contact, a EBookIdCallback is passed. But when evolution finds that there is already a contact with the same name and users choose to merge these 2 contacts, we can not use e_book_async_commit_contact because we do not have a EBookCallback. So I suggest we pass both EBookCallback and EBookIdCallback when creating a new contact and use EBookIdCallback for a add and EBookCallback for a merge.
Created attachment 132742 [details] [review] Use the e_book_async_commit_contact to merge a contact Use the e_book_async_commit_contact to replace the e_book_async_remove_contact and e_book_async_add_contact to merge a contact. And e_book_async_commit_contact need a callback function without contact id, so change the eab_merging_book_add_contact function by adding a EBookCallback parameter.
Created attachment 135711 [details] [review] Use the e_book_async_commit_contact to merge a contact. Edit the previous patch because the evolution code changed. Use the e_book_async_commit_contact to merge a contact. This patch is almost the same with the previous one. It is created to meet the code change of evolution. Could anyone review this patch please? Thanks in advance!
Hello, can anyone kindly review this patch? Because this patch modifies about 10 files, it is a little difficult to keep this patch synchronized with those files. Thanks! Norman
Thanks for the patch. I'm afraid that the patch is not complete. Consider for example e-contact-list-editor.c, you pass NULL as the second callback, which means the contact list editor will not be notified when some conflict will be detected, but it does quite many things in contact_list_editor_list_added_cb to keep in sync with what was done in the address book after merging rutines are done, not talking about unreffing objects. I see two other possibilities: a) a very straightforward is to invoke e_book_async_add_contact only after the call to e_book_async_remove_contact is finished. It might work well, but as far as I understand the issue it would be nicer to keep the original contact UID too, thus I would prefer to use e_book_async_commit_contact as you suggested above. b) in mergeit, instead of using final_cb in e_book_async_commit_contact directly write a new callback handler with an explanation comment why is called lookup->id_cb here instead of lookup->cb. Use the ID which is stored in the contact (beware of leaking). Does it make sense?
I've been asked to forward a bug upstream from launchpad https://bugs.launchpad.net/ubuntu/+source/evolution/+bug/465015 which has similar symptoms to this bug. I am not able to create new new contacts in a Google Address book from Evolution 2.28 $ lsb_release -rd Description: Ubuntu 9.10 Release: 9.10 $ apt-cache policy evolution evolution: Installed: 2.28.1-0ubuntu1 Candidate: 2.28.1-0ubuntu1 Version table: When Adding a contact to my google address book via Evolution-->File-->New-->Contact, I get a Contact Editor window, but when I try to save the contact by clicking "OK", I get an "other error" dialog. When adding a contact to my google address book via drag-n-drop from another address book, it silently fails. When I merge a contact: the merged contact is entirely deleted (it takes a few minutes for this to sync with google, but in testing I've turned my sync cycle down to a few minutes). Is this the same or should I file a new bug? Data loss is a pretty big deal in my book...I'm not sure how many contacts I've lost info for now.
I'm using the 2.28.2 version now, the development one, and it seems to work fine. I can create a contact, just filling a full name "a b", and an email address "a@b.c" works fine. Of course, when I try to file the same full name but different email I get a prompt about the merge. It fails with a message: > Error adding contact > Contact ID already exists" and removes the previous contact. Which is wrong. Damon, what's your setup of a google address book? I use my google email as a login, together with SSL checked.
I use my google email "name@gmail.com" and the symptoms are the same with SSL either on or off.
(In reply to comment #8) > I use my google email "name@gmail.com" and the symptoms are the same with SSL > either on or off. I would recommend to use the SSL, as for example for calendars through CalDAV the Google server requires it (I know, this is address book, not calendar). Could you try this, please? a) close evolution b) one console/terminal: $ evolution --force-shutdown $ /usr/libexec/evolution-data-server-2.28 c) other console/terminal: $ evolution then try to add a contact to your Google address book, and watch the evolution-data-server's console, whether it shows something interesting there (some error message, in time when you clicked "OK" in the contact editor window). note the eds process can be on other place in your distro.
eds doesn't seem to have much interesting in it, the relevant output is: (process:8183): libedata-book-WARNING **: impl_GNOME_Evolution_Addressbook_Book_getBookView ((contains "x-evolution-any-field" "")) e_data_book_respond_get_book_view book_view file uref calling GNOME_Evolution_Addressbook_BookListener_notifySupportedFields calling GNOME_Evolution_Addressbook_BookListener_notifyRequiredFields calling GNOME_Evolution_Addressbook_BookListener_notifySupportedFields impl_GNOME_Evolution_Addressbook_Book_getContactList --> this is right where the error window pops up saying "other error" Is there a way to increase verbosity in eds? The evolution front end seems to have a few of these: ** (evolution:7543): CRITICAL **: atk_object_set_name: assertion `name != NULL' failed But they seem unrelated.
Try to run evolution-data-server with exported GOOGLE_BACKEND_DEBUG=1. It'll work if the error comes from the google backend. if it comes earlier, then no luck with that. The atk_object_set_name, hmm, could you try with the Assistive technologies disabled? It probably will not make any change with respect of google calendar, so just in case.
Yep. Here it is: (process:13597): libebookbackendgoogle-DEBUG: e_book_backend_google_create_contact (process:13597): libebookbackendgoogle-DEBUG: Creating: BEGIN:VCARD VERSION:3.0 .EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:testgoogle@testgoogle.com X-MOZILLA-HTML:FALSE X-EVOLUTION-VIDEO-URL: FBURL: CALURI: X-EVOLUTION-BLOG-URL: X-EVOLUTION-FILE-AS:TestGoogle N:;TestGoogle;;; FN:TestGoogle NOTE: X-EVOLUTION-SPOUSE: NICKNAME: X-EVOLUTION-ASSISTANT: X-EVOLUTION-MANAGER: ROLE: TITLE: URL: END:VCARD (process:13597): libebookbackendgoogle-DEBUG: google_book_add_contact (process:13597): libebookbackendgoogle-DEBUG: unsupported vcard field: X-MOZILLA-HTML: FALSE (process:13597): libebookbackendgoogle-DEBUG: New primary email entry testgoogle@testgoogle.com (http://schemas.google.com/g/2005#work/(null)) (process:13597): libebookbackendgoogle-DEBUG: new entry with xml: <?xml version="1.0"?> <entry xmlns:gd="http://schemas.google.com/g/2005" xmlns="http://www.w3.org/2005/Atom"><category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/><title type="text">TestGoogle</title><gd:email address="testgoogle@testgoogle.com" rel="http://schemas.google.com/g/2005#work" primary="true"/></entry> (process:13597): libebookbackendgoogle-DEBUG: Creating contact failed: Adding entry failed due to 'Bad Request' (HTTP code 400) Thanks for your help! What's the next step? Assistive technologies are all off in my preferences, if that's where you mean.
The same error as above occurs when dragging a new contact from a different address book. However, the error is slightly different when a merge happens, notice the feed.xml namespace error: (process:13597): libebookbackendgoogle-DEBUG: e_book_backend_google_create_contact (process:13597): libebookbackendgoogle-DEBUG: Creating: BEGIN:VCARD VERSION:3.0 EMAIL;TYPE=OTHER:secondary@testemail.com EMAIL;X-EVOLUTION-UI-SLOT=1;TYPE=HOME:test@testemailforevo.com X-EVOLUTION-FILE-AS:TestContactor N:;TestContactor;;; FN:TestContactor UID:http://www.google.com/m8/feeds/contacts/damon.erickson%40gmail.com/base /d91223289c967b4 END:VCARD (process:13597): libebookbackendgoogle-DEBUG: e_book_backend_google_remove_contacts (process:13597): libebookbackendgoogle-DEBUG: google_book_remove_contact (process:13597): libebookbackendgoogle-DEBUG: google_book_add_contact (process:13597): libebookbackendgoogle-DEBUG: New primary email entry test@testemailforevo.com (http://schemas.google.com/g/2005#home/(null)) (process:13597): libebookbackendgoogle-DEBUG: New email entry secondary@testemail.com (http://schemas.google.com/g/2005#other/(null)) (process:13597): libebookbackendgoogle-DEBUG: new entry with xml: <?xml version="1.0"?> <entry xmlns:gd="http://schemas.google.com/g/2005" xmlns="http://www.w3.org/2005/Atom"><category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/><title type="text">TestContactor</title><gd:email address="test@testemailforevo.com" rel="http://schemas.google.com/g/2005#home" primary="true"/><gd:email address="secondary@testemail.com" rel="http://schemas.google.com/g/2005#other"/></entry> feed.xml:8: namespace error : Namespace prefix gd on email is not defined chemas.google.com/g/2005#home" address="test@testemailforevo.com" primary="true" ^ (process:13597): libebookbackendgoogle-DEBUG: Creating contact failed: Adding entry failed due to 'Bad Request' (HTTP code 400)
Thanks for the update. I'm CCing the author of the google addressbook backend, in hope he'll know what's going wrong. (just it case it's not only because of the namespace issue, even, as I said in comment #7, it seems to work fine for me).
Thanks. Let me know if there's anything additional I can do.
Following up with my own troubleshooting on this issue: I have a laptop (Ubuntu 9.10 32-bit) and a desktop (9.10 64-bit), both having been upgraded from Ubuntu 8.04-->8.10-->9.04-->9.10, and both exhibit this same problem. On both the desktop and laptop, I tried several users, including a brand new clean user just to test this problem. This clean new user exhibits the problems I described in #6 above. However, on the desktop computer, I have a clean partition that I installed Ubuntu 9.10 beta onto. This problem is not exhibited in Evolution on the fresh install of ubuntu 9.10 beta on that separate partition. I'm therefore led to the conclusion that something in the upgrade history is preventing proper google sync. Any guidance on where to begin?
Another user on the launchpad system has found a solution for my symptoms as reported in #6 above. see: https://bugs.launchpad.net/ubuntu/+source/evolution/+bug/465015 The issue appears to be caused by some problems with DNS servers. Switching to the google DNS servers 8.8.8.8 and 8.8.4.4 fixes this issue for me. Using either Rogers' or OpenDNS causes the "other error" message to appear when creating new contacts. Not sure if this is related to my physical location here in Canada.
I still have these issues with Google contact sync running Evolution 2.28.3. Merge does not work and google looses the contact all together after failed merge. Any news on this issue?
Is this still a problem? The Google Contacts backend has undergone a few big changes since this was reported, and it would be a shame if this was still a problem. If this is still a problem, please run e-addressbook-factory with GOOGLE_BACKEND_DEBUG=1 and LIBGDATA_DEBUG=3 environment variables set, reproduce the problem in Evolution and attach the log here. (You might want to censor personal details and your password first.)
Please feel free to reopen this bug if the problem still occurs with a newer version of Evolution 3.0.3 or 3.2.1 or later.