Ray submit error: http.client.BadStatusLine

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

Basic information:
Head vm system: ubuntu 22 LTS
Node vm system: ubuntu 22 LTS
Python version: 3.9.16

Operation process:
Success start head:

Export RAY_ADDRESS:

Success start node:

Ray submit:

MY script 1.py content:

import ray


@ray.remote
def hello_world():
    for _ in range(10000000000):
        return "hello world"

# Automatically connect to the running Ray cluster.
ray.init(address="ray://10.1.0.4:6379")

print(ray.get(hello_world.remote()))

The above ray task submission was made in ubuntu where head is located, i.e. within the cluster.

Error message:
root@lbtsjeogzHBPQ8P:~/1# ray job submit --working-dir /root/1 – python 1.py
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 703, in urlopen
httplib_response = self._make_request(
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 449, in _make_request
six.raise_from(e, None)
File “”, line 3, in raise_from
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 444, in _make_request
httplib_response = conn.getresponse()
File “/usr/local/lib/python3.9/http/client.py”, line 1377, in getresponse
response.begin()
File “/usr/local/lib/python3.9/http/client.py”, line 320, in begin
version, status, reason = self._read_status()
File “/usr/local/lib/python3.9/http/client.py”, line 302, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: ?ÿÿ?ÿÿ ?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/requests/adapters.py”, line 489, in send
resp = conn.urlopen(
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 787, in urlopen
retries = retries.increment(
File “/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py”, line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/usr/local/lib/python3.9/site-packages/urllib3/packages/six.py”, line 769, in reraise
raise value.with_traceback(tb)
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 703, in urlopen
httplib_response = self._make_request(
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 449, in _make_request
six.raise_from(e, None)
File “”, line 3, in raise_from
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 444, in _make_request
httplib_response = conn.getresponse()
File “/usr/local/lib/python3.9/http/client.py”, line 1377, in getresponse
response.begin()
File “/usr/local/lib/python3.9/http/client.py”, line 320, in begin
version, status, reason = self._read_status()
File “/usr/local/lib/python3.9/http/client.py”, line 302, in _read_status
raise BadStatusLine(line)
urllib3.exceptions.ProtocolError: (‘Connection aborted.’, BadStatusLine(‘\x00\x00\x18\x04\x00\x00\x00\x00\x00\x00\x04\x00?ÿÿ\x00\x05\x00?ÿÿ\x00\x06\x00\x00 \x00þ\x03\x00\x00\x00\x01\x00\x00\x04\x08\x00\x00\x00\x00\x00\x00?\x00\x00’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/ray/dashboard/modules/dashboard_sdk.py”, line 242, in _check_connection_and_version_with_url
r = self._do_request(“GET”, url)
File “/usr/local/lib/python3.9/site-packages/ray/dashboard/modules/dashboard_sdk.py”, line 281, in _do_request
return requests.request(
File “/usr/local/lib/python3.9/site-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.9/site-packages/requests/sessions.py”, line 587, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.9/site-packages/requests/sessions.py”, line 701, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.9/site-packages/requests/adapters.py”, line 547, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (‘Connection aborted.’, BadStatusLine(‘\x00\x00\x18\x04\x00\x00\x00\x00\x00\x00\x04\x00?ÿÿ\x00\x05\x00?ÿÿ\x00\x06\x00\x00 \x00þ\x03\x00\x00\x00\x01\x00\x00\x04\x08\x00\x00\x00\x00\x00\x00?\x00\x00’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/bin/ray”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.9/site-packages/ray/scripts/scripts.py”, line 2386, in main
return cli()
File “/usr/local/lib/python3.9/site-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.9/site-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.9/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.9/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.9/site-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.9/site-packages/click/core.py”, line 760, in invoke
return __callback(*args, **kwargs)
File “/usr/local/lib/python3.9/site-packages/ray/autoscaler/_private/cli_logger.py”, line 852, in wrapper
return f(*args, **kwargs)
File “/usr/local/lib/python3.9/site-packages/ray/dashboard/modules/job/cli.py”, line 204, in submit
client = _get_sdk_client(address, create_cluster_if_needed=True)
File “/usr/local/lib/python3.9/site-packages/ray/dashboard/modules/job/cli.py”, line 22, in _get_sdk_client
client = JobSubmissionClient(address, create_cluster_if_needed)
File “/usr/local/lib/python3.9/site-packages/ray/dashboard/modules/job/sdk.py”, line 105, in init
self._check_connection_and_version(
File “/usr/local/lib/python3.9/site-packages/ray/dashboard/modules/dashboard_sdk.py”, line 228, in _check_connection_and_version
self._check_connection_and_version_with_url(min_version, version_error_message)
File “/usr/local/lib/python3.9/site-packages/ray/dashboard/modules/dashboard_sdk.py”, line 256, in _check_connection_and_version_with_url
raise ConnectionError(
ConnectionError: Failed to connect to Ray at address: http://10.1.0.4:6379.

Who can help me to answer, thank you!