You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shawn Heisey (JIRA)" <ji...@apache.org> on 2017/08/02 14:15:01 UTC

[jira] [Commented] (SOLR-11153) Incomplete schema results in mysterious error

    [ https://issues.apache.org/jira/browse/SOLR-11153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16110978#comment-16110978 ] 

Shawn Heisey commented on SOLR-11153:
-------------------------------------

My bias is to stick with 1.0 so we don't have to keep updating it as new versions come out.  If somebody deploys an incomplete schema that's missing the version, the patch would give them a warning in their log, so in theory that should be a clue that they need to configure something.


> 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
>
>
> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org