Skip to content

Error while enrolling unprivileged agent [mac] #4887

@kaanyalti

Description

@kaanyalti

Version: 8.14.0
Operating System: macos sonoma v14.5
Platform: arm64

While working on this issue comparing root and unprivileged elastic agents, I encountered an error with the enroll command when using unprivileged agent.

Steps to Reproduce:

  1. Deploy ESS v8.14.0
  2. Create agent policy with system integration
  3. Install fleet managed agent with the unprivileged flag sudo ./elastic-agent install --unprivileged --url=<fleet url> --enrollment-token=<token>
  4. Unenroll the agent
  5. Enroll the agent sudo elastic-agent enroll --url=<fleet url> --enrollment-token=<token>

You should see an error similar what's shown below

[Error: fail to enroll: acquiring metadata failed: failed to create new agent info: could not get agent info from store: fail to read configuration /Library/Elastic/Agent/fleet.enc for the agent: fail to decode bytes: cipher: message authentication failed
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.14/fleet-troubleshooting.html](<{"log.level":"info","@timestamp":"2024-06-06T22:05:59.706-0700","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":506},"message":"Starting enrollment to URL: https://a8ef7f060207437a961f91ef9c7b3f42.fleet.us-central1.gcp.cloud.es.io:443/","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-06-06T22:05:59.933-0700","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":512},"message":"1st enrollment attempt failed, retrying enrolling to URL: https://a8ef7f060207437a961f91ef9c7b3f42.fleet.us-central1.gcp.cloud.es.io:443/ with exponential backoff (init 1s, max 10s)","ecs.version":"1.6.0"}
Error: fail to enroll: acquiring metadata failed: failed to create new agent info: could not get agent info from store: fail to read configuration /Library/Elastic/Agent/fleet.enc for the agent: fail to decode bytes: cipher: message authentication failed
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.14/fleet-troubleshooting.html>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions