lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Risden (JIRA)" <>
Subject [jira] [Commented] (SOLR-6676) Return 500 if bad json data is posted to Solr?
Date Thu, 29 Sep 2016 21:42:20 GMT


Kevin Risden commented on SOLR-6676:

Looks like this has seen been fixed with a better error message and returns a 400 error code:

# ./bin/solr create -c test

Copying configuration to new core instance directory:

Creating new core 'test' using command:

# ./bin/post -c test example/exampledocs/books.json
/usr/lib/jvm/java-1.8-openjdk/jre/bin/java -classpath /opt/solr/dist/solr-core-6.2.1.jar -Dauto=yes
-Dc=test -Ddata=files org.apache.solr.util.SimplePostTool example/exampledocs/books.json
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/test/update...
Entering auto mode. File endings considered are xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
POSTing file books.json (application/json) to [base]/json/docs
SimplePostTool: WARNING: Solr returned an error #400 (Bad Request) for url: http://localhost:8983/solr/test/update/json/docs
SimplePostTool: WARNING: Response: {"responseHeader":{"status":400,"QTime":36},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],"msg":"Cannot
parse provided JSON: Expected ',' or '}': char=i,position=243 BEFORE='ns\", \"sequence_i\"
: 1, \"genre_s\" : \"fantasy\\\", \"i' AFTER='nStock\" : true, \"price\" : 12.50, '","code":400}}
SimplePostTool: WARNING: IOException while reading response: Server returned
HTTP response code: 400 for URL: http://localhost:8983/solr/test/update/json/docs
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/test/update...
Time spent: 0:00:00.097

> Return 500 if bad json data is posted to Solr?
> ----------------------------------------------
>                 Key: SOLR-6676
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 4.7.2
>            Reporter: liuqibj
> When posting  invalid json data to Solr and we often get 400 response code but some cases
return 500 if bad json data is posted. The call stack looks like this(see below). There are
multiple reasons if Solr return 500 errors.  Is there any way to distinguish whether the 500
errors is due to bad json data or other reasons?
> at org.apache.noggit.JSONParser.err
> at
> at org.apache.noggit.JSONParser.nextEvent
> at org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.processUpdate
> at org.apache.solr.handler.loader.JsonLoader$SingleThreadedJsonLoader.load
> at org.apache.solr.handler.loader.JsonLoader.load

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message