lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3008) NumberFormatException: For input string: "gen.before_restore_2011-03-21_07.15.36.372112"
Date Wed, 20 Apr 2011 20:16:05 GMT


Hoss Man commented on LUCENE-3008:

it appears that maybe someone attempted to "backup" the segments file in an index directory
by copying it to a new filename with an extension (".before_restore_2011-03-21_07.15.36.372112")
and this confused the SegmentInfos code into thinking that extension was the segment generation

in general, this is a no-no on the users part -- you shouldn't muck with the file names in
an index directory (but you can copy the entire directory to your hearts content)

that said, we should probably consider hardening SegmentInfos.getCurrentSegmentGeneration
to be more strict about which "segment*" files it's willing to consider candidates for the
current generation.

at worst: we should wrap the NumberFormatException in something more useful.

> NumberFormatException: For input string: "gen.before_restore_2011-03-21_07.15.36.372112"
> ----------------------------------------------------------------------------------------
>                 Key: LUCENE-3008
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>            Reporter: Tran Nam Quang
> Hello,
> One of our users reported the following stacktrace:
> Exception in thread "Thread-3" java.lang.NumberFormatException: For input string: "gen.before_restore_2011-03-21_07.15.36.372112"
> at java.lang.NumberFormatException.forInputString(
> at java.lang.Long.parseLong(
> at org.apache.lucene.index.SegmentInfos.generationFromSegmentsFileName(
> at org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(
> at org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(
> at org.apache.lucene.index.IndexReader.indexExists(
> at org.apache.lucene.index.IndexWriter.init(
> at org.apache.lucene.index.IndexWriter.<init>(
> at net.sourceforge.docfetcher.model.RootScope.updateIndex(
> at net.sourceforge.docfetcher.model.ScopeRegistry$
> I'm afraid I can't provide any more information than this, other than the Lucene version:
> Best regards
> Tran Nam Quang

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message