Mailing List Archive

strange problem: bayes_* R/W: tie failed: File exists
My SA (2.63) installation has been working great for months now,
but today sa-learn started complaining like this:

condor:~>sa-learn --showdots --spam --mbox abc
Cannot open bayes databases /etc/spamassassin/data/bayes_* R/O: tie failed:
Cannot open bayes databases /etc/spamassassin/data/bayes_* R/W: tie failed: File exists
Cannot open bayes databases /etc/spamassassin/data/bayes_* R/W: tie failed: File exists

I didn't change anything of SA but I did upgrade perl today from 5.6.1-8.6
to 5.8.3-2 (Debian packages). Could that have broken Bayes?

The files seem okay and:
condor:~>file /etc/spamassassin/data/bayes_*
/etc/spamassassin/data/bayes_seen: Berkeley DB (Hash, version 5, native byte-order)
/etc/spamassassin/data/bayes_toks: Berkeley DB (Hash, version 5, native byte-order)

Running sa-learn with -D doesn't help me much either:
debug: Score set 0 chosen.
debug: running in taint mode? yes
debug: Running in taint mode, removing unsafe env vars, and resetting PATH
debug: PATH included '/home/spiegl/bin', keeping.
debug: PATH included '/home/spiegl/local/bin', keeping.
debug: PATH included '/usr/local/bin', keeping.
debug: PATH included '/usr/local/bin/X11', keeping.
debug: PATH included '/bin', keeping.
debug: PATH included '/sbin', keeping.
debug: PATH included '/usr/bin', keeping.
debug: PATH included '/usr/sbin', keeping.
debug: PATH included '/usr/local/sbin', keeping.
debug: PATH included '/usr/bin/X11', keeping.
debug: PATH included '/usr/games', keeping.
debug: Final PATH set to: /home/spiegl/bin:/home/spiegl/local/bin:/usr/local/bin:/usr/local/bin/X11:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/bin/X11:/usr/games
debug: using "/usr/share/spamassassin" for default rules dir
debug: using "/etc/spamassassin" for site rules dir
debug: using "/home/spiegl/.spamassassin/user_prefs" for user prefs file
debug: bayes: 21001 tie-ing to DB file R/O /etc/spamassassin/data/bayes_toks
Cannot open bayes databases /etc/spamassassin/data/bayes_* R/O: tie failed:
debug: Score set 0 chosen.
debug: Initialising learner
debug: Initialising learner
debug: Syncing Bayes journal and expiring old tokens...
debug: lock: 21001 created /etc/spamassassin/data/bayes.lock.condor.int.spiegl.de.21001
debug: lock: 21001 trying to get lock on /etc/spamassassin/data/bayes with 0 retries
debug: lock: 21001 link to /etc/spamassassin/data/bayes.lock: link ok
debug: bayes: 21001 tie-ing to DB file R/W /etc/spamassassin/data/bayes_toks
debug: unlock: 21001 unlink /etc/spamassassin/data/bayes.lock
Cannot open bayes databases /etc/spamassassin/data/bayes_* R/W: tie failed: File exists
debug: Syncing complete.
debug: Removing Markup
debug: Learning Spam
debug: uri tests: Done uriRE
debug: lock: 21001 created /etc/spamassassin/data/bayes.lock.condor.int.spiegl.de.21001
debug: lock: 21001 trying to get lock on /etc/spamassassin/data/bayes with 0 retries
debug: lock: 21001 link to /etc/spamassassin/data/bayes.lock: link ok
debug: bayes: 21001 tie-ing to DB file R/W /etc/spamassassin/data/bayes_toks
debug: unlock: 21001 unlink /etc/spamassassin/data/bayes.lock
Cannot open bayes databases /etc/spamassassin/data/bayes_* R/W: tie failed: File exists

Learned from 0 message(s) (1 message(s) examined).
debug: bayes: 21001 untie-ing
debug: bayes: 21001 untie-ing db_toks
ERROR: the Bayes learn function returned an error, please re-run with -D for more information

And it exits with code 17.


Thanks for any suggestion,
Andy.

