Amine Dirhoussi
10/21/2021, 10:10 AMprefect agent docker
i am having a permission error :
Thanks for your helpAnna Geller
USER root
Do you have a specific reason to use your own local Dask cluster? Otherwise, if you’re not running it in a distributed setting, you could try using LocalDaskExecutor
instead, which will parallelize work across your local processes and threads, and is much easier to set up and use.Amine Dirhoussi
10/21/2021, 11:54 AMAnna Geller
Amine Dirhoussi
10/21/2021, 12:19 PMUnexpected error: PermissionError(13, 'Permission denied')
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/prefect/engine/runner.py", line 48, in inner
new_state = method(self, state, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/prefect/engine/flow_runner.py", line 543, in get_flow_run_state
{e: state for e, state in upstream_states.items()}
File "/usr/local/lib/python3.7/site-packages/prefect/executors/dask.py", line 424, in wait
return self.client.gather(futures)
File "/usr/local/lib/python3.7/site-packages/distributed/client.py", line 1949, in gather
asynchronous=asynchronous,
File "/usr/local/lib/python3.7/site-packages/distributed/client.py", line 841, in sync
self.loop, func, *args, callback_timeout=callback_timeout, **kwargs
File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 326, in sync
raise exc.with_traceback(tb)
File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 309, in f
result[0] = yield future
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 762, in run
value = future.result()
File "/usr/local/lib/python3.7/site-packages/distributed/client.py", line 1808, in _gather
raise exception.with_traceback(traceback)
File "/home/amine/miniconda3/envs/prefect-test/lib/python3.7/site-packages/prefect/executors/dask.py", line 60, in _maybe_run
File "/home/amine/miniconda3/envs/prefect-test/lib/python3.7/site-packages/prefect/engine/flow_runner.py", line 775, in run_task
File "/home/amine/miniconda3/envs/prefect-test/lib/python3.7/site-packages/prefect/engine/cloud/task_runner.py", line 44, in __init__
File "/home/amine/miniconda3/envs/prefect-test/lib/python3.7/site-packages/prefect/client/client.py", line 135, in __init__
File "/home/amine/miniconda3/envs/prefect-test/lib/python3.7/site-packages/prefect/client/client.py", line 266, in load_auth_from_disk
File "/home/amine/miniconda3/envs/prefect-test/lib/python3.7/pathlib.py", line 1361, in exists
File "/home/amine/miniconda3/envs/prefect-test/lib/python3.7/pathlib.py", line 1183, in stat
PermissionError: [Errno 13] Permission denied: '/root/.prefect/auth.toml'
Amine Dirhoussi
10/21/2021, 12:22 PM/root/.prefect/
which i think is in the docker image ? The base_image
i created is very simple:
FROM prefecthq/prefect:latest
USER root
what i don't get is how the dask scheduler can be called from within the docker container (created by prefect agent when running the flow) ?Amine Dirhoussi
10/21/2021, 12:26 PMDask worker
i'm having this error :
distributed.worker - WARNING - Compute Failed
Function: _maybe_run
args: ('prefect-6004fbcd4dac46eebdfe60061e41be04', <function run_task at 0x7f4518b88170>)
kwargs: {'task': <Task: Constant[range]>, 'state': <Pending: "Task run created">, 'upstream_states': {}, 'context': {'image': 'dask-example:2021-10-21t12-04-03-051893-00-00', 'flow_run_id': '8472a134-d284-463d-86fb-9fef225f0d6c', 'flow_id': 'eef9aecf-0bb5-4852-a148-748883568a44', 'config': <Box: {'debug': False, 'home_dir': '/root/.prefect', 'backend': 'server', 'server': {'host': '<http://localhost>', 'port': 4200, 'host_port': 4200, 'host_ip': '127.0.0.1', 'endpoint': '<http://localhost:4200>', 'database': {'host': 'localhost', 'port': 5432, 'host_port': 5432, 'name': 'prefect_server', 'username': 'prefect', 'password': 'test-password', 'connection_url': '<postgresql://prefect>:test-password@localhost:5432/prefect_server', 'volume_path': '/root/.prefect/pg_data'}, 'graphql': {'host': '0.0.0.0', 'port': 4201, 'host_port': 4201, 'debug': False, 'path': '/graphql/'}, 'hasura': {'host': 'localhost', 'port': 3000, 'host_port': 3000, 'admin_secret': '', 'claims_namespace': 'hasura-claims', 'graphql_url'
Exception: PermissionError(13, 'Permission denied')
Anna Geller
base_image="test:latest"
you could probably use “prefecthq/prefect:latest” directly.
I think there is some issue in how Server, your Docker agent and Dask communicate. From the Dask logs you shared, it looks like Dask can’t reach the GraphQL API.
I have only two things worth trying that come to my mind atm:
1. Try the same using local agent and local storage instead of Docker agent and Docker storage to see if the error comes from permissions between those different components
2. Try the same with Prefect Cloud - since this way, the API is accessible from the internet (provided that you authenticated with an API key), this would be easier to set up and debug.
I only recommend #2 because we were discussing this together previously that you picked Server only because you weren’t aware of how secure Cloud is with the hybrid execution model.Amine Dirhoussi
10/21/2021, 12:47 PMAnna Geller
Anna Geller
Amine Dirhoussi
10/21/2021, 12:56 PMAnna Geller
Amine Dirhoussi
10/21/2021, 1:07 PMAnna Geller