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 425512 - Unable to open addressbook when 1st time opened
Unable to open addressbook when 1st time opened
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
2.10.x (obsolete)
Other All
: Normal major
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
: 386223 402867 402902 431006 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-04-02 15:20 UTC by Xiurong Simon Zheng
Modified: 2008-08-07 09:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Patch (615 bytes, patch)
2007-04-02 15:26 UTC, Xiurong Simon Zheng
none Details | Review
screenshot (138.25 KB, image/png)
2007-04-03 07:11 UTC, Xiurong Simon Zheng
  Details
Patch (1.51 KB, patch)
2007-04-05 08:20 UTC, Xiurong Simon Zheng
committed Details | Review

Description Xiurong Simon Zheng 2007-04-02 15:20:12 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:
Comment 1 Xiurong Simon Zheng 2007-04-02 15:26:38 UTC
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.
Comment 2 Xiurong Simon Zheng 2007-04-03 07:05:43 UTC
Sorry, please ignore the above wrong patch.
Comment 3 Xiurong Simon Zheng 2007-04-03 07:11:13 UTC
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
Comment 4 Xiurong Simon Zheng 2007-04-05 08:20:42 UTC
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().
Comment 5 Srinivasa Ragavan 2007-04-06 18:42:02 UTC
Looks fine Simonz.
Comment 6 Xiurong Simon Zheng 2007-04-09 03:16:13 UTC
Srag, thanks. Committed the patch to branch gnome-2-18 and trunk.
Comment 7 Harry Lu 2007-04-10 11:30:15 UTC
mark the patch as committed.
Comment 8 Srinivasa Ragavan 2007-05-02 05:19:23 UTC
*** Bug 402867 has been marked as a duplicate of this bug. ***
Comment 9 Ted Percival 2007-08-15 04:56:29 UTC
*** Bug 431006 has been marked as a duplicate of this bug. ***
Comment 10 André Klapper 2007-12-09 00:35:25 UTC
*** Bug 386223 has been marked as a duplicate of this bug. ***
Comment 11 Ashish 2008-08-07 09:55:34 UTC
*** Bug 402902 has been marked as a duplicate of this bug. ***