Hi everyone, I'am using Prefect version: 3.1.1 and I’ve been encountering an intermittent issue with...
s

Sebastian Rodriguez

10 months ago
Hi everyone, I'am using Prefect version: 3.1.1 and I’ve been encountering an intermittent issue with my Prefect deployments, and I’m hoping someone can help clarify why this might be happening and how to best address it. Here's the context: When I execute a deployment, the flow sometimes enters a
Crashed
state. The logs show the following error:
ERROR   | prefect.engine - Engine execution of flow run '<run-id>' exited with unexpected exception
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\<temp-folder>\\orchestration\\subflows_definition\\coordinador_downloads.py'
This suggests that the deployment is unable to locate the required file in the temporary directory. Interestingly, if I restart Prefect (both the Server and Workers) and rerun the same deployment, it executes successfully without issues. Logs for the successful run show:
INFO    | Task run 'run_script-f9b' - Successfully ran script ...
INFO    | Flow run '<run-id>' - Finished in state Completed()
Why might the flow enter a
Crashed
state with a
FileNotFoundError
for code stored in a temporary directory? Could this be related to my use of
LocalFileSystem
storage on Windows? What happens during a Prefect restart that resolves the issue? Is it forcing a re-synchronization of the code between the Server and Worker? Are there best practices or configurations I can apply to prevent this kind of issue in a Windows environment?
I'm encountering a persistent issue with Dask serialization when updating my flows from Prefect `2.1...
r

Robert Banick

10 months ago
I'm encountering a persistent issue with Dask serialization when updating my flows from Prefect
2.19.1
to Prefect
3.1.2
. Every run incurs the following error, which I've never seen before in 18 months of using Prefect 2:
Task run failed with exception: TypeError('Could not serialize object of type HighLevelGraph', '<ToPickle: HighLevelGraph with 1 layers.\n<dask.highlevelgraph.HighLevelGraph object at 0x7f4e3b547400>\n 0. 139974151916736\n>') - Retries are exhausted
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/distributed/protocol/pickle.py", line 63, in dumps
    result = pickle.dumps(x, **dump_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/prefect/docker/__init__.py", line 20, in __getattr__
    raise ImportError(f"module {__name__!r} has no attribute {name!r}")
ImportError: module 'prefect.docker' has no attribute 'isnan'

<---Long series of stack traces--->

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

<<---Long stack trace--->>

  File "/usr/local/lib/python3.10/dist-packages/distributed/protocol/serialize.py", line 392, in serialize
    raise TypeError(msg, str_x) from exc
TypeError: ('Could not serialize object of type HighLevelGraph', '<ToPickle: HighLevelGraph with 1 layers.\n<dask.highlevelgraph.HighLevelGraph object at 0x7f4e3b547400>\n 0. 139974151916736\n>')
All of my flows write to Zarr N-Dimensional data stores using Xarray's
to_zarr
method,.
to_zarr
leverages Dask under the hood to vastly speed up this operation. I don't use Dask Task Runners or any specialized Prefect Dask objects. Digging around I've found this conversation, which doesn't seem directly related https://linen.prefect.io/t/23198687/hello-everyone-i-m-facing-an-issue-using-prefect-with-a-dask. Any ideas Prefect team? I'll post a full stack trace in follow up