# Elastic agent Failed Connect Failed to connect to backoff 401 Unauthorized

**URL:** <https://discuss.elastic.co/t/elastic-agent-failed-connect-failed-to-connect-to-backoff-401-unauthorized/342395>\
**Category:** Elastic Agent\
**Tags:** elastic-stack-monitoring, elastic-stack-security\
**Created:** [September 6, 2023, 6:33am UTC](https://discuss.elastic.co/t/elastic-agent-failed-connect-failed-to-connect-to-backoff-401-unauthorized/342395 "2023-09-06T06:33:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khunakorn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/khunakorn/32/125364_2.png) [@Khunakorn](https://discuss.elastic.co/u/Khunakorn)\
**Post date:** [September 6, 2023, 6:33am UTC](https://discuss.elastic.co/t/elastic-agent-failed-connect-failed-to-connect-to-backoff-401-unauthorized/342395/1 "2023-09-06T06:33:06Z")

</div>

```auto
{"log.level":"error","@timestamp":"2023-09-06T04:35:47.597Z","message":"Failed to connect to backoff(elasticsearch(cloud.com:443)): 401 Unauthorized: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional_unsuccessful_credentials":"API key: api key [EMjdXYoBAXAI5bbKOX7t] has been invalidated","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional_unsuccessful_credentials":"API key: api key [EMjdXYoBAXAI5bbKOX7t] has been invalidated","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}","component":{"binary":"filebeat","dataset":"elastic_agent.filebeat","id":"filestream-monitoring","type":"filestream"},"log":{"source":"filestream-monitoring"},"log.origin":{"file.line":148,"file.name":"pipeline/client_worker.go"},"service.name":"filebeat","ecs.version":"1.6.0","log.logger":"publisher_pipeline_output","ecs.version":"1.6.0"}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 4, 2023, 6:33am UTC](https://discuss.elastic.co/t/elastic-agent-failed-connect-failed-to-connect-to-backoff-401-unauthorized/342395/2 "2023-10-04T06:33:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
