Hello guys! Recently I have dealt with a problem ...
# ask-community
d
Hello guys! Recently I have dealt with a problem running my prefect code in the server UI:
Copy code
Failed to load and execute Flow's environment: StorageError('An error occurred while unpickling the flow:\n AttributeError("type object \'Members\' has no attribute \'ids\'")\nThis may be due to one of the following version mismatches between the flow build and execution environments:\n - prefect: (flow built with \'0.14.15\', currently running with \'0.14.12\')')
Funny thing, that running locally(flow.run()) this error do not appear and it only occurs when executing code via server UI(will attach a screenshot with the error log). For the context, I'm running Rust code in the python script which seems the main problem when using UI(running locally it works perfectly fine, so code itself seems to be good). Maybe anyone knows how to solve this problem? If there are some relevant information missing or there is already another thread is created related with this problem - let me know!
x
I guess you might be using an core version that is newer than your agent and/or cloud version
versions should be core <= agent <= server
👍 2
d
Thank you for your fast response! Any idea, how to change agent/cloud versions? If this is a real issue solution, then it is really strange, because other flows(without Rust implementation) works perfectly fine when running on server UI or locally 🤔 Forgot to mention one important detail: when I comment Rust code implementation, then that code on server UI running without any problem, so I guess the initial problem is related with Rust code configuration in the server UI.
k
Hey @Domantas! Using
flow.run()
will work because it’s just running all the flows locally with your local environment settings, but the flows are serialized when registered to cloud. The Prefect Cloud version is what version you register the flow in. I think in your case, it’s about the agent version. What agent are you using?
d
Hey @Kevin Kho! Agent core version: 0.14.12 Prefect Core Version: 0.14.15 It seems agent core version is a little bit outdated. Maybe you know how I could update my agent version? I'm looking into documentation(https://docs.prefect.io/orchestration/agents/overview.html#agent-types) and it is not clear which command I suppose to use.
k
Do you have a Dockerfile somewhere in your project that you’re using? It would be changing that. If your agent is some long-running EC2 instance or your local, then it would be going in and
pip install -U prefect
to upgrade the version
d
Ok, with versions now everything is alright - prefect and agent versions now are the same. However, initial problems still remains except now when I'm trying to execute code from server UI I got this error:
Copy code
Failed to load and execute Flow's environment: StorageError('An error occurred while unpickling the flow:\n AttributeError("type object \'Members\' has no attribute \'ids\'")')
And it seems this error is related with Rust code snippet execution in the server UI. I tried to specify localStorage manually in the code(https://docs.prefect.io/orchestration/execution/storage_options.html#azure-blob-storage) but outcome is the same 😕
k
Do you have a small code example you can share that replicates the issue?
d
On the spot I do not have code example to replicate the issue. Could I send the code example tomorrow if the problem remains unsolved? Need to think about representative code snippet and test it on my own environment in order to see if that code is good example for this issue.
k
For sure. Just paste it in here and I’ll see it 🙂
👍 1
d
Hello @Kevin Kho! I would like to announce that the issue was solved by registering project to the server UI in a different way: prefect register --path prefect_python_script_name.py --project "project name". Previously I registered project in the flow by using flow.register() syntax and it seems that was an issue in the first place. I don't know what is the core difference between these two registering methods, but it seems that was enough to solve this problem. Once again, thank you @Kevin Kho @xyzz for your help and support!
k
Glad you fixed it…but I think those should be equivalent… are you sure that was the difference?
d
Well, for my case that was a solution. I could test it again with the same code and different registering methods tomorrow to fully confirm if that was an only cause to this issue.