Skip to content

Live query API returns 500 error when query_id not included #11901

@ksatter

Description

@ksatter

Fleet version: Fleet 0.0.0-SNAPSHOT-301840a


🧑‍💻  Expected behavior

When sending an API request with missing information in the request body, I would expect to see a 400 error.

💥  Actual behavior

When sending a request to the live query endpoint with an empty array for query_ids, I receive a 500 error.

👣 Reproduction steps

Request URL:

{{host}}/api/{{api_version}}/fleet/queries/run

Request Body:

{
  "query_ids": [  ],
  "host_ids": [ 78, 83 ]
}

Response:

{
  "message": "forbidden",
  "errors": [
    {
      "name": "base",
      "reason": "forbidden"
    }
  ],
  "uuid": "[...]"
}

Metadata

Metadata

Assignees

Labels

#g-endpoint-opsEndpoint ops product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.bugSomething isn't working as documented~backendBackend-related issue.~released bugThis bug was found in a stable release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions