Skip to content

Agents logging constant error: "failed to add secret markers: secret path outputs.OUTPUT_ID.service_token does not exist" #15798

Description

@leandrojmp

Hello,

We noticed recently that agents are constantly reporting the following error:

failed to add secret markers: secret path outputs.OUTPUT_ID.service_token does not exist

Where the OUTPUT_ID is the remote elasticsearch output configured in the Elastic Agent policy to send monitoring logs and metrics to our monitoring cluster.

This does not seems to completely impact the delivery of logs and metrics as we are seeing these logs in the monitoring cluster.

Checking the output settings using the request: GET kbn:/api/fleet/outputs/OUTPUT_ID, we have this response:

{
  "item": {
    "id": "OUTPUT_ID",
    "name": "es-cloud-monitoring",
    "type": "remote_elasticsearch",
    "hosts": [
      "https://ENDPOINT.aws.found.io:443"
    ],
    "is_default": false,
    "is_default_monitoring": true,
    "preset": "balanced",
    "config_yaml": "",
    "secrets": {
      "service_token": {
        "id": "SERVICE_TOKEN_ID"
      }
    },
    "service_token": null,
    "sync_integrations": false,
    "kibana_url": null,
    "sync_uninstalled_integrations": false,
    "write_to_logs_streams": false,
    "kibana_api_key": null,
    "ssl": {
      "certificate": "",
      "certificate_authorities": []
    }
  }
}

We can see that the field service_token is null, but the field secrets.service_token is populated.

The configuration of the output was done following the instructions in the Fleet UI.

It seems that this issue was introduced between 8.19.2 and 9.4.4, I had an agent on 8.19.2 that was not reporting this error and as soon as I upgrade it to 9.4.4 it started reporting those messages.

On version 8.19.2:
Image

After upgrade to version 9.4.4:
Image

The integrations that I have in the policies that are sending data to the monitoring cluster are:

  • Elastic Agent
  • System (with only the Collect metrics from System instances option enabled)

To replicate:

I think this can be replicated with the followint steps:

  • Create 2 cloud deployments, one will be used for monitoring.
  • Add a remote elasticsearch output on the main deployment.
  • Create a policy to send metrics and elastic agent logs to the monitoring cluster.
  • Add an agent on version 9.4.4 to this policy.
  • Validate the error logs on the monitoring cluster.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions