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: expecting Dict and received *transpiler.Key for '0' #24453

Closed
mtojek opened this issue Mar 9, 2021 · 16 comments
Closed

Elastic Agent: expecting Dict and received *transpiler.Key for '0' #24453

mtojek opened this issue Mar 9, 2021 · 16 comments
Assignees
Labels
bug Team:Elastic-Agent Label for the Agent team v7.13.0

Comments

@mtojek
Copy link
Contributor

mtojek commented Mar 9, 2021

Stack version: 7.13.0-SNAPSHOT

While enabling the fleet server in elastic/elastic-package#279 , I encountered the following issue:

2021-03-09T18:37:09.755Z	ERROR	application/fleet_gateway.go:185	failed to dispatch actions, error: fail to generate program configuration: expecting Dict and received *transpiler.Key for '0'
2021-03-09T18:37:09.755Z	WARN	status/reporter.go:233	Elastic Agent status changed to: 'degraded'
2021-03-09T18:37:09.755Z	INFO	status/reporter.go:233	Elastic Agent status changed to: 'online'

Seems that the agent can't pick up any policy?

cc @blakerouse @michalpristas

@mtojek mtojek added the Team:Elastic-Agent Label for the Agent team label Mar 9, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@mtojek
Copy link
Contributor Author

mtojek commented Mar 31, 2021

I didn't see this one for a longer time, not sure if the issue still exists.

@ruflin
Copy link
Collaborator

ruflin commented Mar 31, 2021

@mtojek Did also not see this recently, I suggest to close and reopen if needed?

@mtojek
Copy link
Contributor Author

mtojek commented Mar 31, 2021

SGTM

@ruflin ruflin closed this as completed Mar 31, 2021
@EricDavisX EricDavisX reopened this Apr 28, 2021
@EricDavisX
Copy link
Contributor

I am seeing the exact same error in Ansible automation to deploy our 'demo' test server with the 8.0 snapshot and have confirmed it is using the latest snapshots which are built recently enough, near daily. I"ll add it to my urgent tracking list. I submit it is possibly an intermittent timing bug where the automation is finding a problem as it triggers steps faster than a human could.

@mtojek
Copy link
Contributor Author

mtojek commented Apr 28, 2021

Hint: you can double check if your configuration is correct. I remember we faced this problem while we're hitting Kibana endpoint with enabled fleet-server support.

@ruflin
Copy link
Collaborator

ruflin commented Apr 28, 2021

@EricDavisX Any chance you could share the exact config you are using?

@ph ph added the bug label Apr 28, 2021
@ph
Copy link
Contributor

ph commented Apr 28, 2021

I don't think it's critical bfor 7.13, Agree on this?

@ph ph added the v7.14.0 label Apr 28, 2021
@ruflin
Copy link
Collaborator

ruflin commented Apr 28, 2021

@ph As far as I can see we don't know yet and is what worries me?

@ph
Copy link
Contributor

ph commented Apr 28, 2021

fair, point, if we have the configuration this should be simple to debug.

@EricDavisX
Copy link
Contributor

It's from the 'demo' test server we have available. It is a self-managed 8.0 snapshot instance, where the 'Default Fleet Server policy' is created successfully, which consists of:

id: 6db12c50-a806-11eb-b5a1-a54876e2d326
revision: 2
outputs:
  default:
    type: elasticsearch
    hosts:
      - 'http://bastion.endpoint.elastic.dev:9201'
output_permissions:
  default:
    _fallback:
      cluster:
        - monitor
      indices:
        - names:
            - logs-*
            - metrics-*
            - traces-*
            - .logs-endpoint.diagnostic.collection-*
            - synthetics-*
          privileges:
            - auto_configure
            - create_doc
agent:
  monitoring:
    enabled: true
    use_output: default
    logs: true
    metrics: true
inputs:
  - id: 7a700b2f-8815-4ca6-9ba6-eb6e8f4c7c64
    name: fleet_server-1
    revision: 1
    type: fleet-server
    use_output: default
    meta:
      package:
        name: fleet_server
        version: 0.2.2
    data_stream:
      namespace: default
    server:
      port: 8220
      host: 0.0.0.0
fleet:
  hosts:
    - 'https://ingest-linux-1.endpoint.elastic.dev:8220'
    - 'https://ingest-win-1.endpoint.elastic.dev:8220'

anything wrong with that ^ ? It looks ok to me, except maybe for the 0.0.0.0 for server: hosts: value. I am not yet knowledgeable enough in the architecture to know how that is used.

@michalpristas
Copy link
Contributor

looks ok, when i paste it into a file elastic-agent.yml it works also inspect works, can you also share content of fleet yml if present (PM or redacted here)

@ruflin
Copy link
Collaborator

ruflin commented May 3, 2021

@michalpristas I see our test suite supports test data: https://github.com/elastic/beats/tree/master/x-pack/elastic-agent/pkg/agent/program/testdata Could we add these examples there too?

@mtojek @EricDavisX Do you remember if it was a temporary issue that resolved itself or was presistent?

@michalpristas
Copy link
Contributor

the fact it's coming from fleet_gateway tells us that not configuration from elastic-agent.yml is broken but the one which is being retrieved from server. i will work with eric to obtain that one

@michalpristas
Copy link
Contributor

the issue here comes from a spec file

- select_into:
      selectors: [ fleet.server.policy.id ]
      path: inputs.0.policy

  - select_into:
      selectors:
        - fleet.server.host
        - fleet.server.port
        - fleet.server.ssl
      path: inputs.0.server

where in inputs .0.server is not resolved correctly, we do not support indexing here. will provide a fix

@EricDavisX
Copy link
Contributor

I'm not seeing this anymore in my 8.0 automation 'demo' setup, so I'm closing it - nice work Michal, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Team:Elastic-Agent Label for the Agent team v7.13.0
Projects
None yet
Development

No branches or pull requests

7 participants