Skip to content

[8.15] Fix order of operations in instructions. (#195503)#195605

Merged
rhass merged 1 commit intoelastic:8.15from
rhass:backport/8.15/pr-195503
Oct 9, 2024
Merged

[8.15] Fix order of operations in instructions. (#195503)#195605
rhass merged 1 commit intoelastic:8.15from
rhass:backport/8.15/pr-195503

Conversation

@rhass
Copy link
Copy Markdown
Contributor

@rhass rhass commented Oct 9, 2024

Backport

This will backport the following commits from main to 8.15:

Questions ?

Please refer to the Backport tool documentation

\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Ryan Hass "}}]}] BACKPORT-->

## 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)

# Conflicts:
#	x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.test.ts
@rhass rhass added the backport This PR is a backport of another PR label Oct 9, 2024
@rhass rhass enabled auto-merge (squash) October 9, 2024 13:55
@botelastic botelastic Bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 9, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@rhass
Copy link
Copy Markdown
Contributor Author

rhass commented Oct 9, 2024

I am not sure how far back we want to backport this... but it's a two year old bug which likely affects several versions of Kibana.

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.8MB 1.8MB +6.0B

@rhass rhass merged commit 37b7ee2 into elastic:8.15 Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants