github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docs/source/rest_api/error_codes.rst (about)

     1  ***************
     2  Error Responses
     3  ***************
     4  
     5  When the REST API encounters a problem, or receives notification that the
     6  validator has encountered a problem, it will notify clients with both an
     7  appropriate HTTP status code and a more detailed JSON response.
     8  
     9  
    10  HTTP Status Codes
    11  =================
    12  
    13  .. list-table::
    14     :widths: 4, 16, 60
    15     :header-rows: 1
    16  
    17     * - Code
    18       - Title
    19       - Description
    20     * - 400
    21       - Bad Request
    22       - The request was malformed in some way, and will need to be modified
    23         before resubmitting. The accompanying JSON response will have more
    24         details.
    25     * - 404
    26       - Not Found
    27       - The request was well formed, but the specified identifier did not
    28         correspond to any resource in the validator. Returned by endpoints which
    29         fetch a single resource. Endpoints which return lists of resources will
    30         simply return an empty list.
    31     * - 500
    32       - Internal Server Error
    33       - Something is broken internally in the REST API or the validator. This may
    34         be a bug; if it is reproducible, the bug should be reported.
    35     * - 503
    36       - Service Unavailable
    37       - The REST API is unable to communicate with the validator. It may be down.
    38         You should try your request later.
    39  
    40  
    41  JSON Response
    42  =============
    43  
    44  In the case of an error, rather than a *data* property, the JSON response will
    45  include a single *error* property with three values:
    46  
    47     * *code* (integer) - a machine readable error code
    48     * *title* (string) - a short headline for the error
    49     * *message* (string) - a longer, human-readable description of what went wrong
    50  
    51  .. note::
    52  
    53     While the title and message may change in the future, the error code
    54     will **not** change; it is fixed and will always refer to this particular
    55     problem.
    56  
    57  
    58  Example JSON Response
    59  ---------------------
    60  
    61  .. code-block:: json
    62  
    63     {
    64       "error": {
    65         "code": 30,
    66         "title": "Submitted Batches Invalid",
    67         "message": "The submitted BatchList is invalid. It was poorly formed or has an invalid signature."
    68       }
    69     }
    70  
    71  
    72  Error Codes and Descriptions
    73  ============================
    74  
    75  .. list-table::
    76     :widths: 4, 16, 60
    77     :header-rows: 1
    78  
    79     * - Code
    80       - Title
    81       - Description
    82     * - 10
    83       - Unknown Validator Error
    84       - An unknown error occurred with the validator while processing the
    85         request. This may be a bug; if it is reproducible, the bug should be
    86         reported.
    87     * - 15
    88       - Validator Not Ready
    89       - The validator has no genesis block, and so cannot be queried. Wait for
    90         genesis to be completed and resubmit. If you are running the validator,
    91         ensure it was set up properly.
    92     * - 17
    93       - Validator Timed Out
    94       - The request timed out while waiting for a response from the validator. It
    95         may not be running, or may have encountered an internal error. The
    96         request may not have been processed.
    97     * - 18
    98       - Validator Disconnected
    99       - The validator sent a disconnect signal while processing the response, and
   100         is no longer available. Try your request again later.
   101     * - 20
   102       - Invalid Validator Response
   103       - The validator sent back a response which was not serialized properly
   104         and could not be decoded. There may be a problem with the validator.
   105     * - 21
   106       - Invalid Resource Header
   107       - The validator sent back a resource with a header that could not be
   108         decoded. There may be a problem with the validator, or the data may
   109         have been corrupted.
   110     * - 27
   111       - Unable to Fetch Statuses
   112       - The validator should always return some status for every batch
   113         requested. An unknown error caused statuses to be missing, and should be
   114         reported.
   115     * - 30
   116       - Submitted Batches Invalid
   117       - The submitted BatchList failed initial validation by the validator. It
   118         may have a bad signature or be poorly formed.
   119     * - 31
   120       - Unable to Accept Batches
   121       - The validator cannot currently accept more batches due to a full queue.
   122         Please submit your request again.
   123     * - 34
   124       - No Batches Submitted
   125       - The BatchList Protobuf submitted was empty and contained no batches. All
   126         submissions to the validator must include at least one batch.
   127     * - 35
   128       - Protobuf Not Decodable
   129       - The REST API was unable to decode the submitted Protobuf binary. It is
   130         poorly formed, and has not been submitted to the validator.
   131     * - 42
   132       - Wrong Content Type (submit batches)
   133       - POST requests to submit a BatchList must have a 'Content-Type' header of
   134         'application/octet-stream'.
   135     * - 43
   136       - Wrong Content Type (fetch statuses)
   137       - If using a POST request to fetch batch statuses, the 'Content-Type'
   138         header must be 'application/json'.
   139     * - 46
   140       - Bad Status Request
   141       - The body of the POST request to fetch batch statuses was poorly formed.
   142         It must be a JSON formatted array of string-formatted batch ids, with at
   143         least one id.
   144     * - 50
   145       - Head Not Found
   146       - A 'head' query parameter was used, but the block id specified does not
   147         correspond to any block in the validator.
   148     * - 53
   149       - Invalid Count Query
   150       - The 'count' query parameter must be a positive, non-zero integer.
   151     * - 54
   152       - Invalid Paging Query
   153       - The validator rejected the paging request submitted. One or more of the
   154         'min', 'max', or 'count' query parameters were invalid or out of range.
   155     * - 57
   156       - Invalid Sort Query
   157       - The validator rejected the sort request submitted. Most likely one of
   158         the keys specified was not found in the resources sorted.
   159     * - 60
   160       - Invalid Resource Id
   161       - A submitted block, batch, or transaction id was invalid. All such
   162         resources are identified by 128 character hex-strings.
   163     * - 62
   164       - Invalid State Address
   165       - The state address submitted was invalid. Returned when attempting to
   166         fetch a particular "leaf" from the state tree. When fetching specific
   167         state data, the full 70-character address must be used.
   168     * - 66
   169       - Id Query Invalid or Missing
   170       - If using a GET request to fetch batch statuses, an 'id' query parameter
   171         must be specified, with a comma-separated list of at least one batch id.
   172     * - 70
   173       - Block Not Found
   174       - There is no block with the id specified in the blockchain.
   175     * - 71
   176       - Batch Not Found
   177       - There is no batch with the id specified in the blockchain.
   178     * - 72
   179       - Transaction Not Found
   180       - There is no transaction with the id specified in the blockchain.
   181     * - 75
   182       - State Not Found
   183       - There is no state data at the address specified.
   184     * - 80
   185       - Transaction Receipt Not Found
   186       - There is no transaction receipt for the transaction id specified in the
   187         receipt store.
   188     * - 81
   189       - Wrong Content Type
   190       - Requests for transaction receipts sent as a POST must have a
   191         'Content-Type' header of 'application/json'.
   192     * - 82
   193       - Bad Receipts Request
   194       - Requests for transaction receipts sent as a POST must have a JSON
   195         formatted body with an array of at least one id string.
   196     * - 83
   197       - Id Query Invalid or Missing
   198       - Requests for transaction receipts sent as a GET request must have an 'id'
   199         query parameter with a comma-separated list of at least one transaction
   200         id.
   201  
   202  .. Licensed under Creative Commons Attribution 4.0 International License
   203  .. https://creativecommons.org/licenses/by/4.0/