# Nginx "502 Bad gateway"

**URL:** <https://discuss.elastic.co/t/nginx-502-bad-gateway/344855>\
**Category:** Elasticsearch\
**Created:** [October 12, 2023, 2:04am UTC](https://discuss.elastic.co/t/nginx-502-bad-gateway/344855 "2023-10-12T02:04:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammad\_Ramadan\_Abd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_ramadan_abd/32/36308_2.png) [@Mohammad\_Ramadan\_Abd](https://discuss.elastic.co/u/Mohammad_Ramadan_Abd)\
**Post date:** [October 12, 2023, 2:04am UTC](https://discuss.elastic.co/t/nginx-502-bad-gateway/344855/1 "2023-10-12T02:04:01Z")

</div>

My stack is not working and when I login I receive this message nginx "502 Bad gateway".  
I have checked the kibana service and I found it continously restarting.  
tailing logs for kibana I found "  
di@dar-elk-7:~$ tail /var/log/kibana/kibana.log  
tail: cannot open '/var/log/kibana/kibana.log' for reading: Permission denied  
di@dar-elk-7:~$ sudo tail /var/log/kibana/kibana.log  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["info","savedobjects-service"],"pid":43929,"message":"[.kibana] OUTDATED\_DOCUMENTS\_SEARCH\_READ -\> OUTDATED\_DOCUMENTS\_SEARCH\_CLOSE\_PIT. took: 575ms."}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["info","savedobjects-service"],"pid":43929,"message":"[.kibana\_task\_manager] OUTDATED\_DOCUMENTS\_SEARCH\_READ -\> OUTDATED\_DOCUMENTS\_SEARCH\_CLOSE\_PIT. took: 562ms."}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["info","savedobjects-service"],"pid":43929,"message":"[.kibana] OUTDATED\_DOCUMENTS\_SEARCH\_CLOSE\_PIT -\> UPDATE\_TARGET\_MAPPINGS. took: 34ms."}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["info","savedobjects-service"],"pid":43929,"message":"[.kibana\_task\_manager] OUTDATED\_DOCUMENTS\_SEARCH\_CLOSE\_PIT -\> UPDATE\_TARGET\_MAPPINGS. took: 36ms."}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["error","savedobjects-service"],"pid":43929,"message":"[.kibana] Unexpected Elasticsearch ResponseError: statusCode: 429, method: PUT, url: /.kibana\_7.17.0\_001/\_mapping?timeout=60s error: [cluster\_block\_exception]: index [.kibana\_7.17.0\_001] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];,"}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["fatal","root"],"pid":43929,"message":"Error: Unable to complete saved object migrations for the [.kibana] index. Please check the health of your Elasticsearch cluster and try again. Unexpected Elasticsearch ResponseError: statusCode: 429, method: PUT, url: /.kibana\_7.17.0\_001/\_mapping?timeout=60s error: [cluster\_block\_exception]: index [.kibana\_7.17.0\_001] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];,\n at migrationStateActionMachine (/usr/share/kibana/src/core/server/saved\_objects/migrationsv2/migrations\_state\_action\_machine.js:164:13)\n at processTicksAndRejections (node:internal/process/task\_queues:96:5)\n at async Promise.all (index 0)\n at SavedObjectsService.start (/usr/share/kibana/src/core/server/saved\_objects/saved\_objects\_service.js:181:9)\n at Server.start (/usr/share/kibana/src/core/server/server.js:330:31)\n at Root.start (/usr/share/kibana/src/core/server/root/index.js:69:14)\n at bootstrap (/usr/share/kibana/src/core/server/bootstrap.js:120:5)\n at Command. (/usr/share/kibana/src/cli/serve/serve.js:229:5)"}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["info","plugins-system","standard"],"pid":43929,"message":"Stopping all plugins."}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["info","plugins","monitoring","monitoring","kibana-monitoring"],"pid":43929,"message":"Monitoring stats collection is stopped"}  
{"type":"log","@timestamp":"2023-10-12T03:54:22+02:00","tags":["error","savedobjects-service"],"pid":43929,"message":"[.kibana\_task\_manager] Unexpected Elasticsearch ResponseError: statusCode: 429, method: PUT, url: /.kibana\_task\_manager\_7.17.0\_001/\_mapping?timeout=60s error: [cluster\_block\_exception]: index [.kibana\_task\_manager\_7.17.0\_001] blocked by: [TOO\_MANY\_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];,"}  
{"type":"log","@timestamp":"2023-10-12T03:54:52+02:00","tags":["warning","plugins-system","standard"],"pid":43929,"message":""eventLog" plugin didn't stop in 30sec., move on to the next."}  
di@dar-elk-7:~$

I can see that the disk write usage has been exceeded, so what can I do now to have access to the logs again then delete my old logs? "sorry for not being a developer, am a networker so I have less dev skills".  
TIA

---

<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:** [November 9, 2023, 2:04am UTC](https://discuss.elastic.co/t/nginx-502-bad-gateway/344855/2 "2023-11-09T02:04:18Z")

</div>

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