Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After PR#10887, you must clear the Solr index and reload the core (DOCS_AND_FREQS_AND_POSITIONS error) #11139

Open
pdurbin opened this issue Jan 8, 2025 · 0 comments · May be fixed by #11140
Labels
FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) Size: 3 A percentage of a sprint. 2.1 hours.

Comments

@pdurbin
Copy link
Member

pdurbin commented Jan 8, 2025

Now that we have merged #10887 (I'm testing a little past that, as of 3352bb7) datasets are created but not indexed when you KEEP your Solr index and only update your schema.xml file (as opposed to reinstalling Solr) and then try to create a dataset using the JSON below with "coverage.Temporal.StartTime".

The full error is below, which includes "Caused by: java.lang.IllegalArgumentException: cannot change field "coverage.Temporal.StartTime" from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS".

Googling for DOCS_AND_FREQS_AND_POSITIONS led me to https://stackoverflow.com/questions/57821414/solr-fails-to-index-text-field which suggested reloading the core and clearing the index (for us http://localhost:8080/api/admin/index/clear clears it), but it simply stopping and starting the containers wasn't working for me (I assumed this would reload the core). Here's how I got the problem to go away:

  • clear the index with curl http://localhost:8080/api/admin/index/clear
  • check to make sure the index is empty with curl -s 'http://localhost:8983/solr/collection1/select?rows=1000000&wt=json&indent=true&q=*%3A*' (this is from scripts/search/query)
  • reload the core with curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=collection1'
  • create the dataset with "coverage.Temporal.StartTime" (details below)

The parent collection should have the astrophysics block enabled, like this:

Screenshot 2025-01-08 at 3 35 52 PM

The dataset JSON comes from the test you can execute with mvn test -Dtest=SearchIT#testRangeQueries (this is the test @sekmiller and I noticed was failing for us locally). Here it is: dataset.json

Here's the command I'm using to create the dataset:

curl -H "X-Dataverse-key:$API_TOKEN" -H 'Content-type:application/json' -X POST "$SERVER_URL/api/dataverses/$PARENT/datasets" --upload-file dataset.json

The response indicates that that dataset was created: {"status":"OK","data":{"id":143,"persistentId":"doi:10.5072/FK2/MWIDUZ"}}

When the dataset is indexed properly, it should look like this:

Screenshot 2025-01-08 at 3 06 00 PM

Here's the detailed error when indexing is failing:

