https://prefect.io logo
#prefect-community
Title
# prefect-community
d

Dan DiPasquo

06/05/2020, 2:15 AM
Trying to upgrade from 0.10.7 to 0.11 -- worked through a few issues, but have been banging my head for awhile trying to figure out what I'm doing wrong here: Flow Runs with newly registered flow version fail immediately with Failed to load and execute Flow's environment: AttributeError("'KubernetesJobEnvironment' object has no attribute 'unique_job_name'"). On closer inspection, Cloud UI still shows Prefect Core Version: 0.10.7 for the flow. I'm using new docker base image FROM prefecthq/prefect:0.11.5-python3.8 and updated
Copy code
python_dependencies=[
                 "kubernetes",
                 "docker",
-                "prefect[gcp]",
-                "prefect[kubernetes]",
+                "prefect[gcp]~=0.11",
+                "prefect[kubernetes]~=0.11",
(this may be redundant?). I can see in the output from the register/build process:
Copy code
Step 1/36 : FROM prefecthq/prefect:0.11.5-python3.8
...
Step 30/36 : RUN pip show prefect || pip install git+<https://github.com/PrefectHQ/prefect.git@0.10.7#egg=prefect[kubernetes]>
 ---> Running in e3773eba79d4
Name: prefect
Version: 0.11.5
...
Additionally I have pulled and run the docker image from the registered flow and inside:
Copy code
root@b3fc72e3e101:/# python
Python 3.8.3 (default, May 20 2020, 20:38:46) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import prefect
pr>>> prefect.__version__
'0.11.5'
I've now even deleted the flow, all past versions, and registered again and still seeing Prefect Core Version: 0.10.7 in Cloud UI - what am I missing / doing wrong?
I've also explicitly added:
Copy code
flow.storage = Docker(
+            prefect_version="0.11.5",
still no joy I'm afraid.
ooooo I suspect that the agents need to be updated, too... it's late, talking out loud here.
Well, darn, really thought that would be it, but have upgraded agent to 0.11.5 now too, and flow run still fails with [4 Jun 2020 1130pm] Failed to load and execute Flow's environment: AttributeError("'KubernetesJobEnvironment' object has no attribute 'unique_job_name'")
OK, well, all that and I finally found that my local venv in which I was running flow.register was rebuild to 0.10.7. Upgrading that and re-registering flow now shows Prefect Core Version: 0.11.5, and the flow runs. It fails for different reason, but at least it runs and and I can keep working through those. Sheesh. I'll leave this thread here on the chance my stumbling through this might spare someone else, and/or enjoy a laugh at my expense.
👏 3
j

Jenny

06/05/2020, 2:38 PM
Thanks for sharing @Dan DiPasquo - hope this helps others in the future.