[Spambayes] spam error...

Skip Montanaro skip at pobox.com
Thu Sep 25 09:32:07 EDT 2003


    nils> File "/usr/lib/python2.2/shelve.py", line 65, in get
    nils>   if self.dict.has_key(key):
    nils> error: (22, 'Invalid argument')

This suggests your database got corrupted.  A few questions to help decide
if this is a bug in the code or simply pilot error:

    * What version of SpamBayes are you running?

    * If you execute

        import whichdb, os
        from spambayes import Options
        dbfile = os.path.expanduser(Options.options["Storage",
                                                    "persistent_storage_file"])
        print whichdb.whichdb(dbfile)

      what is printed?

    * The last time you power cycled your computer did you shut down
      sb_server cleanly (that is, select "Save and shutdown" from your web
      browser)? 

If you're not running a fairly up-to-date version of SpamBayes (the most
recent distribution is 1.0a6), you should upgrade (you have a lot of faith
installing alpha software in /usr/bin!).  If whichdb reports "dumbdbm",
either change your storage options to something like

    [Storage]
    persistent_use_database: False
    persistent_storage_file: ~/hammie.pck

so you start using a pickle as your training database, or get and install
PyBSDDB, aka bsddb3 and delete your existing database files (there are
probably some info caches you also need to delete).  You will need a recent
(4.1.25 or later is best) version of Sleepycat's Berkeley DB database
library.

If you shut down your computer without cleanly exiting from sb_server,
*whack*!  I just rapped your knuckles with a ruler. ;-) I didn't hit them
very hard though.  Sb_server should probably catch a number of Unix signals
and exit cleanly upon receipt.  I don't believe it does that at the moment.

Skip




More information about the Spambayes mailing list