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

[Fleet]: Unreadable error appears when saving an enrollment token with name exclamation mark (!) #191719

Closed
sukhwindersingh-qasource opened this issue Aug 29, 2024 · 6 comments · Fixed by #191807
Assignees
Labels
bug Fixes for quality problems that affect the customer experience impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. QA:Ready for Testing Code is merged and ready for QA to validate Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@sukhwindersingh-qasource
Copy link

sukhwindersingh-qasource commented Aug 29, 2024

Kibana Build details:

VERSION: 8.16.0-SNAPSHOT
BUILD: 77679
COMMIT: 6b091fe

Preconditions:

  1. 8.16.0-SNAPSHOT Kibana cloud environment should be available.
  2. Policy should be present

Steps to reproduce:

  1. Navigate to the Fleet > enrollment token tab
  2. Create a enrollment token with the name "!"
  3. Observe unreadable error shows up

Expected Result:

  • Error message should be user friendly/readable while saving an enrollment token with name exclamation mark (!)

Whats working:

  • It is working for the Names like - !232, 2@!!@#
  • When the exclamation mark (!) comes in the start or in the middle of the name the error did not appears

Whats Not working:

  • It is not working for the Names like - !, asdas!, @#@@!
  • When the exclamation mark (!) comes in the end of the name it shows the error message

Screen cast:

Enrollment.tokens.-.Fleet.-.Elastic.Mozilla.Firefox.2024-08-29.15-39-00.mp4
@sukhwindersingh-qasource sukhwindersingh-qasource added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Fleet Team label for Observability Data Collection Fleet team labels Aug 29, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@sukhwindersingh-qasource
Copy link
Author

@amolnater-qasource Please review

@amolnater-qasource amolnater-qasource added the bug Fixes for quality problems that affect the customer experience label Aug 29, 2024
@amolnater-qasource
Copy link

Secondary review for this ticket is Done.

@jillguyonnet
Copy link
Contributor

This caused a breach of our Fleet API SLO in serverless. See this Slack thread: https://elastic.slack.com/archives/C04J98D0PQW/p1724925768881849

I would say that at least processing the error more gracefully is definitely important for serverless.
cc @kpollich

@nchaulet
Copy link
Member

@jillguyonnet looks like the issue is when validation the name of the enrollment token here, if we remove that validation as the name contains an uuid too it will solve that issue

https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/services/api_keys/enrollment_api_key.ts#L363

@jillguyonnet
Copy link
Contributor

So this seems to be caused by the use of (some of) query_string special characters (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax) and is linked to the constraint that enrollment token names must be unique.

Since there was a discussion in #155550 about potentially removing this constraint, I've suggested a narrow fix in #191807.

@amolnater-qasource amolnater-qasource added the QA:Ready for Testing Code is merged and ready for QA to validate label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. QA:Ready for Testing Code is merged and ready for QA to validate Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants