[8.x] Fix order of operations in instructions. (#195503)#195524
Merged
kibanamachine merged 1 commit intoelastic:8.xfrom Oct 9, 2024
Merged
[8.x] Fix order of operations in instructions. (#195503)#195524kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine merged 1 commit intoelastic:8.xfrom
Conversation
## Summary
The enroll command must be executed after the elastic-agent is running.
This updates the instructions so that users are told to enable and start
the agent before running the `enroll` command to ensure the socket file
is created and available.
This fixes issues with errors like this:
```
{"log.level":"info","@timestamp":"2024-10-08T20:47:06.857Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff","file.name":"cmd/enroll_cmd.go","file.line":518},"message":"Starting enrollment to URL: https://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-10-08T20:47:08.681Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff","file.name":"cmd/enroll_cmd.go","file.line":481},"message":"Restarting agent daemon, attempt 0","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2024-10-08T20:47:08.683Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff","file.name":"cmd/enroll_cmd.go","file.line":495},"message":"Restart attempt 0 failed: 'rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial unix /usr/share/elastic-agent/elastic-agent.sock: connect: no such file or directory\"'. Waiting for 2s","ecs.version":"1.6.0"}
```
### Checklist
N/A
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
(cherry picked from commit 13c2c76)
1 task
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
Contributor
rhass
added a commit
that referenced
this pull request
Oct 9, 2024
# Backport This will backport the following commits from `main` to `8.15`: - [Fix order of operations in instructions. (#195503)](#195503) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ryan Hass","email":"rhass@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-09T00:01:48Z","message":"Fix order of operations in instructions. (#195503)\n\n## Summary\r\n\r\nThe enroll command must be executed after the elastic-agent is running.\r\nThis updates the instructions so that users are told to enable and start\r\nthe agent before running the `enroll` command to ensure the socket file\r\nis created and available.\r\n\r\nThis fixes issues with errors like this:\r\n\r\n```\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:06.857Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":518},\"message\":\"Starting enrollment to URL: https://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:08.681Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":481},\"message\":\"Restarting agent daemon, attempt 0\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"error\",\"@timestamp\":\"2024-10-08T20:47:08.683Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":495},\"message\":\"Restart attempt 0 failed: 'rpc error: code = Unavailable desc = connection error: desc = \\\"transport: Error while dialing: dial unix /usr/share/elastic-agent/elastic-agent.sock: connect: no such file or directory\\\"'. Waiting for 2s\",\"ecs.version\":\"1.6.0\"}\r\n```\r\n\r\n### Checklist\r\n\r\nN/A\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"13c2c7663546da0f6b34e5dd85932ebc74ecafa7","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-major","v8.16.0"],"number":195503,"url":"https://github.com/elastic/kibana/pull/195503","mergeCommit":{"message":"Fix order of operations in instructions. (#195503)\n\n## Summary\r\n\r\nThe enroll command must be executed after the elastic-agent is running.\r\nThis updates the instructions so that users are told to enable and start\r\nthe agent before running the `enroll` command to ensure the socket file\r\nis created and available.\r\n\r\nThis fixes issues with errors like this:\r\n\r\n```\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:06.857Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":518},\"message\":\"Starting enrollment to URL: https://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:08.681Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":481},\"message\":\"Restarting agent daemon, attempt 0\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"error\",\"@timestamp\":\"2024-10-08T20:47:08.683Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":495},\"message\":\"Restart attempt 0 failed: 'rpc error: code = Unavailable desc = connection error: desc = \\\"transport: Error while dialing: dial unix /usr/share/elastic-agent/elastic-agent.sock: connect: no such file or directory\\\"'. Waiting for 2s\",\"ecs.version\":\"1.6.0\"}\r\n```\r\n\r\n### Checklist\r\n\r\nN/A\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"13c2c7663546da0f6b34e5dd85932ebc74ecafa7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195503","number":195503,"mergeCommit":{"message":"Fix order of operations in instructions. (#195503)\n\n## Summary\r\n\r\nThe enroll command must be executed after the elastic-agent is running.\r\nThis updates the instructions so that users are told to enable and start\r\nthe agent before running the `enroll` command to ensure the socket file\r\nis created and available.\r\n\r\nThis fixes issues with errors like this:\r\n\r\n```\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:06.857Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":518},\"message\":\"Starting enrollment to URL: https://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:08.681Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":481},\"message\":\"Restarting agent daemon, attempt 0\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"error\",\"@timestamp\":\"2024-10-08T20:47:08.683Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":495},\"message\":\"Restart attempt 0 failed: 'rpc error: code = Unavailable desc = connection error: desc = \\\"transport: Error while dialing: dial unix /usr/share/elastic-agent/elastic-agent.sock: connect: no such file or directory\\\"'. Waiting for 2s\",\"ecs.version\":\"1.6.0\"}\r\n```\r\n\r\n### Checklist\r\n\r\nN/A\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"13c2c7663546da0f6b34e5dd85932ebc74ecafa7"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/195524","number":195524,"state":"MERGED","mergeCommit":{"sha":"d3c0b006da9d607904f9e395849b99cf11a4413f","message":"[8.x] Fix order of operations in instructions. (#195503) (#195524)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.x`:\n- [Fix order of operations in instructions.\n(#195503)](https://github.com/elastic/kibana/pull/195503)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Ryan\nHass\",\"email\":\"rhass@users.noreply.github.com\"},\"sourceCommit\":{\"committedDate\":\"2024-10-09T00:01:48Z\",\"message\":\"Fix\norder of operations in instructions. (#195503)\\n\\n## Summary\\r\\n\\r\\nThe\nenroll command must be executed after the elastic-agent is\nrunning.\\r\\nThis updates the instructions so that users are told to\nenable and start\\r\\nthe agent before running the `enroll` command to\nensure the socket file\\r\\nis created and available.\\r\\n\\r\\nThis fixes\nissues with errors like\nthis:\\r\\n\\r\\n```\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:06.857Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":518},\\\"message\\\":\\\"Starting\nenrollment to URL:\nhttps://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.681Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":481},\\\"message\\\":\\\"Restarting\nagent daemon, attempt\n0\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"error\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.683Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":495},\\\"message\\\":\\\"Restart\nattempt 0 failed: 'rpc error: code = Unavailable desc = connection\nerror: desc = \\\\\\\"transport: Error while dialing: dial unix\n/usr/share/elastic-agent/elastic-agent.sock: connect: no such file or\ndirectory\\\\\\\"'. Waiting for\n2s\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n```\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\nN/A\\r\\n\\r\\n### For maintainers\\r\\n\\r\\n- [ ] This was\nchecked for breaking API changes and was\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"13c2c7663546da0f6b34e5dd85932ebc74ecafa7\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.16.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"Team:Fleet\",\"v9.0.0\",\"backport:prev-major\"],\"title\":\"Fix\norder of operations in\ninstructions.\",\"number\":195503,\"url\":\"https://github.com/elastic/kibana/pull/195503\",\"mergeCommit\":{\"message\":\"Fix\norder of operations in instructions. (#195503)\\n\\n## Summary\\r\\n\\r\\nThe\nenroll command must be executed after the elastic-agent is\nrunning.\\r\\nThis updates the instructions so that users are told to\nenable and start\\r\\nthe agent before running the `enroll` command to\nensure the socket file\\r\\nis created and available.\\r\\n\\r\\nThis fixes\nissues with errors like\nthis:\\r\\n\\r\\n```\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:06.857Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":518},\\\"message\\\":\\\"Starting\nenrollment to URL:\nhttps://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.681Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":481},\\\"message\\\":\\\"Restarting\nagent daemon, attempt\n0\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"error\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.683Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":495},\\\"message\\\":\\\"Restart\nattempt 0 failed: 'rpc error: code = Unavailable desc = connection\nerror: desc = \\\\\\\"transport: Error while dialing: dial unix\n/usr/share/elastic-agent/elastic-agent.sock: connect: no such file or\ndirectory\\\\\\\"'. Waiting for\n2s\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n```\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\nN/A\\r\\n\\r\\n### For maintainers\\r\\n\\r\\n- [ ] This was\nchecked for breaking API changes and was\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"13c2c7663546da0f6b34e5dd85932ebc74ecafa7\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/195503\",\"number\":195503,\"mergeCommit\":{\"message\":\"Fix\norder of operations in instructions. (#195503)\\n\\n## Summary\\r\\n\\r\\nThe\nenroll command must be executed after the elastic-agent is\nrunning.\\r\\nThis updates the instructions so that users are told to\nenable and start\\r\\nthe agent before running the `enroll` command to\nensure the socket file\\r\\nis created and available.\\r\\n\\r\\nThis fixes\nissues with errors like\nthis:\\r\\n\\r\\n```\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:06.857Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":518},\\\"message\\\":\\\"Starting\nenrollment to URL:\nhttps://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.681Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":481},\\\"message\\\":\\\"Restarting\nagent daemon, attempt\n0\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"error\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.683Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":495},\\\"message\\\":\\\"Restart\nattempt 0 failed: 'rpc error: code = Unavailable desc = connection\nerror: desc = \\\\\\\"transport: Error while dialing: dial unix\n/usr/share/elastic-agent/elastic-agent.sock: connect: no such file or\ndirectory\\\\\\\"'. Waiting for\n2s\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n```\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\nN/A\\r\\n\\r\\n### For maintainers\\r\\n\\r\\n- [ ] This was\nchecked for breaking API changes and was\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"13c2c7663546da0f6b34e5dd85932ebc74ecafa7\"}}]}]\nBACKPORT-->\n\nCo-authored-by: Ryan Hass <rhass@users.noreply.github.com>"}}]}] BACKPORT-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.x:Questions ?
Please refer to the Backport tool documentation