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 365114 - index synchronization is enabled even if BEAGLE_STORAGE isn't on NFS
index synchronization is enabled even if BEAGLE_STORAGE isn't on NFS
Status: RESOLVED FIXED
Product: beagle
Classification: Other
Component: General
0.2.12
Other All
: Normal major
: ---
Assigned To: Beagle Bugs
Beagle Bugs
Depends on:
Blocks:
 
 
Reported: 2006-10-25 21:03 UTC by Tim Newsome
Modified: 2006-11-14 22:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
hack that makes everything work on my computer (2.55 KB, patch)
2006-11-02 19:46 UTC, Tim Newsome
rejected Details | Review

Description Tim Newsome 2006-10-25 21:03:40 UTC
Please describe the problem:
See below.

Steps to reproduce:
See below.

Actual results:
See below.

Expected results:
See below.

Does this happen every time?
Yes.

Other information:
I just built 0.2.11 on Kubuntu edgy, because I had the same problem with the
ubuntu packages (which are slightly older). Basically after I shut down beagle
and start it up again, it appears to have lost all its indexes. Here's what I did:

nuisance@swamp:~$ echo $BEAGLE_STORAGE
/export/nuisance/beagle
nuisance@swamp:~$ rm -rf /export/nuisance/beagle
nuisance@swamp:~$ beagled --bg; sleep 5m; beagle-query test; beagle-shutdown
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2002>2311
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2002>2310
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2002>2308
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2002>6
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2002>5
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2000>168
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2000>140
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2000>137
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2000>130
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2000>122
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2000>119
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2002>3832
imap://nuisance@swamp.ghs.com:666/fetch>UID>/archive-2002>4361
nuisance@swamp:~$ beagled --bg; sleep 20s; beagle-query test; beagle-shutdown
nuisance@swamp:~$

As you can see the second time I ran beagle, it didn't remember any of the stuff it had indexed before.

This is what my Log directory looks like at the end:
-rw-r--r-- 1 nuisance green 28785 2006-10-25 12:28 2006-10-25-12-23-19-Beagle
-rw-r--r-- 1 nuisance green  2776 2006-10-25 12:25 2006-10-25-12-23-19-BeagleExceptions
-rw-r--r-- 1 nuisance green 66202 2006-10-25 12:28 2006-10-25-12-24-23-IndexHelper
-rw-r--r-- 1 nuisance green  2678 2006-10-25 12:29 2006-10-25-12-29-30-Beagle
lrwxrwxrwx 1 nuisance green    54 2006-10-25 12:29 current-Beagle -> /export/nuisance/beagle/Log/2006-10-25-12-29-30-Beagle
lrwxrwxrwx 1 nuisance green    59 2006-10-25 12:24 current-IndexHelper -> /export/nuisance/beagle/Log/2006-10-25-12-24-23-IndexHelper

