Skip to content

[Elastic Agent] Panic error while enrolling an agent with a revoked token #19976

@mdelapenya

Description

@mdelapenya

Runtime metadata

  • Version: Latest 8.0.0-SNAPSHOT
  • Operating System: Centos 7 Docker

Steps to Reproduce:

  1. setup Fleet
  2. Create a token
  3. Start a Centos 7 docker container in the same network as Kibana, ES and package-registry
  4. Install latests SNAPSHOT for the agent in the container (https://www.elastic.co/guide/en/ingest-management/current/elastic-agent-installation.html)
  5. Use the already created token to enroll the agent, using the insecure flag, as Kibana runs on HTTP
  6. Revoke the token in Kibana
  7. Destroy the centos7 service
  8. Start a Centos 7 docker container in the same network as Kibana, ES and package-registry
  9. Install latests SNAPSHOT for the agent in the container (https://www.elastic.co/guide/en/ingest-management/current/elastic-agent-installation.html)
  10. Use the already created token to enroll the agent, using the insecure flag, as Kibana runs on HTTP

Expected behavior

The agent is not enrolled with no panic errors on agent side

Actual behavior

The agent is not enrolled but panic errors are thrown on agent side. See the following stacktrace:

The Elastic Agent is currently in BETA and should not be used in production
2020-07-16T06:33:30.445Z        DEBUG   kibana/client.go:170    Request method: POST, path: /api/ingest_manager/fleet/agents/enroll
panic: runtime error: comparing uncomparable type errors.agentError

goroutine 1 [running]:
github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/cmd.enroll(0xc00031ade0, 0xc000338c80, 0xc00031ae10, 0xc000275180, 0x2, 0x4, 0xcaff9d, 0x4)
        /go/src/github.com/elastic/beats/x-pack/elastic-agent/pkg/agent/cmd/enroll.go:125 +0xac7
github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/cmd.newEnrollCommandWithArgs.func1(0xc000338c80, 0xc000275180, 0x2, 0x4)
        /go/src/github.com/elastic/beats/x-pack/elastic-agent/pkg/agent/cmd/enroll.go:36 +0x6d
github.com/spf13/cobra.(*Command).execute(0xc000338c80, 0xc0002750c0, 0x4, 0x4, 0xc000338c80, 0xc0002750c0)
        /go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xc000338500, 0x6, 0x6, 0xc00031ade0)
        /go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
main.main()
        /go/src/github.com/elastic/beats/x-pack/elastic-agent/main.go:20 +0x138

Related issues

Metadata

Metadata

Assignees

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