Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ksatter opened this issue May 23, 2023 · 7 comments
Closed

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

ksatter opened this issue May 23, 2023 · 7 comments
Assignees
Labels
~backend Backend-related issue. bug Something isn't working as documented #g-endpoint-ops Endpoint ops product group :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. ~released bug This bug was found in a stable release.
Milestone

Comments

@ksatter
Copy link
Member

ksatter commented May 23, 2023

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": "[...]"
}
@ksatter ksatter added bug Something isn't working as documented :product Product Design department (shows up on 🦒 Drafting board) #g-endpoint-ops Endpoint ops product group labels May 23, 2023
@lukeheath lukeheath added :product Product Design department (shows up on 🦒 Drafting board) and removed :product Product Design department (shows up on 🦒 Drafting board) labels Jun 12, 2023
@zhumo zhumo removed the :product Product Design department (shows up on 🦒 Drafting board) label Jun 27, 2023
@lukeheath lukeheath added the ~released bug This bug was found in a stable release. label Jun 30, 2023
@sharon-fdm sharon-fdm added the ~backend Backend-related issue. label Jul 19, 2023
@lukeheath lukeheath added the :product Product Design department (shows up on 🦒 Drafting board) label Aug 1, 2023
@lukeheath lukeheath assigned zhumo and unassigned zayhanlon Aug 1, 2023
@lukeheath
Copy link
Member

This bug has aged out. Moving back to drafting.

@ireedy ireedy removed the :product Product Design department (shows up on 🦒 Drafting board) label Aug 8, 2023
@ireedy
Copy link
Contributor

ireedy commented Sep 5, 2023

Bug has aged out. Moved back to drafting

@ireedy ireedy assigned sharon-fdm and unassigned sharon-fdm Sep 12, 2023
@ireedy
Copy link
Contributor

ireedy commented Oct 2, 2023

Bug has aged out. Moved back to drafting

@Sampfluger88 Sampfluger88 assigned mikermcneil and unassigned zhumo Oct 11, 2023
@xpkoala xpkoala assigned sharon-fdm and unassigned mikermcneil Oct 18, 2023
@lukeheath
Copy link
Member

Bug has aged out. Moving back to product drafting.

@lukeheath
Copy link
Member

@sharon-fdm This looks like a quick fix, as well. Let's advocate for getting this prioritized into the next release since it's an easy win.

I think the challenge here is that not all 1's are equal (some are 30 minutes, some are 4 hours...)

@sharon-fdm
Copy link
Collaborator

CC @noahtalerman same here.

@getvictor getvictor assigned getvictor and unassigned sharon-fdm Nov 2, 2023
@getvictor getvictor added the :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. label Nov 2, 2023
getvictor added a commit that referenced this issue Nov 6, 2023
Fixes to /fleet/queries/run endpoint:
- now returns 403 for an unauthorized user
- now returns 400 when query_ids or host_ids are not specified

#11446 and #11901

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

API clarifications are in a separate PR
#14956

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
@lukeheath lukeheath added this to the 4.40.0-tentative milestone Nov 7, 2023
@fleet-release
Copy link
Contributor

Error five hundred,
Fixed, now clarity shines,
Smooth queries in cloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
~backend Backend-related issue. bug Something isn't working as documented #g-endpoint-ops Endpoint ops product group :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. ~released bug This bug was found in a stable release.
Development

No branches or pull requests

9 participants