Repository navigation
Closed
Description
I encountered this error in distributed 1.28.1, but from inspecting the code, I expect this to still be an issue in master.
LocalCluster accepts a parameter 'security', but defaults it to None.
By contrast, Scheduler (for example), will read the security parameter from the configs if it is not explicitly set, using
self.security = security or Security()
Depending on your configuration, this can lead to the LocalCluster failing:
>>> distributed.deploy.LocalCluster()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/distributed/deploy/local.py", line 219, in __init__
self.start(ip=ip, n_workers=n_workers)
File "/usr/local/lib/python2.7/site-packages/distributed/deploy/local.py", line 257, in start
self.sync(self._start, **kwargs)
File "/usr/local/lib/python2.7/site-packages/distributed/deploy/local.py", line 250, in sync
return sync(self.loop, func, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/distributed/utils.py", line 331, in sync
six.reraise(*error[0])
File "/usr/local/lib/python2.7/site-packages/distributed/utils.py", line 316, in f
result[0] = yield future
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 261, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/usr/local/lib/python2.7/site-packages/distributed/deploy/local.py", line 283, in _start
self.scheduler.start(address)
File "/usr/local/lib/python2.7/site-packages/distributed/scheduler.py", line 1199, in start
self.listen(addr_or_port, listen_args=self.listen_args)
File "/usr/local/lib/python2.7/site-packages/distributed/core.py", line 320, in listen
connection_args=listen_args,
File "/usr/local/lib/python2.7/site-packages/distributed/comm/core.py", line 258, in listen
loc, handle_comm, deserialize, **(connection_args or {})
File "/usr/local/lib/python2.7/site-packages/distributed/comm/tcp.py", line 530, in get_listener
return self._listener_class(loc, handle_comm, deserialize, **connection_args)
File "/usr/local/lib/python2.7/site-packages/distributed/comm/tcp.py", line 402, in __init__
self._check_encryption(address, connection_args)
File "/usr/local/lib/python2.7/site-packages/distributed/comm/tcp.py", line 339, in _check_encryption
"refusing communication from/to %r" % (self.prefix + address,)
RuntimeError: encryption required by Dask configuration, refusing communication from/to 'tcp://127.0.0.1'
Metadata
Metadata
Assignees
Labels
No labels
Activity
TomAugspurger commentedon Jul 1, 2019
Hmm what's the expected behavior here? I'm not familiar with our TLS stuff, but using TLS for LocalCluster doesn't seem likely to work. What options do we have?
mrocklin commentedon Jul 1, 2019
But since LocalCluster just passes the
securityvalue to Scheduler, wouldn't this work as expected?I'm curious, have you set up TLS somewhere in your configuration perhaps?
rbubley commentedon Jul 2, 2019
So, in my use case, I do indeed have TLS set-up in the dask configuration file (with require-encryption and default-scheme=tls. The motivation for me to do this was to ensure TLS was used for Client-Scheduler communication. I actually don't care what happens Scheduler-Worker, but this approach will make it go over TLS.
If I create a LocalCluster, then (unlike many other distributed objects), LocalCluster does not default to having its security parameter set by the configuration - it defaults to security=None. When LocalCluster starts the Scheduler, the Scheduler does read the configuration. It is this mismatch that is causing the problem.
mrocklin commentedon Jul 2, 2019
jcrist commentedon Jul 2, 2019
Yeah, local cluster should default to reading in the configuration as the scheduler does. Would you care to submit a PR fixing this?
rbubley commentedon Jul 2, 2019
I can write a PR to fix the issue, but I'm afraid I don't have time to write a test.
Respect security configuration (dask#2815)