# Elastic Fleet Server Agent fails on startup

**URL:** <https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Tags:** fleet\
**Created:** [November 18, 2022, 9:53am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282 "2022-11-18T09:53:54Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![WookWook](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@WookWook](https://discuss.elastic.co/u/WookWook)\
**Post date:** [November 18, 2022, 9:53am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/1 "2022-11-18T09:53:54Z")

</div>

Hi,  
currently I want to evaluate Elastic APM, but first things first, I am trying to setup the Elastic Agent in Fleet-Managed mode which keeps constantly failing.

Managed Azure Redhat Openshift 4.9 // ECK 2.5

Right now I cant get this fixed.

```auto
Updating certificates in /etc/ssl/certs...
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Error: preparing STATE_PATH(/usr/share/elastic-agent/state) failed: mkdir /usr/share/elastic-agent/state/data: permission denied
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.5/fleet-troubleshooting.html

```

my config.yaml (just the necessary part, if more is needed, just let me know)

```auto
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
spec:
  version: 8.5.1
  count: 1
  elasticsearchRef:
    name: elasticsearch
  config:
    xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-es-http.elastic.svc:9200"]
    xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.elastic.svc:8220"]
    xpack.fleet.packages:
    - name: system
      version: latest
    - name: elastic_agent
      version: latest
    - name: fleet_server
      version: latest
    - name: kubernetes
      version: latest
    xpack.fleet.agentPolicies:
    - name: Fleet Server on ECK policy
      id: eck-fleet-server
      namespace: default
      monitoring_enabled:
      - logs
      - metrics
      unenroll_timeout: 900
      is_default_fleet_server: true
      package_policies:
      - name: fleet_server-1
        id: fleet_server-1
        package:
          name: fleet_server
    - name: Elastic Agent on ECK policy
      id: eck-agent
      namespace: default
      monitoring_enabled:
      - logs
      - metrics
      unenroll_timeout: 900
      is_default: true
      package_policies:
      - package:
          name: system
        name: system-1
      - package:
          name: kubernetes
        name: kubernetes-1
---
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
  name: fleet-server
  namespace: elastic
spec:
  version: 8.5.1
  kibanaRef:
    name: kibana
  elasticsearchRefs:
  - name: elasticsearch
  mode: fleet
  fleetServerEnabled: true
  deployment:
    replicas: 1
    podTemplate:
      spec:
        serviceAccountName: elastic-agent
        automountServiceAccountToken: true
        securityContext:
          runAsUser: 0
---
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
  name: elastic-agent
  namespace: elastic
spec:
  version: 8.5.1
  kibanaRef:
    name: kibana
  fleetServerRef:
    name: fleet-server
  mode: fleet
  daemonSet:
    podTemplate:
      spec:
        serviceAccountName: elastic-agent
        securityContext:
          runAsUser: 0
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: elastic-agent
rules:
- apiGroups: [""] # "" indicates the core API group
  resources:
  - pods
  - nodes
  - namespaces
  verbs:
  - get
  - watch
  - list
- apiGroups: ["coordination.k8s.io"]
  resources:
  - leases
  verbs:
  - get
  - create
  - update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: elastic-agent
subjects:
- kind: ServiceAccount
  name: elastic-agent
  namespace: elastic
roleRef:
  kind: ClusterRole
  name: elastic-agent
  apiGroup: rbac.authorization.k8s.io

```

Regards,  
Marius

---

<div class="post-metadata">

**Author:** ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)\
**Post date:** [November 21, 2022, 10:30am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/3 "2022-11-21T10:30:41Z")

</div>

Hey, I found a similar issue on github, does this help?

> <https://github.com/elastic/cloud-on-k8s/issues/3701#issuecomment-892363440>
>
> \## Bug Report
> \*\*What did you do?\*\*
> 1. Install ECK from the \`all-in-one.yaml\` m…anifest file.
> 2. Per the \[Quickstart guide\](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html) install Elasticsearch
> 
> \*\*What did you expect to see?\*\*
> A running Elasticsearch cluster
> 
> \*\*What did you see instead? Under which circumstances?\*\*
> Elasticsearch fails to start with the following error:
> \`\`\`
> chroot: failed to run command '/usr/share/elasticsearch/bin/elasticsearch': Permission denied
> \`\`\`
> 
> \*\*Environment\*\*
> 
> \* ECK version: 1.2.1
> 
> \* Kubernetes information:
> kubeadm cluster with Kubernetes v1.15.7.
> Storage backend: GlusterFS v5.11 with Heketi
> 
> \`\`\`
> $ kubectl version
> Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.3", GitCommit:"06ad960bfd03b39c8310aaf92d1e7c12ce618213", GitTreeState:"clean", BuildDate:"2020-02-13T18:06:54Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"darwin/amd64"}
> Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.7", GitCommit:"6c143d35bb11d74970e7bc0b6c45b6bfdffc0bd4", GitTreeState:"clean", BuildDate:"2019-12-11T12:34:17Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
> \`\`\`
> 
> \* Resource definition:
> Elasticsearch manifest
> \`\`\`
> apiVersion: elasticsearch.k8s.elastic.co/v1
> kind: Elasticsearch
> metadata:
> name: monitoring
> namespace: \<redacted\>
> spec:
> version: 7.9.0
> nodeSets:
> - name: default
> count: 1
> # podTemplate: \<-- Tried setting this as well, result is the same error
> # spec:
> # securityContext:
> # runAsUser: 1000
> # runAsGroup: 1000
> # fsGroup: 1000
> volumeClaimTemplates:
> - metadata:
> name: elasticsearch-data
> spec:
> accessModes:
> - ReadWriteOnce
> resources:
> requests:
> storage: 2Gi
> storageClassName: standard
> config:
> node.master: true
> node.data: true
> node.ingest: true
> node.store.allow\_mmap: false
> \`\`\`

---

<div class="post-metadata">

**Author:** ![WookWook](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@WookWook](https://discuss.elastic.co/u/WookWook)\
**Post date:** [November 21, 2022, 2:53pm UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/4 "2022-11-21T14:53:59Z")

</div>

Hello Julia,

with this setting the pod ist not even trying to start or showing up. Openshift restrictions are quiet special...

I just found another message in Openshift for this pod

```auto
"fleet-server
Reconciliation error: no matching agent policy found"

```

And there is really no agent policy in Kibana when I check. Shouldnt they get created on startup of Kibana? I mean they are configured in the .yaml

```auto
    xpack.fleet.agentPolicies:

```

---

<div class="post-metadata">

**Author:** ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)\
**Post date:** [November 21, 2022, 3:26pm UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/5 "2022-11-21T15:26:39Z")

</div>

Yes, the Fleet Server agent policy should be created on Kibana startup.  
Do you see any errors in Kibana logs?

---

<div class="post-metadata">

**Author:** ![WookWook](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@WookWook](https://discuss.elastic.co/u/WookWook)\
**Post date:** [November 23, 2022, 9:22am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/6 "2022-11-23T09:22:03Z")

</div>

Only this warning, nothing else

```auto
[2022-11-18T09:27:21.851+00:00][WARN][config.deprecation] Config key [xpack.fleet.agentPolicies.is_default] is deprecated.
[2022-11-18T09:27:21.851+00:00][WARN][config.deprecation] Config key [xpack.fleet.agentPolicies.is_default_fleet_server] is deprecated.

```

---

<div class="post-metadata">

**Author:** ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)\
**Post date:** [November 23, 2022, 9:59am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/7 "2022-11-23T09:59:41Z")

</div>

Can you share the logs around "no matching agent policy found" error?

---

<div class="post-metadata">

**Author:** ![WookWook](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@WookWook](https://discuss.elastic.co/u/WookWook)\
**Post date:** [November 23, 2022, 10:31am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/8 "2022-11-23T10:31:43Z")

</div>

This one is acutually from the Openshift deployment. Nothing more ☹

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/f/dffa96ac5b8965ac0fcf0ac4c53f6174692b4d0d.png)

---

<div class="post-metadata">

**Author:** ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)\
**Post date:** [November 23, 2022, 11:39am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/9 "2022-11-23T11:39:33Z")

</div>

When you check in Kibana UI or API, do you see the agent policies created?

You can try adding a new policy and use it for enrollment: [Configuration | Elastic Cloud on Kubernetes [2.5] | Elastic](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-elastic-agent-fleet-configuration.html#k8s-elastic-agent-control-fleet-policy-selection)

---

<div class="post-metadata">

**Author:** ![WookWook](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@WookWook](https://discuss.elastic.co/u/WookWook)\
**Post date:** [November 23, 2022, 8:30pm UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/10 "2022-11-23T20:30:45Z")

</div>

Added a new policy manually. Did not help yet.

But I found this!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/c/fc7d3fc11f9cc5fe44c427cd4070de7d9358206a.png)

Seems like there is a process still going on for many days now. Maybe this one is blocking something?

---

<div class="post-metadata">

**Author:** ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)\
**Post date:** [November 24, 2022, 7:31am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/11 "2022-11-24T07:31:46Z")

</div>

I don't think that blocks anything, it just means there was an unenroll action that was not acknowledged by 1 agent, maybe because it was offline.

Are you getting the same error when you try to enroll fleet server with the new custom policy? Can you paste here the command output?

---

<div class="post-metadata">

**Author:** ![WookWook](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@WookWook](https://discuss.elastic.co/u/WookWook)\
**Post date:** [November 24, 2022, 8:20am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/12 "2022-11-24T08:20:49Z")

</div>

Hello Julia,

So I created a agent policy with the Kibana UI which looks like this.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/a/3a5da954a634add459d6e7300e2c25cd880d8220.png)

In the fleet-server agent config I added this

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/5/3576bf5f1f555dc71deca9da6c90493dc2762737.png)

Now I get messages in Kibana concerning a missing Agent policy

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b2b364b556dfecc11be7c425cba66d64a771eb99.png)

I also found this in the eventlog from Openshift

![image](https://us1.discourse-cdn.com/elastic/original/3X/e/0/e088f8d41ad25c0bb2033e08db1108683ad6bcfd.png)

And after removing and recreating the agent instances I get this messages in Kibana

```auto
[2022-11-24T07:56:41.255+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:41.356+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:41.450+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:41.552+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:41.657+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:41.767+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:41.870+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:42.036+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:42.783+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:44.169+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:46.832+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:56:52.055+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:57:02.400+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
[2022-11-24T07:57:22.980+00:00][INFO][plugins.security.authentication] Authentication attempt failed: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [elastic-fleet-server-agent-kb-user] for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}

```

The mentioned user secret gets recreated after a redeploy of the agent instances

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/7/37470801e3d01fe4bff80bad30056cc5ca83771c.png)

---

<div class="post-metadata">

**Author:** ![Julia\_Bardi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julia_bardi/32/79463_2.png) [@Julia\_Bardi](https://discuss.elastic.co/u/Julia_Bardi)\
**Post date:** [November 24, 2022, 8:23am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/13 "2022-11-24T08:23:57Z")

</div>

`eck-fleet-server` is the policy name, not the ID. You can check the ID in the agent details page url, something like `/app/fleet/policies/<id>`. Can you try adding this ID to the config?

---

<div class="post-metadata">

**Author:** ![WookWook](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@WookWook](https://discuss.elastic.co/u/WookWook)\
**Post date:** [November 24, 2022, 8:33am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/14 "2022-11-24T08:33:26Z")

</div>

Yeah I just found the "View Policy" button and saw the ID is something different. Thank you!

Now the pod is getting created again but I am back to my initial error.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2d02c2bf0bb1f3a79780e75530d8a7136c63782.png)

---

<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:** [December 22, 2022, 8:33am UTC](https://discuss.elastic.co/t/elastic-fleet-server-agent-fails-on-startup/319282/15 "2022-12-22T08:33:33Z")

</div>

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