Dispatch endpoint throws 500 on missing required field and uses rpc-formatting
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
When using the API and running a dispatch command with a missing required meta key Nomad returns:
500, rpc error: Dispatch did not provide required meta keys: [SLEEP_TIME]
However, 400 is probably a better return code:
> 400 BAD REQUEST
> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
It would also be better for consumers of the API if the format was JSON rather than a pure rpc error.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the API dispatch endpoint and reproducing a dispatch request with the required SLEEP_TIME meta key omitted. Trace the response handling to determine where the RPC error becomes an HTTP response. Done means the missing-field request returns HTTP 400 with a JSON error response rather than a 500 RPC-formatted error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100