# Fleet-server keeping restarting 401 missing credentials

**URL:** https://discuss.elastic.co/t/fleet-server-keeping-restarting-401-missing-credentials/376773
**Category:** Elastic Agent
**Tags:** elastic-stack-security
**Created:** [April 3, 2025, 10:54pm UTC](https://discuss.elastic.co/t/fleet-server-keeping-restarting-401-missing-credentials/376773 "2025-04-03T22:54:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![asha\_kiran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asha_kiran/32/142435_2.png) [@asha\_kiran](https://discuss.elastic.co/u/asha_kiran)
#### Post date: [April 3, 2025, 10:54pm UTC](https://discuss.elastic.co/t/fleet-server-keeping-restarting-401-missing-credentials/376773/1 "2025-04-03T22:54:32Z")

</div>

Fleet-server pod doesn't restart but the agent keeps restarting for every minute with error missing credentials for REST/ even though the credentials are validating and fetching response from elasticsearch.

Version 8.17.0

` ` `  
Here's the file which already has right info but why is it still failing. Also, the elasticsearch url is reachable within the pods

cat eck-fleet-server4.yml  
apiVersion: [agent.k8s.elastic.co/v1alpha1](http://agent.k8s.elastic.co/v1alpha1)  
kind: Agent  
metadata:  
name: eck-fleet-server  
spec:  
version: 8.17.0  
kibanaRef:  
name: eck-kibana  
namespace: default  
elasticsearchRefs:  
- name: eck-elasticsearch  
namespace: default  
serviceName: eck-elasticsearch-es-http  
agentConfig:  
fleet:  
agent:  
id: "76c127e0-cdae-4d8c-aadd-8c3421f23e2f"  
outputs:  
default:  
type: elasticsearch  
hosts: ["[https://eck-elasticsearch-es-http.default.svc:9200](https://eck-elasticsearch-es-http.default.svc:9200)"]  
policyID: "fleet-server-policy"  
http:  
service:  
spec:  
type: ClusterIP  
tls:  
selfSignedCertificate:  
disabled: false  
deployment:  
replicas: 1  
podTemplate:  
spec:  
serviceAccountName: fleet-server  
automountServiceAccountToken: true  
securityContext:  
runAsUser: 0  
containers:  
- name: fleet-server  
image: [docker.elastic.co/beats/elastic-agent:8.17.0](http://docker.elastic.co/beats/elastic-agent:8.17.0)  
env:  
- name: FLEET\_SERVER\_ENABLE  
value: "true"  
- name: FLEET\_SERVER\_HOST  
value: "0.0.0.0"  
- name: FLEET\_SERVER\_PORT  
value: "8220"  
- name: FLEET\_SERVER\_ELASTICSEARCH\_HOST  
value: "[https://eck-elasticsearch-es-http.default.svc:9200](https://eck-elasticsearch-es-http.default.svc:9200)"  
- name: FLEET\_SERVER\_KIBANA\_HOST  
value: "[https://eck-kibana-kb-http:5601](https://eck-kibana-kb-http:5601)"  
- name: FLEET\_SERVER\_ES\_CA  
value: "/usr/local/share/ca-certificates/public-cert.crt"  
- name: FLEET\_SERVER\_SERVICE\_TOKEN  
value: "JJJJJKFFFDSDFUIUYYTRRDDFGHJJJJHHTTRREWWWERIOOKJHGGGGY"  
- name: FLEET\_SERVER\_POLICY\_ID  
value: "fleet-server-policy"  
- name: ELASTICSEARCH\_USERNAME  
value: "elastic"  
- name: ELASTICSEARCH\_PASSWORD  
value: "asfdsfweregrgsdgrertrgfdgfg"  
- name: LOG\_LEVEL  
value: "debug"  
- name: FLEET\_SERVER\_DEBUG  
value: "true"  
resources:  
requests:  
cpu: "500m"  
memory: "1.5Gi"  
limits:  
cpu: "1"  
memory: "2Gi"  
livenessProbe:  
httpGet:  
path: /api/status  
port: 8220  
scheme: HTTPS  
initialDelaySeconds: 60  
periodSeconds: 20  
failureThreshold: 3  
readinessProbe:  
httpGet:  
path: /api/status  
port: 8220  
scheme: HTTPS  
initialDelaySeconds: 30  
periodSeconds: 10  
failureThreshold: 3  
volumeMounts:  
- name: public-certs  
mountPath: "/usr/local/share/ca-certificates/public-cert.crt"  
subPath: "tls.crt"  
lifecycle:  
postStart:  
exec:  
command:  
- /bin/sh  
- -c  
- |  
update-ca-certificates &&   
echo "Updated CA certificates successfully."  
volumes:  
- name: public-certs  
secret:  
secretName: "eck-elasticsearch-es-http-certs-public"

` ` `

Was able to get rid of missing credentials using api key but elasticsearch shows localhost:9200 connection refused

Unable to edit the agent policy and the output section of it shows blank.Currently operating with basic license . Is there a way to edit it and add elasticsearch url for the fleet server to connect?

---

<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: [April 4, 2025, 12:24pm UTC](https://discuss.elastic.co/t/fleet-server-keeping-restarting-401-missing-credentials/376773/2 "2025-04-04T12:24:19Z")

</div>



---

<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: [April 4, 2025, 1:10pm UTC](https://discuss.elastic.co/t/fleet-server-keeping-restarting-401-missing-credentials/376773/3 "2025-04-04T13:10:32Z")

</div>


