# Elastic enterprise search - BadGatewayError \[502\] 'The instance rejected the connection.'

**URL:** <https://discuss.elastic.co/t/elastic-enterprise-search-badgatewayerror-502-the-instance-rejected-the-connection/351341>\
**Category:** Elasticsearch\
**Created:** [January 18, 2024, 9:37am UTC](https://discuss.elastic.co/t/elastic-enterprise-search-badgatewayerror-502-the-instance-rejected-the-connection/351341 "2024-01-18T09:37:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarieD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maried/32/130898_2.png) [@MarieD](https://discuss.elastic.co/u/MarieD)\
**Post date:** [January 18, 2024, 9:37am UTC](https://discuss.elastic.co/t/elastic-enterprise-search-badgatewayerror-502-the-instance-rejected-the-connection/351341/1 "2024-01-18T09:37:07Z")

</div>

Hi everyone,

We've been using Elasticsearch through App Search.  
We've been getting the following error from time to time (~3% of our requests):

```auto
elastic_enterprise_search.exceptions.BadGatewayError: [502] {'ok': False, 'message': 'The instance rejected the connection.'}

```

Any hint of what may cause this (rate limiting, cluster memory, ...)?  
Any way to investigate this further on the Elastic portal?

Thank you!

---

<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:** [February 15, 2024, 9:37am UTC](https://discuss.elastic.co/t/elastic-enterprise-search-badgatewayerror-502-the-instance-rejected-the-connection/351341/2 "2024-02-15T09:37:50Z")

</div>

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