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

Hard to understand error message when an agent option is in the wrong place #24038

Open
zwass opened this issue Nov 21, 2024 · 7 comments
Open
Assignees
Labels
~agent Related to Fleet's osquery runtime and agent autoupdater (Orbit) bug Something isn't working as documented #g-orchestration Orchestration 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

@zwass
Copy link
Member

zwass commented Nov 21, 2024

Fleet version: 4.59.0


💥  Actual behavior

Can't set logger_plugin in agent options. Error: "Couldn't update 💻🐣 Workstations (canary) team agent options:unsupported key provided: "logger_plugin"
If you're not using the latest osquery, use the fleetctl apply --force command to override validation."

This is a valid flag for osquery. Possibly it's intentionally blocked because typically we want it configured to tls? The error message isn't making that clear.

🧑‍💻  Steps to reproduce

  1. Try to add logger_plugin: tls under options: on the agent options page.
  2. Save and see the error

🕯️ More info (optional)

@noahtalerman: I'm working on improvements to the Agent options reference docs is here:

🛠️ To fix

Update the error message so that it's easy to understand when a configuration option is not supported v. not in the right place (options or command_line_flags).

  • Unsupported flag: (no change)
Error: "Couldn't update 💻🐣 Workstations (canary) team agent options:unsupported key provided: "foo"
If you're not using the latest osquery, use the fleetctl apply --force command to override validation."
  • Flag not in the right spot (should be command_line_flags):
Error: "Couldn't update 💻🐣 Workstations (canary) team agent options: "logger_plugin" key should be part of the "command_line_flags" object.
@zwass zwass added bug Something isn't working as documented :reproduce Involves documenting reproduction steps in the issue :incoming New issue in triage process. labels Nov 21, 2024
@sharon-fdm sharon-fdm added :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. #g-endpoint-ops Endpoint ops product group labels Nov 22, 2024
@lukeheath lukeheath added ~released bug This bug was found in a stable release. and removed :reproduce Involves documenting reproduction steps in the issue labels Nov 22, 2024
@sharon-fdm
Copy link
Collaborator

@noahtalerman , this is the expected behaviour. the logger_plugin can only be set when starting osquery.
The fix should be explaining this in the error.

@sharon-fdm sharon-fdm added the ~agent Related to Fleet's osquery runtime and agent autoupdater (Orbit) label Nov 27, 2024
@lucasmrod
Copy link
Member

logger_plugin can only be set during osquery startup (as a cli flag) so you can set it in command_line_flags:
Screenshot 2024-11-27 at 4 43 21 PM

We could improve the error to explain that the cli flag should be set in command_line_flags instead.

@lucasmrod lucasmrod added :product Product Design department (shows up on 🦢 Drafting board) and removed :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. labels Nov 27, 2024
@noahtalerman
Copy link
Member

Noah: I'm confused...in Fleet's agent options docs we link out to osquery docs for all available options. logger_plugin is in the osquery docs. Also the example error message in the Fleet docs is confusing:

Screenshot 2024-12-04 at 12 09 13 PM

@lucasmrod I scheduled some time tomorrow for us to chat about the above.

@noahtalerman noahtalerman self-assigned this Dec 5, 2024
@noahtalerman noahtalerman added :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. and removed :product Product Design department (shows up on 🦢 Drafting board) labels Dec 18, 2024
@noahtalerman noahtalerman removed their assignment Dec 18, 2024
@noahtalerman noahtalerman changed the title Cannot set logger_plugin on agent options page Hard to understand error message when an agent option is in the wrong place Dec 18, 2024
@noahtalerman
Copy link
Member

🛠️ To fix

Update the error message so that it's easy to understand when a configuration option is not supported v. not in the right place (options or command_line_flags).

  • Unsupported flag: (no change)
Error: "Couldn't update 💻🐣 Workstations (canary) team agent options:unsupported key provided: "foo"
If you're not using the latest osquery, use the fleetctl apply --force command to override validation."
  • Flag not in the right spot (should be command_line_flags):
Error: "Couldn't update 💻🐣 Workstations (canary) team agent options: "logger_plugin" key should be part of the "command_line_flags" object.
  • Flag not in the right spot (should be options):
Error: "Couldn't update 💻🐣 Workstations (canary) team agent options: "audit_allow_config" key should be part of the "options" object.

@lucasmrod and I chatted and we decided to improve the error message.

Sending this bug back to the release board.

@sharon-fdm
Copy link
Collaborator

Hey team! Please add your planning poker estimate with Zenhub @iansltx @lucasmrod @mostlikelee

@lucasmrod
Copy link
Member

@noahtalerman

Regarding the third one:

Flag not in the right spot (should be options):

All flags that can be in options can be defined in command_line_flags so maybe this error should not be covered and we should return a generic error like the first one.

@sharon-fdm sharon-fdm removed the :incoming New issue in triage process. label Dec 19, 2024
@lukeheath lukeheath added the #g-orchestration Orchestration product group label Dec 19, 2024
@noahtalerman
Copy link
Member

Regarding the third one:

Flag not in the right spot (should be options):

All flags that can be in options can be defined in command_line_flags so maybe this error should not be covered and we should return a generic error like the first one.

@lucasmrod oh! I misunderstood. Agreed we don't need this error. I removed it from the "To fix" section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
~agent Related to Fleet's osquery runtime and agent autoupdater (Orbit) bug Something isn't working as documented #g-orchestration Orchestration 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

6 participants