Patrick Gerken created SOLR-9468:
------------------------------------

             Summary: HTTP api endpoint /replication does not handle errors 
propely
                 Key: SOLR-9468
                 URL: https://issues.apache.org/jira/browse/SOLR-9468
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: replication (java)
    Affects Versions: 6.2
            Reporter: Patrick Gerken


When triggering a backup with curl, an error does not generate an error status 
code like 4xx or 5xx, also the status field of the response says ok.

Steps to reproduce.
Take an existing solr, end execute the following command:
curl 
'http://localhost:8983/solr/{core}/replication?command=backup&name=solr-backup&location=/xxxx'

Expected outcome:
Ideally, a http status code starting with 4, but at least a bad status in the 
response text

Actual output:
<lst name="responseHeader"><int name="status">0</int><int 
name="QTime">1</int></lst><str 
name="exception">org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
 Unable to create snapshot directory: /xxx/snapshot.solr-backup</str><str 
name="status">OK</str>


At first I started to grep for the line with status, and then used grep -v 
'Exception'. This would give a return code != 0 and would mean, my backup 
failed. Unfortunately, it will return true if there are other errors so this is 
not a solution.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to