and this is the output of "grep -v DEBUG 2006*" in that directory:
2006-10-25-12-23-19-Beagle:061025 1223201018 28918 Beagle  WARN: Extended attributes are not supported on this filesystem.  Performance will suffer as a result.
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX: Failed to load /home/u/nuisance/.mozilla-thunderbird/6iappa5t.default/ImapMail/swamp.ghs.com/archive-2003.msf:
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX: System.ArgumentOutOfRangeException: < 0
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX: Parameter name: length
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX:   at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.1.17.1/mcs/class/corlib/System/String.cs:377
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content, System.Int32 position, System.String start, System.String end) [0x00033] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:129
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content) [0x0018d] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:115
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read () [0x00047] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:73
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.Thunderbird+Database.Load () [0x00010] in /export/nuisance/fun/beagle-0.2.11/Util/Thunderbird.cs:433
2006-10-25-12-23-19-Beagle:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Daemon.ThunderbirdQueryable.MailIndexableGenerator.LoadDatabase () [0x00017] in /export/nuisance/fun/beagle-0.2.11/beagled/ThunderbirdQueryable/Mail.cs:81
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX: Failed to load /home/u/nuisance/.mozilla-thunderbird/6iappa5t.default/ImapMail/swamp.ghs.com/archive-2003.msf:
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX: System.ArgumentOutOfRangeException: < 0
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX: Parameter name: length
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX:   at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.1.17.1/mcs/class/corlib/System/String.cs:377
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content, System.Int32 position, System.String start, System.String end) [0x00033] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:129
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content) [0x0018d] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:115
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read () [0x00047] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:73
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.Thunderbird+Database.Load () [0x00010] in /export/nuisance/fun/beagle-0.2.11/Util/Thunderbird.cs:433
2006-10-25-12-23-19-Beagle:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Daemon.ThunderbirdQueryable.MailIndexableGenerator.LoadDatabase () [0x00017] in /export/nuisance/fun/beagle-0.2.11/beagled/ThunderbirdQueryable/Mail.cs:81
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX: Failed to load /home/u/nuisance/.mozilla-thunderbird/6iappa5t.default/ImapMail/swamp.ghs.com/archive-2003.msf:
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX: System.ArgumentOutOfRangeException: < 0
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX: Parameter name: length
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX:   at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.1.17.1/mcs/class/corlib/System/String.cs:377
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content, System.Int32 position, System.String start, System.String end) [0x00033] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:129
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content) [0x0018d] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:115
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read () [0x00047] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:73
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Util.Thunderbird+Database.Load () [0x00010] in /export/nuisance/fun/beagle-0.2.11/Util/Thunderbird.cs:433
2006-10-25-12-23-19-BeagleExceptions:061025 1224311995 28918 Beagle  WARN EX:   at Beagle.Daemon.ThunderbirdQueryable.MailIndexableGenerator.LoadDatabase () [0x00017] in /export/nuisance/fun/beagle-0.2.11/beagled/ThunderbirdQueryable/Mail.cs:81
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX: Failed to load /home/u/nuisance/.mozilla-thunderbird/6iappa5t.default/ImapMail/swamp.ghs.com/archive-2003.msf:
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX: System.ArgumentOutOfRangeException: < 0
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX: Parameter name: length
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX:   at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.1.17.1/mcs/class/corlib/System/String.cs:377
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content, System.Int32 position, System.String start, System.String end) [0x00033] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:129
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read (System.String content) [0x0018d] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:115
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.MorkDatabase.Read () [0x00047] in /export/nuisance/fun/beagle-0.2.11/Util/Mork.cs:73
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Util.Thunderbird+Database.Load () [0x00010] in /export/nuisance/fun/beagle-0.2.11/Util/Thunderbird.cs:433
2006-10-25-12-23-19-BeagleExceptions:061025 1225290527 28918 Beagle  WARN EX:   at Beagle.Daemon.ThunderbirdQueryable.MailIndexableGenerator.LoadDatabase () [0x00017] in /export/nuisance/fun/beagle-0.2.11/beagled/ThunderbirdQueryable/Mail.cs:81
2006-10-25-12-24-23-IndexHelper:061025 1224243203 30775 IndexH  WARN: Unable to set IO priority for process to idle
2006-10-25-12-29-30-Beagle:061025 1229304390 04910 Beagle  WARN: Extended attributes are not supported on this filesystem.  Performance will suffer as a result.


I sent this to dashboard-hackers. Joe Shaw requested I file this as a bug. This is what he thinks is going on:
"I don't think the indexes are lost, but it does look like the
Thunderbird backend has a bug and is unable to read its own index.  What
does beagle-index-info tell you about the Thunderbird backend?"

and 

"This must be a bug in the Thunderbird backend.  Can you file a bug about
this at bugzilla.gnome.org and (if you can) attach the .msf file
mentioned?  That would allow Pierre or Kevin (our two Thunderbird
developers) to take a look."

nuisance@swamp:~$ beagle-info --index-info
Index information:
Name: Thunderbird
Count: 0
Indexing: True

Name: KMail
Count: 0
Indexing: False

Name: Files
Count: 1
Indexing: True

Name: GaimLog
Count: 0
Indexing: False

Name: IndexingService
Count: 0
Indexing: True

Name: Tomboy
Count: 0
Indexing: False

Name: Labyrinth
Count: 0
Indexing: False

Name: Blam
Count: 0
Indexing: False

Name: Liferea
Count: 0
Indexing: False

Name: Akregator
Count: 0
Indexing: False

Name: KonquerorHistory
Count: 0
Indexing: True

Name: KNotes
Count: 0
Indexing: False

Name: KAddressBook
Count: 0
Indexing: False

Name: Kopete
Count: 0
Indexing: False
Comment 1 Tim Newsome 2006-10-26 16:58:50 UTC
Note that my home directory, /home/u/nuisance, is mounted over NFS. / (where the beagle index lives) is a local file system (reiserfs).
Comment 2 Tim Newsome 2006-11-02 17:13:46 UTC
This is the latest exchange I had with Joe Shaw about this issue:

Tim: "Some other info I hadn't mentioned before. /home/u/nuisance is my NFS-mounted home directory. /export is local to my machine."

Joe: "Ok.  Normally Beagle copies the index stored on your NFS home directory
to a local temporary directory and does all its indexing there, copying
the directory back over at intervals and when it's shut down.  It looks
like there might be a bug in that code.  I'll try to take a look into it
further, but it would be helpful if you could mention that you have an
NFS homedir in the bug."

Tim: "But the index isn't stored in the NFS home directory. I have BEAGLE_STORAGE set to /export/nuisance/beagle, which is on a local disk."

Joe: "That's quite possibly the bug then.  ;)   The logs show that it's doing
some synchronization.  From where, I'm not sure.  :)"



