question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client('127.0.0.1:8786') fails ConnectionRefusedError

See original GitHub issue

dask = 2.8.1 distributed = 2.8.1 os = ManjaroLinux 18.1.3 python = 3.7.3 (conda-forge)

from dask.distributed import Client
Client('127.0.0.1:8786')

fails with

Traceback (most recent call last):
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/comm/core.py", line 222, in connect
    _raise(error)
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/comm/core.py", line 205, in _raise
    raise IOError(msg)
OSError: Timed out trying to connect to 'tcp://127.0.0.1:8786' after 10 s: in <distributed.comm.tcp.TCPConnector object at 0x7f87b55c0b70>: ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/client.py", line 726, in __init__
    self.start(timeout=timeout)
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/client.py", line 891, in start
    sync(self.loop, self._start, **kwargs)
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/utils.py", line 334, in sync
    raise exc.with_traceback(tb)
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/utils.py", line 318, in f
    result[0] = yield future
  File "/.../miniconda3/.../lib/python3.7/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/client.py", line 984, in _start
    await self._ensure_connected(timeout=timeout)
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/client.py", line 1041, in _ensure_connected
    connection_args=self.connection_args,
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/comm/core.py", line 231, in connect
    _raise(error)
  File "/.../miniconda3/.../lib/python3.7/site-packages/distributed/comm/core.py", line 205, in _raise
    raise IOError(msg)
OSError: Timed out trying to connect to 'tcp://127.0.0.1:8786' after 10 s: Timed out trying to connect to 'tcp://127.0.0.1:8786' after 10 s: in <distributed.comm.tcp.TCPConnector object at 0x7f87b55c0b70>: ConnectionRefusedError: [Errno 111] Connection refused

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mgsnunocommented, Nov 28, 2019

Ahh. Now I see. I meant this: https://distributed.dask.org/en/latest/client.html

And now reading better I see that: After we setup a cluster, we initialize a Client. My bad.

I was using LocalCluster() in the beginning but then I started to get some weird problems and noticed that Client() was calling LocalCluster with some arguments, hence started to use Client.

This was never an issue, sorry for the entropy.

0reactions
jacobtomlinsoncommented, Nov 28, 2019

Could you share the documentation page that mention this? If you specify the address of the cluster the assumption is that you are connecting to an existing cluster.

If you want to create your own cluster with your own settings I recommend looking at LocalCluster.

>>> from distributed import Client, LocalCluster
>>> cluster = LocalCluster()  # You can pass in arguments here 
LocalCluster("127.0.0.1:8786", workers=8, nthreads=8)
>>> client = Client(cluster)
<Client: scheduler=127.0.0.1:8786 processes=8 cores=8>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python socket ConnectionRefusedError but only when not on ...
The problem is: When I run server as on ip 127.0.0.1 it's everything alright. I can send message from client to server and...
Read more >
How to Fix the SSH "Connection Refused" Error - Kinsta
Are you experiecing the "Connection refused" error when connecting via SSH? Learn what's causing the issue and follow these steps to get it ......
Read more >
How to Fix ECONNREFUSED – connection refused by server ...
Learn how to fix the SSH Connection Refused error using three simple methods in this video tutorial.
Read more >
insync@groups.io | Cannot connect to gateway
Can someone give me some pointers to diagnose this? I cannot connect to the gateway. It is inside a Docker container running on...
Read more >
What is ConnectionRefusedError Errno 111 Connection ...
The ConnectionRefusedError errno 111 connection refused is a socket error that results when there is a failure in the establishment of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found