# Kibana randomly giving 502 bad gateway error

**URL:** <https://discuss.elastic.co/t/kibana-randomly-giving-502-bad-gateway-error/212000>\
**Category:** Kibana\
**Created:** [December 16, 2019, 11:57am UTC](https://discuss.elastic.co/t/kibana-randomly-giving-502-bad-gateway-error/212000 "2019-12-16T11:57:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmedwaleedmalik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmedwaleedmalik/32/59435_2.png) [@ahmedwaleedmalik](https://discuss.elastic.co/u/ahmedwaleedmalik)\
**Post date:** [December 16, 2019, 11:57am UTC](https://discuss.elastic.co/t/kibana-randomly-giving-502-bad-gateway-error/212000/1 "2019-12-16T11:57:34Z")

</div>

Hi,

I am run EFK stack on Kubernetes for logging. For elasticseach we have 2 data, 1 master and 1 client node. Everything is working fine but i randomly get `502 bad gateway` error.

From dashboard:

```auto
Discover: Bad Gateway

SearchError: Bad Gateway
    at https://kibana.logging.stakater.com/bundles/kibana.bundle.js:2:579398
    at processQueue (https://kibana.logging.stakater.com/built_assets/dlls/vendors.bundle.dll.js:307:199687)
    at https://kibana.logging.stakater.com/built_assets/dlls/vendors.bundle.dll.js:307:200650
    at Scope.$digest (https://kibana.logging.stakater.com/built_assets/dlls/vendors.bundle.dll.js:307:210412)
    at Scope.$apply (https://kibana.logging.stakater.com/built_assets/dlls/vendors.bundle.dll.js:307:213219)
    at done (https://kibana.logging.stakater.com/built_assets/dlls/vendors.bundle.dll.js:307:132717)
    at completeRequest (https://kibana.logging.stakater.com/built_assets/dlls/vendors.bundle.dll.js:307:136329)
    at XMLHttpRequest.requestLoaded (https://kibana.logging.stakater.com/built_assets/dlls/vendors.bundle.dll.js:307:135225)

```

Endpoint triggered that is giving error:  
`https://kibana.logging.stakater.com/elasticsearch/_msearch?rest_total_hits_as_int=true&ignore_throttled=true`

I have updated my nginx configuration etc. but still unable to resolve this.

P.s. Let me know if more information is required from my side

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [December 16, 2019, 11:35pm UTC](https://discuss.elastic.co/t/kibana-randomly-giving-502-bad-gateway-error/212000/2 "2019-12-16T23:35:19Z")

</div>

Hey @ahmedwaleedmalik, do your Kibana logs contain additional information regarding the error? Also, if you [capture a HAR](https://community.box.com/t5/Managing-Content-Troubleshooting/How-to-Generate-Network-Captures-for-Troubleshooting/ta-p/366) of the request which is causing the 502, it'll help us diagnose further.

---

<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:** [January 13, 2020, 11:35pm UTC](https://discuss.elastic.co/t/kibana-randomly-giving-502-bad-gateway-error/212000/3 "2020-01-13T23:35:25Z")

</div>

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