Path option does not work for prefect-gitlab storage block in a deployment

I am trying to use the prefect-gitlab storage block but defining a path does not appear to work. However building the deployment with the script in the root of the gitlab repository does work. When I define the --path option it fails to find the script, see output below:

Downloading flow code from storage at 'workflows/testflow/'09:20:34 AMprefect.flow_runs
Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "<frozen importlib._bootstrap_external>", line 844, in exec_module
  File "<frozen importlib._bootstrap_external>", line 980, in get_code
  File "<frozen importlib._bootstrap_external>", line 1037, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp30_u8t79prefect/'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/prefect/", line 276, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/prefect/client/", line 40, in with_injected_client
    return await fn(*args, **kwargs)
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/prefect/", line 217, in load_flow_from_flow_run
    flow = await run_sync_in_worker_thread(load_flow_from_entrypoint, str(import_path))
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/prefect/utilities/", line 91, in run_sync_in_worker_thread
    return await anyio.to_thread.run_sync(
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/anyio/", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/anyio/_backends/", line 937, in run_sync_in_worker_thread
    return await future
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/anyio/_backends/", line 867, in run
    result =, *args)
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/prefect/", line 809, in load_flow_from_entrypoint
    flow = import_object(entrypoint)
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/prefect/utilities/", line 201, in import_object
    module = load_script_as_module(script_path)
  File "/opt/prefect/virtualenv/lib/python3.8/site-packages/prefect/utilities/", line 164, in load_script_as_module
    raise ScriptError(user_exc=exc, path=path) from exc
prefect.exceptions.ScriptError: Script at '' encountered an exception: FileNotFoundError(2, 'No such file or directory')