Hi! Do you have any idea of what is causing this e...
# ask-community
e
Hi! Do you have any idea of what is causing this error :
Failed to load and execute Flow's environment: FlowStorageError("An error occurred while unpickling the flow:\n  TypeError('an integer is required (got type bytes)')\nThis may be due to one of the following version mismatches between the flow build and execution environments:\n  - prefect: (flow built with '0.15.10', currently running with '0.15.12')\n  - python: (flow built with '3.7.11', currently running with '3.9.9')")
? I search this slack for insights, I use prefect Cloud with a docker agent on a VM, I upgraded prefect to 0.15.12 on both agent and development machine
a
Since your flow has been serialized with another Prefect version, you would need to reregister your flow. Alternatively you can switch to script based storage
e
@Anna Geller we added
stored_as_script=True
in our Docker storage but it says that
path
is required according to the documentation, how do we find the default location of the flow ?
a
To use flow script files in Docker, we need the following arguments to be set properly: •
stored_as_script
= True •
path
must point to the path in the image • if this path is different than /opt/prefect/flows/YOUR_FLOW.py, then you also need to change the default
prefect_directory
to your custom directory • you need to add the flow to the storage explicitly before registering, e.g.: docker_storage.add_flow(flow) • finally, registering the flow must happen from Python, since the
prefect register
CLI doesn’t have the option to pass build=False, and this is critical to include to prevent pickling flow and rebuilding the image on registration • the parameter
ignore_healthchecks
on the Docker storage is optional and doesn’t affect this process at all
e
Thanks, I'm saving this as an alternative! we solved it by rebuilding a new virtual environment, there was conflict between python versions despite the
ignore_healthchecks=True
(which was weird as it worked for another flow, i suppose it depends on the versions...)
a
Nice work! This will be much easier to do in Orion - check out this awesome tutorial
🔥 1