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 589325 - Evolution Contacts reports ambiguous error on Google Contacts authentication failure with bad password
Evolution Contacts reports ambiguous error on Google Contacts authentication ...
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
2.26.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
evolution[google] evolution[passwords]
Depends on:
Blocks:
 
 
Reported: 2009-07-22 07:31 UTC by Richard Schwarting
Modified: 2009-07-22 10:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Richard Schwarting 2009-07-22 07:31:21 UTC
Please describe the problem:
Evolution in addressbook/gui/component/addressbook.c in addressbook_authenticate (), will call e_passwords_get_password() to retrieve the password. 

In my case, I had a stale password saved in my GNOME keyring which it retrieved and attempted to authenticate with.  

Upon failure, an error dialogue pops up with:
dialogue title: 
| UNABLE TO OPEN ADDRESS BOOK
message:
| Error loading address book.
| 
| This address book cannot be opened.  This either means that 
| an incorrect URI was entered, or the server is unreachable.
| 
| Detailed error message: Other error

However, if I update the password in GNOME keyring, I then authenticate fine.

So, the error message is too ambiguous for the situation, and fails to report the actual source of the problem.  Ideally, Evolution would prompt the user for the correct password.

Here's a backtrace from the error dialogue, with #0,1,2 being the most relevant, followed by a backtrace of the authentication code before the callback.

*** LEADING TO THE ERROR DIALOGUE ***
Breakpoint 1, eab_load_error_dialog (parent=0x0, source=0x96eed50, 
    status=E_BOOK_ERROR_OTHER_ERROR) at eab-gui-util.c:104
104		g_return_if_fail (source != NULL);
(gdb) bt
  • #0 eab_load_error_dialog
    at eab-gui-util.c line 104
  • #1 book_open_cb
    at addressbook-view.c line 1333
  • #2 load_source_auth_cb
    at addressbook.c line 142
  • #3 emit_async_generic_response
    at e-book.c line 2473
  • #4 g_idle_dispatch
    at gmain.c line 3919
  • #5 g_main_dispatch
    at gmain.c line 1814
  • #6 IA__g_main_context_dispatch
    at gmain.c line 2367
  • #7 g_main_context_iterate
    at gmain.c line 2445
  • #8 IA__g_main_loop_run
    at gmain.c line 2653
  • #9 bonobo_main
    at bonobo-main.c line 311
  • #10 main
    at main.c line 704
  • #0 GNOME_Evolution_Addressbook_Book_authenticateUser
    at Evolution-DataServer-Addressbook-stubs.c line 85
  • #1 do_authenticate_user
    at e-book.c line 1240
  • #2 e_book_async_authenticate_user
    at e-book.c line 1344
  • #3 addressbook_authenticate
    at addressbook.c line 231
  • #4 emit_async_open_response
    at e-book.c line 2820
  • #5 g_idle_dispatch
    at gmain.c line 3919
  • #6 g_main_dispatch
    at gmain.c line 1814
  • #7 IA__g_main_context_dispatch
    at gmain.c line 2367
  • #8 g_main_context_iterate
    at gmain.c line 2445
  • #9 IA__g_main_loop_run
    at gmain.c line 2653
  • #10 bonobo_main
    at bonobo-main.c line 311
  • #11 main
    at main.c line 704

*** AUTHENTICATION IN E-D-S ***

GNOME_Evolution_Addressbook_Book_authenticateUser uses orbit/bonobo magic and ends up calling the following in e-d-s which I couldn't effectively debug because gdb was failing to attach for some reason:

* addressbook/libedata-book/e-data-book.c:  
impl_GNOME_Evolution_Addressbook_Book_authenticateUser, calls
* addressbook/libedata-book/e-data-book.c:  
e_book_backend_authenticate_user, calls:  (* E_BOOK_BACKEND_GET_CLASS (backend)->authenticate_user) (backend, book, opid, user, passwd, auth_method);
** I'm assuming the backend is the google one :) 
* addressbook/backends/google/e-book-backend-google.c:  
e_book_backend_google_authenticate_user, calls
    * addressbook/backends/google/google-book.c:  
      google_book_connect_to_google, which fails with the bad error, 
    * addressbook/backends/google/e-book-backend-google.c:  
      e_book_backend_status_from_google_book_error, which *ALWAYS* returns 
          GNOME_Evolution_Addressbook_OtherError

So, yah, here e-d-s always returns OtherError which doesn't give the user any additional information.  Are the Google errors currently too limited to be able to return something more useful?

Steps to reproduce:
1. Store an invalid password for your Google Contacts in your keyring
2. Try to open your Google Contacts addressbook in Evolution



Actual results:
I receive an ambiguous error

Expected results:
I receive an error indicating the nature of the problem (bad password) AND am prompted to prompted to provide a valid one.

Does this happen every time?
Whenever I have a bad password set.

Other information:
Comment 1 Milan Crha 2009-07-22 09:52:06 UTC
Created commit cb9fa63 in eds master (2.27.5+)

Great investigation, thanks a lot. On ething which wasn't obvious, the google_book_error_from_soup_error was always setting the error code to GOOGLE_BOOK_ERROR_HTTP_ERROR, though it knew the correct code based on the soup error. I fixed that all in the above mentioned commit.
Comment 2 Richard Schwarting 2009-07-22 10:25:48 UTC
Yay!  Thanks for looking into this so soon :)