Giovanni Giacco

02/08/2021, 11:50 PM
Hi everyone. I'm trying to execute a flow on kubernetes with a Dask Executor:
Copy code = Docker(registry_url="702*****<|>", image_tag='latest', python_dependencies=["dask_kubernetes"])
flow.run_config = KubernetesRun()
flow.executor = DaskExecutor(
    cluster_class=lambda: KubeCluster(make_pod_spec(image=prefect.context.image)),
    adapt_kwargs={"minimum": 3, "maximum": 5},

But I get the following error:
Unexpected error: AttributeError("can't set attribute")
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/prefect/engine/", line 48, in inner
new_state = method(self, state, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/prefect/engine/", line 418, in get_flow_run_state
with self.check_for_cancellation(), executor.start():
File "/usr/local/lib/python3.8/", line 113, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.8/site-packages/prefect/executors/", line 211, in start
with self.cluster_class(**self.cluster_kwargs) as cluster:  # type: ignore
File "C:/Users/giova/Git_Projects/PentaTechnology/earthalytics-engine/", line 48, in <lambda>
File "/usr/local/lib/python3.8/site-packages/dask_kubernetes/", line 414, in __init__
File "/usr/local/lib/python3.8/site-packages/distributed/deploy/", line 274, in __init__
File "/usr/local/lib/python3.8/site-packages/distributed/deploy/", line 69, in __init__ = str(uuid.uuid4())[:8]
AttributeError: can't set attribute
Any advice? It seems it's not be able to set the name of the pod into the cluster. I'm using Prefect 0.14.6.
Is it maybe related to this: ? Tried with a Docker image with "dask==2020.12.0" but without success.

Kyle Moon-Wright

02/09/2021, 12:34 AM
Hey @Giovanni Giacco, There may be others with insight on this, but this does look like an issue with the
library (or at the very least not on the Prefect side) so I would recommend opening an issue there to find a better path forward, though it looks like they recommend downgrading in the meantime.

Giovanni Giacco

02/09/2021, 9:14 AM
I opened an issue on dask-kubernetes. I tried downgrading Distributed but it didn't solve the problem. 😔