https://prefect.io logo
r

Rolf Schick

01/14/2021, 12:55 PM
Hi has anyone had this error before?
Failed to load and execute Flow's environment: UnpicklingError("invalid load key, '{'.")
Happened in Prefect Cloud.
g

Giovanni

01/19/2021, 8:05 PM
Hey there, I am encountering the same problem. Did you manage to find the cause or a workaround?
r

Rolf Schick

01/19/2021, 8:36 PM
yes. I had 2 Environments and one had the issue while the other did not. I searched for the error and it seamed to have something to do with cloudpickle. In the end i changed the requirements for the virtual environment executing registering the flow to be:
Copy code
prefect==0.14.1
cloudpickle==1.6.0
Thats it.
🙌 1
s

Sagun Garg

01/21/2021, 11:29 AM
Hey @Rolf Schick @Giovanni After I finally managed to run ECR Run after adding run_task_kwargs, I ran into this same issue. Looking to solve it now with your recommendation
Copy code
Failed to load and execute Flow's environment: UnpicklingError("invalid load key, '{'.")
This error
k

Kevin Weiler

02/06/2021, 5:14 PM
I’m having this same issue on version
0.14.5
of prefect server and client. Unsurprisingly, just changing the version of cloudpickle in the client env doesn’t fix the problem. Are there containers built with the fix?
j

Jim Crist-Harif

02/06/2021, 11:02 PM
This is likely due to registering a prefect flow with a version >= 0.14.3, but executing it in an environment with prefect < 0.14.3. A change was made in the storage format in 0.14.3.
If you' are for sure executing the flow in an environment with prefect >= 0.14.3 and still seeing this issue, we'd need a reproducible example to debug further.
Note that the change made in 0.14.3 doesn't break any of our compatibility guarantees - we recommend deploying prefect flows in environments with the same version they were registered with. After 0.14.3 you'll also see warnings if the versions mismatch.
k

Kevin Weiler

02/07/2021, 4:59 PM
👍 - I think my docker container has an older version in it - will give that a try
thanks again @Jim Crist-Harif - this worked. Incidentally - I also had to add a run_config or I ran into this error: https://prefect-community.slack.com/archives/CL09KU1K7/p1611844979375200 Just in case people upgrading miss the memo like me 🙂
2 Views