How to fix the error: "Failed to load and execute flow run: FlowStorageError(‘An error occurred while unpickling the flow"

I am trying to run my code on prefect cloud through me local machine, but getting some errors like this.
“Failed to load and execute flow run: FlowStorageError(‘An error occurred while unpickling the flow:\n AppRegistryNotReady(“Apps aren't loaded yet.”)’)”

https://cloud.prefect.io/amoga-dev/flow-run/53a83a61-f14b-4fc3-9a48-e999944da975?logs=&logId=cfb085d8-4b6e-4216-9a66-3496cffa9898

1 Like

This is an issue with pickle serialization in your storage - this often happens when you register your flow in an environment with a specific Prefect and Python version, but you then run it in an environment with a different Prefect and python version.

You could:

  • match the versions between your registration and execution environment and potentially reregister your flow
  • switch to script storage: Storage | Prefect Docs

For more examples of how you may configure various storage options, check out this repo: