[ https://issues.apache.org/jira/browse/SOLR-11153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16112779#comment-16112779 ]
Shawn Heisey commented on SOLR-11153: ------------------------------------- I've come up with a different and less invasive way of fixing this. If tests look good, will attach it soon. I also tested the specific problem. I created three cores and put minimal schemas in all of them. The "bar" core had no name, but version="1.6". The baz core had the "default-config" name, but no version. The foo core was missing both. This is what was logged: {noformat} 2017-08-03 13:55:20.583 INFO (coreLoadExecutor-6-thread-2) [ x:baz] o.a.s.s.IndexSchema [baz] Schema name=default-config 2017-08-03 13:55:20.640 WARN (coreLoadExecutor-6-thread-3) [ x:foo] o.a.s.s.IndexSchema [foo] schema has no name, using exampleSchema 2017-08-03 13:55:20.661 WARN (coreLoadExecutor-6-thread-1) [ x:bar] o.a.s.s.IndexSchema [bar] schema has no name, using exampleSchema 2017-08-03 13:55:20.837 INFO (coreLoadExecutor-6-thread-1) [ x:bar] o.a.s.s.IndexSchema Loaded schema exampleSchema/1.6 with uniqueid field id 2017-08-03 13:55:20.842 INFO (coreLoadExecutor-6-thread-3) [ x:foo] o.a.s.s.IndexSchema Loaded schema exampleSchema/1.0 with uniqueid field id 2017-08-03 13:55:20.843 INFO (coreLoadExecutor-6-thread-2) [ x:baz] o.a.s.s.IndexSchema Loaded schema default-config/1.0 with uniqueid field id {noformat} The test suite is running now, it's a little less than ten percent done with no failures yet. > Incomplete schema results in mysterious error > --------------------------------------------- > > Key: SOLR-11153 > URL: https://issues.apache.org/jira/browse/SOLR-11153 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Affects Versions: 4.4, 5.0, 6.0 > Reporter: Shawn Heisey > Assignee: Shawn Heisey > Attachments: SOLR-11153.patch, SOLR-11153.patch, SOLR-11153.patch > > > A user on the mailing list was getting a very arcane error trying to load a > very minimal solrconfig and schema. The error was ultimately caused by NPE > in SchemaXmlWriter.java at line 85. > The actual problem turned out to be a missing "name" attribute from the top > level XML "schema" element in the file. > {code} > <?xml version="1.0" encoding="UTF-8" ?> > <schema version="1.5"> > <fields> > <field name="_id" type="string" indexed="true" stored="true" > required="true"/> > <field name="title" type="string" indexed="true" stored="true" > required="true"/> > </fields> > <uniqueKey>_id</uniqueKey> > <types> > <fieldType name="string" class="solr.StrField" /> > </types> > </schema> > {code} > As written, the code will explode with an NPE if either the name or version > is missing from the schema. Although I can state that the user's minimal > config/schema are not very useful, Solr should not blow up without a useful > error message, and in this case, I think it should have worked, only emitting > a WARN message and assuming a default name. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org