GNOME Bugzilla – Bug 425512
Unable to open addressbook when 1st time opened
Last modified: 2008-08-07 09:55:34 UTC
Please describe the problem: Fail to open new addressbook. Steps to reproduce: 1. Invoke evolution 2. Select 'contacts' 3. Create new addressbook (File -> New -> Address book) 4. Choose the created adddress book Actual results: Error message displays (only once). When you click on this item second time, it works correctly. Expected results: Open successfully for the first time. Does this happen every time? Yes. Other information:
Created attachment 85704 [details] [review] Patch "GtkTreeStore *store;" should be defined as "static GtkTreeStore *store = NULL;". Otherwise, this variable is perhaps refered by other library incorrectly on solaris.
Sorry, please ignore the above wrong patch.
Created attachment 85753 [details] screenshot Also, can't add any contact to new addressbook. Error message display in terminal is like this. (evolution-data-server:18875): libebook-WARNING **: "e_book_get_book_view" on book before "e_book_open" impl_GNOME_Evolution_Addressbook_BookFactory_getBook + file:///export/home/zheng/.evolution/addressbook/local/1175583774.18878.1@goaltender => 812d890 impl_GNOME_Evolution_Addressbook_Book_open (812d890) in server_log_handler (evolution-data-server:18875): libebookbackend-WARNING **: libdb error: put: attempt to modify a read-only tree in server_log_handler (evolution-data-server:18875): libebookbackend-WARNING **: e_book_backend_file_maybe_upgrade_db failed
Created attachment 85838 [details] [review] Patch Addressbook data management is done by Brekeley DB. addressbook.db file is created and opened like this, db->open (db, NULL, filename, NULL, DB_HASH, DB_RDONLY | DB_THREAD, 0666); if (db_error != 0 && !only_if_exists) { db->open (db, NULL, filename, NULL, DB_HASH, DB_CREATE | DB_THREAD, 0666); } Eventually, db is possibly read-only because db->flags isn't cleared after failure of db->open. So the writing in db->put() followed db->open() fails, then it return GNOME_Evolution_Addressbook_OtherError and show the warning message dialog. According to docs of BDB, manpage for db->open mentions this. "The DB->open method returns a non-zero error value on failure and 0 on success. If DB->open fails, the DB->close method must be called to discard the DB handle" To fix this issue, add calling db->close() after every failure of db->open().
Looks fine Simonz.
Srag, thanks. Committed the patch to branch gnome-2-18 and trunk.
mark the patch as committed.
*** Bug 402867 has been marked as a duplicate of this bug. ***
*** Bug 431006 has been marked as a duplicate of this bug. ***
*** Bug 386223 has been marked as a duplicate of this bug. ***
*** Bug 402902 has been marked as a duplicate of this bug. ***