Skip to content

lambda visits opensearch url, return "HTTPError: 502 Server Error: Bad Gateway for url"

0

I created the domain of OpenSearch Service, and visit the service via lambda. Fine-grained access control is enabled with internal user database as main user type. normally run for several days but meet 502 gateway error since yesterday afternoon. when I want to open the opensearch dashboards, the same error returned. How do i deal with it?

asked 2 years ago1.3K views

3 Answers
0
Accepted Answer

Hello,

There could be couple of reasons for this type of error. I would recommend checking the cloudwatch metrics for the domain. Check the cluster health status and storage usage metrics.

Because sometimes if there is no storage space available the OpenSearch cluster's health may degrade, leading to issues with data ingestion, indexing, and query processing. This can cause various services within the cluster to become unresponsive or overloaded.

And if your cluster health is in a red or yellow status, this can also be a possible cause. You can refer this post for fixing the same.

AWS

answered 2 years ago

EXPERT

reviewed a year ago

0

Hi,

In some cases, the OpenSearch Dashboard returns a bad gateway error when a query runs over 120 seconds (as parametrized).

So, you may get such an error on complex queries. Can you try on a simple one (i.e. answering fast for sure) to see if you always get 502? If not, then it mean that you mean have too complex queries or too much data for your current timeout setup.

Best,

Didier

EXPERT

answered 2 years ago

0

Hello,

check these solutions to resolve your issue

1. Storage and Cluster Health:

  • Check CloudWatch metrics: Ensure storage space is sufficient and cluster health is good.
  • Action: Add storage or resolve any health issues.

2.Query Timeout:

  • Simplify Queries: Run simpler queries to see if the issue persists.
  • Adjust Timeout: Increase query timeout settings if needed.

By checking storage, cluster health, and query complexity, you can resolve the "502 Bad Gateway" error.

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.