--
o _ _ _
------- __o __o /\_ _ \\o (_)\__/o (_) -o)
----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\
---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is the final test of a gentleman: his respect for those
who can be of no possible service to him. -- William Lyon Phelps
Re: strange problem: bayes_* R/W: tie failed: File exists [ In reply to ]
On Wed, Mar 10, 2004 at 11:58:59PM +0100, Andy Spiegl wrote:
> I didn't change anything of SA but I did upgrade perl today from 5.6.1-8.6
> to 5.8.3-2 (Debian packages). Could that have broken Bayes?

Hahahahaha. Sorry, that was pretty funny on this end. Yes, it could
very much have broken Bayes. Specifically lack of or new version
of DB_File.

> /etc/spamassassin/data/bayes_seen: Berkeley DB (Hash, version 5, native byte-order)
> /etc/spamassassin/data/bayes_toks: Berkeley DB (Hash, version 5, native byte-order)

Hrm. Unless you're running on older libdb, you'll want to upgrade those via db_upgrade.

> Cannot open bayes databases /etc/spamassassin/data/bayes_* R/W: tie failed: File exists

It usually means the lock didn't work, but I'm guessing that you either
don't have DB_File installed, or the one that's now installed doesn't
know how to deal with your DB files.

--
Randomly Generated Tagline:
"Note that I am a proponent of Zen in the Art of Systems Administration,
and thus believe that it's appropriate to present yourself as a beginner
in all things. This helps you keep a fresh perspective and spank the
unsuspecting at snooker." - Benjy Feen
Re: strange problem: bayes_* R/W: tie failed: File exists [ In reply to ]
> On Wed, Mar 10, 2004 at 11:58:59PM +0100, Andy Spiegl wrote:
> > I didn't change anything of SA but I did upgrade perl today from 5.6.1-8.6
> > to 5.8.3-2 (Debian packages). Could that have broken Bayes?
>
> Hahahahaha. Sorry, that was pretty funny on this end. Yes, it could
> very much have broken Bayes. Specifically lack of or new version
> of DB_File.
Hm, actually I don't think it's that funny. I was assuming that a minor
upgrade like that wouldn't completely break compatibility with older
databases. At least I would have expected a warning or hint during the
upgrade of perl. :-(

> > /etc/spamassassin/data/bayes_seen: Berkeley DB (Hash, version 5, native byte-order)
> > /etc/spamassassin/data/bayes_toks: Berkeley DB (Hash, version 5, native byte-order)
>
> Hrm. Unless you're running on older libdb, you'll want to upgrade those
> via db_upgrade.
Hm, I'm not sure what you are referring to. I've got various version of
libdb installed:
ii libdb1-compat 2.1.3-7 The Berkeley database routines
ii libdb2 2.7.7.0-7 The Berkeley database routines
ii libdb2-util 2.7.7.0-7 The Berkeley database routines
ii libdb3 3.2.9-19 Berkeley v3 Database Libraries
ii libdb3++c102 3.2.9-19 Berkeley v3 Database Libraries
ii libdb3-dev 3.2.9-19 Berkeley v3 Database Libraries
ii libdb3-util 3.2.9-16 Berkeley v3 Database Utilities
ii libdb4.0 4.0.14-1.3 Berkeley v4.0 Database Librari
ii libdb4.1 4.1.25-16 Berkeley v4.1 Database Librari
ii libdbaudiolib0 0.9.8-4 Communicate to the DBMix audio
ii libdbh1.0-1 1.0.15-1 Creates disk based hashtables
ii libdbi-perl 1.35-1 The Perl5 Database Interface b

I can't find any libdb for v5, nor can I find the mentioned "db_upgrade".
Ah, wait there is a db3_upgrade in the libdb3-util package. Yes, that
worked! That easy once you know how to do it. :-)

> > Cannot open bayes databases /etc/spamassassin/data/bayes_* R/W: tie failed: File exists
Maybe this error message could be changed to something more helpful?
Like e.g.: "tie failed: you might have to upgrade your DB files with db_upgrade"

Thanks,
Andy.

--
o _ _ _
------- __o __o /\_ _ \\o (_)\__/o (_) -o)
----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\
---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Science owes more to the steam engine than the steam engine owes to science
-- James Bryant Conant 1983-1978, Science & Common Sense 1961 New Haven