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

Fix application name in API key #1091

Merged
merged 1 commit into from
Jan 17, 2022
Merged

Conversation

mtojek
Copy link
Contributor

@mtojek mtojek commented Jan 17, 2022

This PR fixes issue spotted in: elastic/elastic-package#650

{"log.level":"info","ecs.version":"1.6.0","service.name":"fleet-server","http.request.id":"01FSMA8YRG2G2DDJESQ6ZCVW42","mod":"enroll","fleet.enroll.apikey.id":"wm2kaH4BMg40PYJ8YCOR","error.message":"fail CreateAPIKey: [400 Bad Request] {\"error\":{\"root_cause\":[{\"type\":\"action_request_validation_exception\",\"reason\":\"Validation Failed: 1: An application name prefix must match the pattern ^[a-z][A-Za-z0-9]*$ (found '.fleet');\"}],\"type\":\"action_request_validation_exception\",\"reason\":\"Validation Failed: 1: An application name prefix must match the pattern ^[a-z][A-Za-z0-9]*$ (found '.fleet');\"},\"status\":400}","http.response.status_code":400,"event.duration":306104815,"@timestamp":"2022-01-17T15:25:17.251Z","message":"fail enroll"}
{"log.level":"error","ecs.version":"1.6.0","service.name":"fleet-server","http.request.id":"01FSMA8YRG2G2DDJESQ6ZCVW42","mod":"enroll","fleet.enroll.apikey.id":"wm2kaH4BMg40PYJ8YCOR","error.message":"fail CreateAPIKey: [400 Bad Request] {\"error\":{\"root_cause\":[{\"type\":\"action_request_validation_exception\",\"reason\":\"Validation Failed: 1: An application name prefix must match the pattern ^[a-z][A-Za-z0-9]*$ (found '.fleet');\"}],\"type\":\"action_request_validation_exception\",\"reason\":\"Validation Failed: 1: An application name prefix must match the pattern ^[a-z][A-Za-z0-9]*$ (found '.fleet');\"},\"status\":400}","@timestamp":"2022-01-17T15:25:17.251Z","message":"perform rollback on enrollment failure"}

@mtojek mtojek self-assigned this Jan 17, 2022
@mtojek mtojek added backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Jan 17, 2022
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-01-17T16:57:43.078+0000

  • Duration: 11 min 51 sec

  • Commit: aa949ec

Test stats 🧪

Test Results
Failed 0
Passed 229
Skipped 0
Total 229

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@michel-laterman michel-laterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing this

@mtojek mtojek merged commit 9202b61 into elastic:master Jan 17, 2022
@ruflin
Copy link
Collaborator

ruflin commented Jan 19, 2022

I wonder if we need to get this also into 7.17 as a 7.17 fleet-server could talk to an Elasticsearch 8.0 (x?) instance.

@ph @blakerouse

Copy link
Collaborator

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also wondering if this was catched by our e2e tests? I assume also we should have seen this in the CI with the integration tests but we did not have any PR's open. If not, we should adjust the tests.

@mtojek Thanks for the PR, I expect the control plane team to follow up from here. @jlind23

@@ -22,7 +22,7 @@ const testFleetRoles = `
"fleet-apikey-access": {
"cluster": [],
"applications": [{
"application": ".fleet",
"application": "fleet",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a copy here instead of using the one from the actual implementation? Using a copy means we could have a passing test but the actual implementation does not work.

@jlind23
Copy link
Contributor

jlind23 commented Jan 20, 2022

@ruflin it seems to be the same issue mentioned there elastic/beats#29811

And it's causing this e2e-tests to fail.

cc @ph

@mtojek
Copy link
Contributor Author

mtojek commented Jan 20, 2022

I can confirm on our side that this fix solved the issue for elastic-package (fresh Docker images baked). The PR was green, didn't see any failing tests.

@jlind23
Copy link
Contributor

jlind23 commented Jan 20, 2022

@mtojek i think that @ruflin question was, were they any failing tests before that had been triggered by this issue?

@blakerouse
Copy link
Contributor

@ruflin Yes this needs to go to 7.17. Fleet Server needs to be able to communicate with an 8.0 elasticsearch.

@blakerouse blakerouse added the backport-7.17 Automated backport to the 7.17 branch with mergify label Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants