`load_flow_from_flow_run` results in `Operation not permitted`

Ok, I am using

  • a GitHub block pointing to a gitlab repo
  • running on a docker-container block
Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/prefect/engine.py", line 262, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/opt/conda/lib/python3.10/site-packages/prefect/client/utilities.py", line 47, in with_injected_client
    return await fn(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/prefect/deployments.py", line 166, in load_flow_from_flow_run
    await storage_block.get_directory(from_path=deployment.path, local_path=".")
  File "/opt/conda/lib/python3.10/site-packages/prefect/filesystems.py", line 922, in get_directory
    copytree(src=content_source, dst=content_destination, dirs_exist_ok=True)
  File "/opt/conda/lib/python3.10/shutil.py", line 558, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/opt/conda/lib/python3.10/shutil.py", line 512, in _copytree
    raise Error(errors)
shutil.Error: [('/tmp/tmp73kvvu4aprefect', '.', '[Errno 1] Operation not permitted')]

I am using a micromamba image that is set to /tmp, which is owned by the root user.
I set the working directory to a non-root owned one:

WORKDIR /home/mambauser

and shutil was able to copy the files over without a problem.

1 Like