Finally, I just wanted to say I get the exact same problem with the newly released beagle 0.2.12.
Comment 3 Tim Newsome 2006-11-02 19:46:34 UTC
Created attachment 75883 [details] [review]
hack that makes everything work on my computer

Here's a patch that fixes the problem for me. I made 2 changes:
1. Only synchronize when the local and target directories differ. I'm not sure if this made any difference, but it seems like a good sanity check.
2. Never ever purge the locally synchronized indexes. Obviously this is not right for everybody, but it solves the problem for me. I don't know what the right time is to purge or not, but presumably somebody who knows the code would know.

Here's what my current-Beagle looks like on a 20s run with a single query:
061102 1140422417 01193 Beagle DEBUG: Starting Beagle Daemon (version 0.2.12)
061102 1140422607 01193 Beagle DEBUG: Running on Mono 1.1.17.1
061102 1140422612 01193 Beagle DEBUG: Command Line: /usr/local/lib/beagle/BeagleDaemon.exe --bg
061102 1140422694 01193 Beagle  WARN: Extended attributes are not supported on this filesystem.  Performance will suffer as a result.
061102 1140422731 01193 Beagle DEBUG: Unable to establish a connection to the X server
061102 1140424441 01193 Beagle DEBUG: Starting main loop
061102 1140424460 01193 Beagle DEBUG: Beginning main loop
061102 1140424465 01193 Beagle DEBUG: Starting messaging server
061102 1140424605 01193 Beagle DEBUG: Initializing index synchronization
061102 1140424616 01193 Beagle DEBUG: Synchronizing Local... (source_directory=/export/nuisance/beagle/Indexes, target_directory=/export/nuisance/beagle/Indexes)
061102 1140424636 01193 Beagle DEBUG: Skipping synchronization because source and target dirs are the same.
061102 1140424665 01193 Beagle DEBUG: Starting QueryDriver
061102 1140425232 01193 Beagle DEBUG: Found index helper at /usr/local/lib/beagle/beagled-index-helper
061102 1140425307 01193 Beagle DEBUG: Found 1 backends in /usr/local/lib/beagle/Backends/ThunderbirdBackends.dll
061102 1140425617 01193 Beagle DEBUG: KMail folders not found. Will keep trying
061102 1140425654 01193 Beagle DEBUG: Starting Inotify Backend
061102 1140426469 01193 Beagle DEBUG: KonqCacheDir: /var/tmp/kdecache-nuisance/http
061102 1140426938 01193 Beagle DEBUG: Found 14 backends in /usr/local/lib/beagle/BeagleDaemonLib.dll
061102 1140426949 01193 Beagle DEBUG: Reading mapping from filters
061102 1140426989 01193 Beagle DEBUG: Loading user-configured static indexes.
061102 1140426990 01193 Beagle DEBUG: Found 0 user-configured static indexes..
061102 1140426991 01193 Beagle DEBUG: Waiting 60 seconds before starting queryables
061102 1140426999 01193 Beagle DEBUG: Starting Scheduler thread
061102 1140427009 01193 Beagle DEBUG: Starting Inotify threads
061102 1140427084 01193 Beagle DEBUG: Daemon initialization finished after .26s
061102 1140427117 01193 Beagle DEBUG: Memory usage: VmSize=48.0 MB, VmRSS=12.3 MB,  GC.GetTotalMemory=1404928
061102 1141023384 01193 Beagle DEBUG: Parsed query 'test' as text_query
061102 1141034376 01193 Beagle DEBUG: Stopping inotify threads
061102 1141034417 01193 Beagle DEBUG: Synchronizing Remote... (source_directory=/export/nuisance/beagle/Indexes, target_directory=/export/nuisance/beagle/Indexes)
061102 1141034422 01193 Beagle DEBUG: Skipping synchronization because source and target dirs are the same.
061102 1141034424 01193 Beagle DEBUG: Not purging locally synchronized indexes
061102 1141034459 01193 Beagle DEBUG: Server '/export/nuisance/beagle/socket' shut down
061102 1141034477 01193 Beagle DEBUG: Exiting
061102 1141034481 01193 Beagle DEBUG: Leaving BeagleDaemon.Main
Comment 4 Kevin Kubasik 2006-11-08 10:28:13 UTC
I think a big part of the issue is that infamous db.Load() method in thunderbird, it does a blocking readtoend(). Not a big deal if its on a local high-speed fs with a few k, but a big mail file over nfs could get really ugly. And probably result in the thunderbird process refusing to let go and bringing some index files down with her as she goes. And once thats happened, they get flushed etc.

Tim: and this patch doesn't cause any side effects?
Comment 5 Tim Newsome 2006-11-08 18:11:02 UTC
Well, the patch will never purge the locally sync'ed indexes, which presumably is required in some cases. For me it seems to work great.
Comment 6 Joe Shaw 2006-11-14 22:34:33 UTC
I just checked in a fix for this.