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: failed: could not decode the response, raw response: no matching action #24467

Closed
mtojek opened this issue Mar 10, 2021 · 14 comments
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@mtojek
Copy link
Contributor

mtojek commented Mar 10, 2021

I'm trying to enable the Fleet Server in elastic/elastic-package#279 (7.13.0-SNAPSHOT):

I wanted to assign a new policy clicked out with Kibana:

  • fleet_server
  • system

The agent can't pick it up:

2021-03-10T10:27:41.360Z	ERROR	application/fleet_gateway.go:185	failed to dispatch actions, error: acknowledge 20 actions '[action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 210cb410-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE action_id: 32ef4170-818b-11eb-b053-ad3176422d75, type: POLICY_CHANGE]' for elastic-agent '98c3677f-5380-4ea1-8e10-d2541c86289a' failed: could not decode the response, raw response: no matching action

2021-03-10T10:27:41.360Z	WARN	status/reporter.go:233	Elastic Agent status changed to: 'degraded'
2021-03-10T10:27:41.360Z	INFO	status/reporter.go:233	Elastic Agent status changed to: 'online'

... although the UI reports that it's healthy.

Zrzut ekranu 2021-03-10 o 11 30 07

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

Pinging @elastic/agent (Team:Agent)

@ruflin
Copy link
Member

ruflin commented Mar 10, 2021

What you mean by assign a new policy? Do you have 2 policies and you tried to assign a different policy to the Elastic Agent with the fleet-server?

@mtojek
Copy link
Contributor Author

mtojek commented Mar 10, 2021

I think there are multiple ways to see this effect, e.g. I tried to add Apache integration to the "Default Fleet Server policy".

@blakerouse
Copy link
Contributor

Changing an Agent to a different policy is something still being worked on #24447. As for adding a new integration to the Fleet Server policy, that part should work.

I assume the Agent that is hitting this issue is also the one running the Fleet Server?

@mtojek
Copy link
Contributor Author

mtojek commented Mar 10, 2021

Yes, the standard setup with embedded Fleet Server: https://github.com/elastic/elastic-package/pull/279/files

@ruflin
Copy link
Member

ruflin commented Mar 16, 2021

I tried this out. I used elastic/elastic-package#279 to setup the stack, then selected the fleet-server policy and added system integration with only metrics enabled. The I get system metrics reported for the docker-fleet-agent. I think the status reporting on if a policy was fully deployed to fleet-server is not fully working yet (@nchaulet ) but the rollout happens.

Can you check if you see data coming in?

@nchaulet nchaulet assigned nchaulet and unassigned nchaulet Mar 16, 2021
@nchaulet
Copy link
Member

nchaulet commented Mar 16, 2021

@mtojek I tested this locally and you need to remove the FLEET_URL and KIBANA_HOST from your agent docker config also you need to add the fleet server url in the kibana config xpack.fleet.agents.kibana.host: "http://127.0.0.1:8220" otherwise the agent is still talking to Kibana and it cause some issues

Let me know if it's work.

@blakerouse @hbharding During the onboarding and the setup of fleet server as fleet server is an elastic agent. I think we need to have the fleet server url configured before enrolling fleet server

@mtojek
Copy link
Contributor Author

mtojek commented Mar 16, 2021

Thanks, that's something we didn't change before (port 8220). Out of curiosity - why the agent supporting fleet server doesn't ignore legacy environment variables if we use FLEET_SERVER_ENABLE=1? It should be sufficient to mark which mode the user wants to use.

I understand that due to above inconvenience, we won't be able to use same compose definitions for 7.11, 7.12 as environment variables exclude each other.

What is the minimum environment set in our case:

Agent's env:

    environment:
    - "FLEET_ENROLL=1"
    - "FLEET_ENROLL_INSECURE=1"
    - "FLEET_SERVER_INSECURE_HTTP=1"
    - "FLEET_INSECURE=1"
    - "FLEET_SERVER_ENABLE=1"
    - "FLEET_SETUP=1"

Kibana's config:

server.name: kibana
server.host: "0.0.0.0"

elasticsearch.hosts: [ "http://elasticsearch:9200" ]
elasticsearch.username: elastic
elasticsearch.password: changeme
xpack.monitoring.ui.container.elasticsearch.enabled: true

xpack.fleet.enabled: true
xpack.fleet.registryUrl: "http://package-registry:8080"
xpack.fleet.agents.enabled: true
xpack.fleet.agents.elasticsearch.host: "http://elasticsearch:9200"
xpack.fleet.agents.fleetServerEnabled: true
xpack.fleet.agents.kibana.host: "http://localhost:8220"
xpack.fleet.agents.tlsCheckDisabled: true
xpack.encryptedSavedObjects.encryptionKey: "12345678901234567890123456789012"

@mtojek
Copy link
Contributor Author

mtojek commented Mar 16, 2021

Ok, with the above config I managed to connect to the Fleet Server (port 8220), although xpack.fleet.agents.kibana.host is really misleading (it's not Kibana but fleet server). Thank you for support, @nchaulet .

I think the question I posted above is still valid: what is the minimum set of vars for 7.13.0?

I'm hitting now that issue: #24453 , so I assume it's the next level?

I will leave this issue open to discuss the user experience of fleet configuration.

@nchaulet
Copy link
Member

Yes the kibana.host is misleading we are in the process to have a new config variables for Kibana and the policy this will need to be updated when this land elastic/kibana#94364

@simitt
Copy link
Contributor

simitt commented Apr 14, 2021

FWIW I am seeing a similar error on latest 7.13.0-SNAPSHOTs. Started a fresh ES + Kibana container and started Elastic Agent with

docker run --name elastic-agent-local -it \
  --env KIBANA_FLEET_SETUP=1  \
  --env FLEET_SERVER_ENABLE=1 \
  --env ELASTICSEARCH_HOST="http://elasticsearch:9200" \
  --env ELASTICSEARCH_USERNAME=admin \
  --env ELASTICSEARCH_PASSWORD="password" \
  --env FLEET_ENROLL=1  \
  --env FLEET_INSECURE=1 \
  --env KIBANA_FLEET_HOST="http://kibana:5601" \
  --env KIBANA_FLEET_PASSWORD="changeme" \
  --env KIBANA_FLEET_USERNAME="password"  \
  --network apm-integration-testing \
  -p 8200:8200 --network-alias elastic-agent  --rm docker.elastic.co/beats/elastic-agent:7.13.0-SNAPSHOT

seeing this error:

2021-04-14T06:20:10.295Z	ERROR	fleet/fleet_gateway.go:203	Could not communicate with Checking API will retry, error: could not decode the response, raw response:

@simitt
Copy link
Contributor

simitt commented Apr 14, 2021

Just realized, the above mentioned error is covered in https://github.com/elastic/kibana/issues/96779.

@mtojek
Copy link
Contributor Author

mtojek commented Apr 14, 2021

@simitt I suppose we've a different problem here. I'm pretty sure I reported this one for a different root cause, but all error message look either similar or even the same.

At the moment I don't reckon if this GH issue exists anymore (too many consecutive ones).

@faec
Copy link
Contributor

faec commented Apr 4, 2022

This looks quite stale, closing as it is probably fixed or at least unrecognizable in current versions of agent.

@faec faec closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

7 participants