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

ilariapet commented on SOLR-16698:
----------------------------------

With the 'Sease' team, I investigated this part trying to handle the typos and 
get a clearer definition of the error. 

By examining the *_Rest_* part, it appears that when attempting to insert 
payloads for a +nonexistent ManagedResource+ (either due to a typo or because 
it has not yet been configured), the *doPut* method in 
_org/apache/solr/rest/RestManager.java_ (only responsible for creating a new 
ManagedResource in the RestManager) is used instead of the *doPut* method in 
_org/apache/solr/rest/ManagedResource.java_ (which is responsible for handling 
the insertion of request payloads).

The approach of modifying the *doPut* method in _RestManager.java_ by 
reconfiguring the conditional statement and error message has been considered 
but we are not sure if anything else ends up here that shouldn't and it would 
not be super clear what happens and the reasons when reading the code.

Therefore we came to the conclusion that the reported issue is too extensive, 
as it also includes other classes, conditions, etc., and should be treated more 
broadly, i.e. +should be addressed the whole problem of malformed URLs+ (not 
only the case of feature-store and model-store).

> Unclear error message due to a typo
> -----------------------------------
>
>                 Key: SOLR-16698
>                 URL: https://issues.apache.org/jira/browse/SOLR-16698
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - LTR
>    Affects Versions: 9.1.1
>            Reporter: ilariapet
>            Priority: Minor
>
> If we execute a PUT request with a typo in the "feature-store" endpoint (we 
> write feature*s*-store with an additional {*}s{*}), we receive an unclear 
> error message:
> {code:java}
> curl -XPUT "http://localhost:8983/solr/books/schema/features-store"; 
> --data-binary "@features.json" -H "Content-type:application/json" { 
> "responseHeader":{ "status":400, "QTime":9}, "error":{ "metadata":[ 
> "error-class","org.apache.solr.common.SolrException", 
> "root-error-class","org.apache.solr.common.SolrException"], "msg":"Expected 
> Map to create a new ManagedResource but received a java.util.ArrayList", 
> "code":400}, "error":{ "metadata":[ 
> "error-class","org.apache.solr.common.SolrException", 
> "root-error-class","org.apache.solr.common.SolrException"], "msg":"Expected 
> Map to create a new ManagedResource but received a java.util.ArrayList", 
> "code":400}}{code}
> The same happens with a typo in the "model-store" (we write model*s*-store 
> with an additional {*}s{*}):
> {code:java}
> curl -XPUT "http://localhost:8983/solr/books/schema/models-store"; 
> --data-binary "@model.json" -H "Content-type:application/json" { 
> "responseHeader":{ "status":500, "QTime":1}, "error":{ "msg":"class 
> org.apache.solr.ltr.model.LinearModel", 
> "trace":"java.lang.ClassCastException: class 
> org.apache.solr.ltr.model.LinearModel\n\tat 
> java.base/java.lang.Class.asSubclass(Class.java:3924)\n\tat 
> org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:533)\n\tat
>  ... java.base/java.lang.Thread.run(Thread.java:833)\n", "code":500}{code}
> These error messages could be improved with a clearer definition of the error.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to