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

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

Closed
mdelapenya opened this issue Jul 16, 2020 · 3 comments · Fixed by #19980
Closed

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

mdelapenya opened this issue Jul 16, 2020 · 3 comments · Fixed by #19980
Assignees
Labels
bug Ingest Management:beta1 Group issues for ingest management beta1

Comments

@mdelapenya
Copy link
Contributor

mdelapenya commented Jul 16, 2020

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/[email protected]/command.go:766 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xc000338500, 0x6, 0x6, 0xc00031ade0)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:800
main.main()
        /go/src/github.com/elastic/beats/x-pack/elastic-agent/main.go:20 +0x138

Related issues

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@mdelapenya
Copy link
Contributor Author

cc/ @EricDavisX

@michalpristas michalpristas self-assigned this Jul 16, 2020
@michalpristas
Copy link
Contributor

will take a look thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Ingest Management:beta1 Group issues for ingest management beta1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants