Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9468

HTTP api endpoint /replication does not handle errors propely

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 6.2
    • Fix Version/s: None
    • Component/s: replication (java)
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              do3cc Patrick Gerken
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: