# Transport 502 Error: Need Help Isolating Error

**URL:** <https://discuss.elastic.co/t/transport-502-error-need-help-isolating-error/306590>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [June 7, 2022, 4:12pm UTC](https://discuss.elastic.co/t/transport-502-error-need-help-isolating-error/306590 "2022-06-07T16:12:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raphaelli1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raphaelli1/32/106733_2.png) [@raphaelli1](https://discuss.elastic.co/u/raphaelli1)\
**Post date:** [June 7, 2022, 4:12pm UTC](https://discuss.elastic.co/t/transport-502-error-need-help-isolating-error/306590/1 "2022-06-07T16:12:08Z")

</div>

The command we are using is this:  
`esrally race --track=http_logs --target-hosts=[IP address] --pipeline=benchmark-only --report-file=es_report_E3_32gb.md --report-format=csv --kill-running-processes`

The IP address is the format xxx.xxx.xxx.xxx:xxxx

The error logs we are getting is this:

```auto
[ERROR] Cannot race. Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.8/site-packages/esrally/actor.py", line 92, in guard
    return f(self, msg, sender)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/esrally/racecontrol.py", line 110, in receiveMsg_Setup
    self.coordinator.setup(sources=msg.sources)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/esrally/racecontrol.py", line 186, in setup
    distribution_version = mechanic.cluster_distribution_version(self.cfg)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/esrally/mechanic/mechanic.py", line 280, in cluster_distribution_version
    client.wait_for_rest_layer(es)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/esrally/client.py", line 315, in wait_for_rest_layer
    raise e
  File "/home/ubuntu/.local/lib/python3.8/site-packages/esrally/client.py", line 299, in wait_for_rest_layer
    es.cluster.health(wait_for_nodes=">={}".format(expected_node_count))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/elasticsearch/client/utils.py", line 168, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/elasticsearch/client/cluster.py", line 66, in health
    return self.transport.perform_request(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 409, in perform_request
    self._do_verify_elasticsearch(headers=headers, timeout=timeout)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 598, in _do_verify_elasticsearch
    raise error
  File "/home/ubuntu/.local/lib/python3.8/site-packages/elasticsearch/transport.py", line 561, in _do_verify_elasticsearch
    _, info_headers, info_response = conn.perform_request(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/elasticsearch/connection/http_urllib3.py", line 277, in perform_request
    self._raise_error(response.status, raw_data)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/elasticsearch/connection/base.py", line 330, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.TransportError: TransportError(502, '<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center></center>\r\n</body>\r\n</html>\r\n')

```

It seems to be an issue with the server of some sort. But if we can get more insight into what this error might be and what it might be.

Thanks!

---

<div class="post-metadata">

**Author:** ![json](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/json/32/4125_2.png) [@json](https://discuss.elastic.co/u/json)\
**Post date:** [June 7, 2022, 5:30pm UTC](https://discuss.elastic.co/t/transport-502-error-need-help-isolating-error/306590/2 "2022-06-07T17:30:25Z")

</div>

Hello and thank you for your post, welcome! It appears Rally is having trouble connecting to Elasticsearch through a reverse proxy. Can you try checking the connection to the host IP and port used in the `--target-hosts` parameter with an external REST client like Curl or even a web browser?

Thank you,  
Jason

---

<div class="post-metadata">

**Author:** ![raphaelli1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raphaelli1/32/106733_2.png) [@raphaelli1](https://discuss.elastic.co/u/raphaelli1)\
**Post date:** [June 13, 2022, 6:23pm UTC](https://discuss.elastic.co/t/transport-502-error-need-help-isolating-error/306590/3 "2022-06-13T18:23:20Z")

</div>

Hi, I think it was a personal issue where the cluster was not instantiated yet.

---

<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:** [July 11, 2022, 6:23pm UTC](https://discuss.elastic.co/t/transport-502-error-need-help-isolating-error/306590/4 "2022-07-11T18:23:54Z")

</div>

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