Article View: news.software.nntp
Article #62165Re: INN 2.3.3 tradspool problem
From: Russ Allbery
Date: Fri, 29 Nov 2002 02:52
Date: Fri, 29 Nov 2002 02:52
72 lines
4223 bytes
4223 bytes
ktso <ktso@cuRemov-mEhk.edu.hk> writes:
> I have tried to search similar problems with INN at Google. It seems
> that most of us suffered such problem after a crash.
> Nov 29 09:44:01 helium innd: localhost connected 53
> Nov 29 09:44:01 helium innd: tradspool: could not open /usr/local/news/spool/articles/local/test/2 File exists
> Nov 29 09:44:01 helium innd: SERVER cant store article: File exists
> It is not the only cause of problem. If I create a tradspool group and
> post a few messages in it and then remove the group, the problem will
> arise when I post articles to it again. In the past when we do not have
> tradspool storage API, we can renumber the group and the old articles
> can re-appear again. Old articles will also be expired during
> news.daily even if the group does not exist.
URL: <http://www.eyrie.org/~eagle/faqs/inn.html#S4.4>
Subject: 4.4. tradspool: could not open ... File exists
This error generally happens after a crash or unclean shutdown of innd
using the tradspool storage method, and is caused by overview information
being out of sync with what articles are in the spool. When innd was
restarted, it renumbered its active file (which determines the range of
existing articles in each group and therefore what article number is
assigned to new articles) based on the overview information. If there are
newer articles already on disk that aren't mentioned in the overview
(because the overview information for those articles hasn't been flushed
to disk yet), new incoming articles will get assigned the same number as
the existing article and then innd will fail to store the article and
throttle with this error.
One way to correct this error is to rebuild the entire overview database
with:
makehistory -O -x -F
but this takes a long time and is to some degree overkill. A better
solution in some cases is to just remove all articles in the spool that
have higher numbers than the numbers in the active file.
Here's a Perl script that will do that. Just save this to a file, make it
executable, and run it, giving it the path to the active file as the first
argument and the path to the top of your tradspool news spool as the
second argument:
#!/usr/bin/perl
die "Usage: <name> <active> <spool-path>\n" unless @ARGV == 2;
open (ACTIVE, $ARGV[0]) or die "Can't open $ARGV[0]: $!\n";
while (<ACTIVE>) {
my ($group, $hi, $lo, $flag) = split;
my $directory = $group;
next if ($hi == 0 and $lo <= 1);
$directory =~ tr%.%/%;
$directory = $ARGV[1] . '/' . $directory;
opendir (DIR, $directory) or die "Can't open $directory: $!\n";
while (defined ($_ = readdir DIR)) {
unlink "$directory/$_" if ($_ > $hi);
}
closedir DIR;
}
INN 2.4 is expected to have better recovery tools to deal with problems
like this, and to be less vulnerable to losing overview information in
system crashes.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<yladjt5bqd.fsf@windlord.stanford.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mailReferences:
<as6kcs$2r79$1@ijustice.itsc.cuhk.edu.hk>Show Full Headers
Complete Article Headers
Message-ID: <yladjt5bqd.fsf@windlord.stanford.edu> Subject: Re: INN 2.3.3 tradspool problem Date: Thu, 28 Nov 2002 18:52:10 -0800 From: Russ Allbery <rra@stanford.edu> References: <as6kcs$2r79$1@ijustice.itsc.cuhk.edu.hk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Lines: 71 NNTP-Posting-Host: windlord.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.Stanford.EDU 1038538330 9353 171.64.13.23 (29 Nov 2002 02:52:10 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Honest Recruiter, sparc-sun-solaris2.6) Cancel-Lock: sha1:fr9ifYkhSs5pA48PP3/ALGG4YtY=