Overwritten segments.gen file by mistake

67 views
Skip to first unread message

Bashar

unread,
Jun 25, 2010, 9:20:06 AM6/25/10
to Sunspot
Hi,

When I was merging two branches, it seems I naively altered the
segments.gen file, and now when I try to use Sunspot I get error:


SEVERE: Could not start SOLR. Check solr/home property
java.lang.RuntimeException: java.lang.NumberFormatException: For input
string: "gen 15-32-53"
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:579)
at org.apache.solr.core.CoreContainer
$Initializer.initialize(CoreContainer.java:137)
at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:
83)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
99)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:
594)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:
1218)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:
500)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
448)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:
147)
at
org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:
161)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:
147)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
117)
at org.mortbay.jetty.Server.doStart(Server.java:210)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mortbay.start.Main.invokeMain(Main.java:183)
at org.mortbay.start.Main.start(Main.java:497)
at org.mortbay.start.Main.main(Main.java:115)
Caused by: java.lang.NumberFormatException: For input string: "gen
15-32-53"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:
48)
at java.lang.Long.parseLong(Long.java:419)
at
org.apache.lucene.index.SegmentInfos.generationFromSegmentsFileName(SegmentInfos.java:
197)
at
org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(SegmentInfos.java:
132)
at org.apache.lucene.index.SegmentInfos
$FindSegmentsFile.run(SegmentInfos.java:588)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:
69)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:476)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:403)
at
org.apache.solr.core.StandardIndexReaderFactory.newReader(StandardIndexReaderFactory.java:
38)
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1057)
... 27 more
Jun 25, 2010 4:00:36 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.RuntimeException: java.lang.NumberFormatException:
For input string: "gen 15-32-53"
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:579)
at org.apache.solr.core.CoreContainer
$Initializer.initialize(CoreContainer.java:137)
at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:
83)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:
99)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:
594)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:
1218)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:
500)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
448)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:
147)
at
org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:
161)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:
147)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
117)
at org.mortbay.jetty.Server.doStart(Server.java:210)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
40)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mortbay.start.Main.invokeMain(Main.java:183)
at org.mortbay.start.Main.start(Main.java:497)
at org.mortbay.start.Main.main(Main.java:115)
Caused by: java.lang.NumberFormatException: For input string: "gen
15-32-53"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:
48)
at java.lang.Long.parseLong(Long.java:419)
at
org.apache.lucene.index.SegmentInfos.generationFromSegmentsFileName(SegmentInfos.java:
197)
at
org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(SegmentInfos.java:
132)
at org.apache.lucene.index.SegmentInfos
$FindSegmentsFile.run(SegmentInfos.java:588)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:
69)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:476)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:403)
at
org.apache.solr.core.StandardIndexReaderFactory.newReader(StandardIndexReaderFactory.java:
38)
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1057)
... 27 more


It used to try [For input string: "gen"] but I think it now changed as
I tried moving some files. I found just little info about the
segments.gen file.

Any possible solution? Any more details about the segments.gen file
that might help solve the problem appreciated. If there is a procedure
to redo the whole indexing from scratch.

Thanks

Mat Brown

unread,
Jun 25, 2010, 10:01:16 AM6/25/10
to ruby-s...@googlegroups.com
Hi,

You'll need to delete your entire index -- if you're using
Sunspot::Rails, it's solr/data/development (delete that directory).
Then you can use rake sunspot:solr:reindex to regenerate your index.

Keeping your index under version control is a Bad Idea -- just as
keeping your MySQL data files would be. I strongly suggest adding the
solr/data directory to your .gitignore file.

Mat

> --
> You received this message because you are subscribed to the Google Groups "Sunspot" group.
> To post to this group, send email to ruby-s...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-sunspot...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-sunspot?hl=en.
>
>

Bashar

unread,
Jun 25, 2010, 10:44:46 AM6/25/10
to Sunspot
Thanks a million! working now.

Yeah not excluding it from git was a silly mistake, followed by
another of merging it. Thanks for the tip.
Reply all
Reply to author
Forward
0 new messages