[spambayes-bugs] [ spambayes-Bugs-896366 ] Crashes in the web
interface
SourceForge.net
noreply at sourceforge.net
Wed Feb 18 20:17:33 EST 2004
Bugs item #896366, was opened at 2004-02-13 22:20
Message generated for change (Comment added) made by anadelonbrin
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=896366&group_id=61702
Category: pop3proxy
>Group: Source code 1.0a9 (0.9)
Status: Open
Resolution: None
Priority: 5
Submitted By: Massimo Ferrario (maxferrario)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crashes in the web interface
Initial Comment:
I am using the last (1.0a9) version of spambayes, and I
am having some problems with teh web interface.
1)
If I click on the "more statistics" link in the home page I
get
=====================================
500 Server error
Traceback (most recent call last):
File "/usr/lib/python2.2/site-
packages/spambayes/Dibbler.py", line 461, in
found_terminator
getattr(plugin, name)(**params)
File "/usr/lib/python2.2/site-
packages/spambayes/UserInterface.py", line 1016, in
onStats
s = Stats.Stats()
File "/usr/lib/python2.2/site-
packages/spambayes/Stats.py", line 42, in __init__
self.CalculateStats()
File "/usr/lib/python2.2/site-
packages/spambayes/Stats.py", line 58, in CalculateStats
for msg in msginfoDB.db:
File "/usr/lib/python2.2/shelve.py", line 70, in
__getitem__
f = StringIO(self.dict[key])
TypeError: key type must be string
=====================================
2)
If I try to train even a single message I get
=====================================
500 Server error
Traceback (most recent call last):
File "/usr/lib/python2.2/site-
packages/spambayes/Dibbler.py", line 461, in
found_terminator
getattr(plugin, name)(**params)
File "/usr/lib/python2.2/site-
packages/spambayes/ProxyUI.py", line 386, in onReview
targetCorpus.takeMessage(id, sourceCorpus)
File "/usr/lib/python2.2/site-
packages/spambayes/Corpus.py", line 187, in
takeMessage
self.addMessage(msg)
File "/usr/lib/python2.2/site-
packages/spambayes/FileCorpus.py", line 140, in
addMessage
Corpus.Corpus.addMessage(self, message)
File "/usr/lib/python2.2/site-
packages/spambayes/Corpus.py", line 133, in
addMessage
obs.onAddMessage(message)
File "/usr/lib/python2.2/site-
packages/spambayes/storage.py", line 581, in
onAddMessage
self.train(message)
File "/usr/lib/python2.2/site-
packages/spambayes/storage.py", line 589, in train
self.bayes.learn(message.tokenize(), self.is_spam)
File "/usr/lib/python2.2/site-
packages/spambayes/classifier.py", line 273, in learn
self._add_msg(wordstream, is_spam)
File "/usr/lib/python2.2/site-
packages/spambayes/classifier.py", line 375, in _add_msg
record = self._wordinfoget(word)
File "/usr/lib/python2.2/site-
packages/spambayes/storage.py", line 261, in
_wordinfoget
r = self.db.get(word)
File "/usr/lib/python2.2/shelve.py", line 65, in get
if self.dict.has_key(key):
error: (-30981, 'Unknown error 4294936315')
=====================================
Hint
yesterday I reported a bug that was solved very quickly:
it has domething to do with my version of python (2.2)
Could also this bug a python version incompatability ?
----------------------------------------------------------------------
>Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-19 14:17
Message:
Logged In: YES
user_id=552329
Cool - thanks for keeping us informed.
You can use the sb_dbexpimp.py script in the source dist to
convert between pickle & dbm. Running it without any
arguments gives example usage.
----------------------------------------------------------------------
Comment By: Massimo Ferrario (maxferrario)
Date: 2004-02-19 05:41
Message:
Logged In: YES
user_id=224613
I started yesterday a new proxy on the same machine (using
a differerent configuration) and it ran for a whole day without
problems, both in web training and SMTP training.
I am using pickle as database type.
When enough mail are collected I will try to use the new db
files on the 'production' installation, and let you know the
results.
BTW, which is the procedure to convert the db file from one
format to another (pickle <=> dbm)?
Thanks
----------------------------------------------------------------------
Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-17 16:07
Message:
Logged In: YES
user_id=552329
In the other bug report (the SMTP proxy one), you noted that
you could train a problem message with the "train
message/dbx/mbox" form on the front page of the web
interface. Can you also do this with ones that don't work via
the review page? (It's very strange).
----------------------------------------------------------------------
Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-17 16:03
Message:
Logged In: YES
user_id=552329
Noting dupe in [ 897895 ] training via SMTP is not possible
<https://sourceforge.net/tracker/index.php?
func=detail&aid=897895&group_id=61702&atid=498103>
----------------------------------------------------------------------
Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-17 12:53
Message:
Logged In: YES
user_id=552329
If you have it set to dbm (and haven't manually specified
which type of dbm in the config file - it's not exposed via the
web interface), then it'll be whatever it thinks is best for your
platform, probably bsddb or gdbm. The whichdb.py file in the
contrib directory should be able to figure out which one it is.
Sorry, I should have been more explicit about using a pickle.
At the moment changing is a bit of a headache if you've got
an existing database. Basically you have to change the
option, convert the db (or start from fresh), and then start it
up again. This will be fixed at some point.
I'll leave this for now (lots of 'real' work to do anyway!) until I
hear back about using fresh db's. I'm reasonably confident
that this is a case of the db being corrupt for some reason, or
an existing db not being opened correctly (there were
changes in the way that the db type is determined for
opening), so a fresh db would fix all of that (although it's not
ideal).
----------------------------------------------------------------------
Comment By: Massimo Ferrario (maxferrario)
Date: 2004-02-16 22:01
Message:
Logged In: YES
user_id=224613
> Were you using a version of sb before 1.0a9?
> If so, which version?
Yes, version 1.0a7
>What sort of database are you using?
> pickle? bsddb? gdbm?
dbm is set in the advancedconfig page: i do not see neither
bsddd nor gdbm.
>If you swap to a different
>one, does the problem still occur?
I tried to change to pickle and got
================
500 Server error
Traceback (most recent call last):
File "/usr/lib/python2.2/site-
packages/spambayes/Dibbler.py", line 461, in found_terminator
getattr(plugin, name)(**params)
File "/usr/lib/python2.2/site-
packages/spambayes/UserInterface.py", line 793, in
onChangeopts
self.reReadOptions()
File "/usr/lib/python2.2/site-
packages/spambayes/ProxyUI.py", line 711, in reReadOptions
state = self.state_recreator()
File "/usr/bin/sb_server.py", line 833, in _recreateState
state.close()
File "/usr/bin/sb_server.py", line 667, in close
state.bayes.store()
File "/usr/lib/python2.2/site-
packages/spambayes/storage.py", line 225, in store
self.db[key] = val.__getstate__()
File "/usr/lib/python2.2/shelve.py", line 77, in __setitem__
self.dict[key] = f.getvalue()
error: (-30981, 'Unknown error 4294936315')
===================
I had to manually change the bayescustomize.ini file
(removing the 'pickle' line) to have it started again.
>What happens if you move your dbs
> aside and use fresh ones?
> Does the error reoccur immediately,
> after a while, or not at all?
I will try this later
PS the changes in Stats.pm are working perfectly. Thanks
----------------------------------------------------------------------
Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-15 17:14
Message:
Logged In: YES
user_id=552329
I can't duplicate (2), even with Python 2.2, and it's a dupe of:
[ 833751 ] filter dies after a processing a few emails
<https://sourceforge.net/tracker/?func=detail&atid=498103&aid=833751&group_id=61702>
Unfortunately, this was submitted Nov 1 last year and hasn't
been fixed yet. Were you using a version of sb before
1.0a9? If so, which version? What sort of database are you
using? pickle? bsddb? gdbm? If you swap to a different
one, does the problem still occur?
(Sorry for all the questions, but I'm not at all sure what
could be causing this, although it certainly looks like a db
problem, and "unknown error" isn't the most helpful
description :)
What happens if you move your dbs aside and use fresh ones?
Does the error reoccur immediately, after a while, or not
at all?
----------------------------------------------------------------------
Comment By: Tony Meyer (anadelonbrin)
Date: 2004-02-15 15:19
Message:
Logged In: YES
user_id=552329
Drat. Yes, it is. It seems that iterating through a shelve
object doesn't work in Python 2.2, which is the problem with
(1). I'll look into (2) in an hour or so.
When Stats.py v1.6 makes it into anon CVS you can grab that
and drop into into your Lib/site-packages/spambayes folder
and it'll fix (1). (it's a 4 character change, anyway).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=896366&group_id=61702
More information about the Spambayes-bugs
mailing list