dev_solr> 2025-01-08 17:01:52.810 INFO  (qtp1415289182-33) [c: s: r: x:collection1 t:null-484] o.a.s.c.S.Request webapp=/solr path=/select params={q=*&fq=parentId:143&fq=dvObjectType:files&rows=2147483647&wt=javabin&version=2} hits=0 status=0 QTime=0
dev_solr> 2025-01-08 17:01:52.811 INFO  (qtp1415289182-27) [c: s: r: x:collection1 t:null-485] o.a.s.c.S.Request webapp=/solr path=/select params={q=*&fq=parentId:143&fq=dvObjectType:files&rows=2147483647&wt=javabin&version=2} hits=0 status=0 QTime=0
dev_solr> 2025-01-08 17:01:52.821 INFO  (qtp1415289182-68) [c: s: r: x:collection1 t:null-486] o.a.s.u.p.LogUpdateProcessorFactory webapp=/solr path=/update params={wt=javabin&version=2}{} 0 1
dev_solr> 2025-01-08 17:01:52.821 ERROR (qtp1415289182-68) [c: s: r: x:collection1 t:null-486] o.a.s.h.RequestHandlerBase Client exception => org.apache.solr.common.SolrException: Exception writing document id dataset_143_draft to the index; possible analysis error: cannot change field "coverage.Temporal.StartTime" from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS
dev_solr> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:329)
dev_solr> org.apache.solr.common.SolrException: Exception writing document id dataset_143_draft to the index; possible analysis error: cannot change field "coverage.Temporal.StartTime" from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS
dev_solr> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:329) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.RunUpdateProcessorFactory$RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:76) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:54) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.DistributedUpdateProcessor.doLocalAdd(DistributedUpdateProcessor.java:268) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.DistributedUpdateProcessor.doVersionAdd(DistributedUpdateProcessor.java:544) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.DistributedUpdateProcessor.lambda$versionAdd$0(DistributedUpdateProcessor.java:356) ~[?:?]
dev_solr> 	at org.apache.solr.update.VersionBucket.runWithLock(VersionBucket.java:51) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.DistributedUpdateProcessor.versionAdd(DistributedUpdateProcessor.java:353) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.DistributedUpdateProcessor.processAdd(DistributedUpdateProcessor.java:234) ~[?:?]
dev_solr> 	at org.apache.solr.update.processor.LogUpdateProcessorFactory$LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:111) ~[?:?]
dev_solr> 	at org.apache.solr.handler.loader.JavabinLoader$1.update(JavabinLoader.java:123) ~[?:?]
dev_solr> 	at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$StreamingCodec.readOuterMostDocIterator(JavaBinUpdateRequestCodec.java:342) ~[?:?]
dev_solr> 	at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$StreamingCodec.readIterator(JavaBinUpdateRequestCodec.java:286) ~[?:?]
dev_solr> 	at org.apache.solr.common.util.JavaBinCodec.readObject(JavaBinCodec.java:340) ~[?:?]
dev_solr> 	at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:285) ~[?:?]
dev_solr> 	at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$StreamingCodec.readNamedList(JavaBinUpdateRequestCodec.java:236) ~[?:?]
dev_solr> 	at org.apache.solr.common.util.JavaBinCodec.readObject(JavaBinCodec.java:305) ~[?:?]
dev_solr> 	at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:285) ~[?:?]
dev_solr> 	at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:194) ~[?:?]
dev_solr> 	at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec.unmarshal(JavaBinUpdateRequestCodec.java:126) ~[?:?]
dev_solr> 	at org.apache.solr.handler.loader.JavabinLoader.parseAndLoadDocs(JavabinLoader.java:135) ~[?:?]
dev_solr> 	at org.apache.solr.handler.loader.JavabinLoader.load(JavabinLoader.java:74) ~[?:?]
dev_solr> 	at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:102) ~[?:?]
dev_solr> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:100) ~[?:?]
dev_solr> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:226) ~[?:?]
dev_solr> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2908) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.HttpSolrCall.executeCoreRequest(HttpSolrCall.java:875) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:561) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:262) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:219) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:246) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:215) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213) ~[?:?]
dev_solr> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195) ~[?:?]
dev_solr> 	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210) ~[jetty-servlet-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527) ~[jetty-servlet-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:598) ~[jetty-security-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1580) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484) ~[jetty-servlet-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1553) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:228) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:141) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:301) ~[jetty-rewrite-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:822) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.Server.handle(Server.java:563) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287) ~[jetty-server-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314) ~[jetty-io-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100) ~[jetty-io-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53) ~[jetty-io-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149) ~[jetty-util-10.0.19.jar:10.0.19]
dev_solr> 	at java.base/java.lang.Thread.run(Unknown Source) [?:?]
dev_solr> Caused by: java.lang.IllegalArgumentException: cannot change field "coverage.Temporal.StartTime" from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS
dev_solr> 	at org.apache.lucene.index.FieldInfo.verifySameIndexOptions(FieldInfo.java:259) ~[?:?]
dev_solr> 	at org.apache.lucene.index.FieldInfos$FieldNumbers.verifySameSchema(FieldInfos.java:471) ~[?:?]
dev_solr> 	at org.apache.lucene.index.FieldInfos$FieldNumbers.addOrGet(FieldInfos.java:407) ~[?:?]
dev_solr> 	at org.apache.lucene.index.FieldInfos$Builder.add(FieldInfos.java:786) ~[?:?]
dev_solr> 	at org.apache.lucene.index.FieldInfos$Builder.add(FieldInfos.java:724) ~[?:?]
dev_solr> 	at org.apache.lucene.index.IndexingChain.initializeFieldInfo(IndexingChain.java:631) ~[?:?]
dev_solr> 	at org.apache.lucene.index.IndexingChain.processDocument(IndexingChain.java:566) ~[?:?]
dev_solr> 	at org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:242) ~[?:?]
dev_solr> 	at org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:432) ~[?:?]
dev_solr> 	at org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1545) ~[?:?]
dev_solr> 	at org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1521) ~[?:?]
dev_solr> 	at org.apache.solr.update.DirectUpdateHandler2.updateDocOrDocValues(DirectUpdateHandler2.java:1062) ~[?:?]
dev_solr> 	at org.apache.solr.update.DirectUpdateHandler2.doNormalUpdate(DirectUpdateHandler2.java:421) ~[?:?]
dev_solr> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc0(DirectUpdateHandler2.java:374) ~[?:?]
dev_solr> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:311) ~[?:?]
dev_solr> 	... 74 more

To close this issue, I'll update the release note in #10887 to explain the extra steps.

@pdurbin pdurbin added Size: 3 A percentage of a sprint. 2.1 hours. FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) labels Jan 8, 2025
@pdurbin pdurbin linked a pull request Jan 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) Size: 3 A percentage of a sprint. 2.1 hours.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant