`09:32:17 INFO CloudFlowRunner Flow run SUCCESS: a...
# ask-community
m
09:32:17 INFO CloudFlowRunner Flow run SUCCESS: all reference
tasks succeeded 09:32:17 ERROR CloudFlowRunner Unexpected error:
AttributeError("'Flow' object has no attribute
'terminal_state_handler'") Traceback (most recent call last):   File
"/usr/local/lib/python3.8/site-packages/prefect/engine/runner.py", line
48, in inner     new_state = method(self, state, *args, **kwargs)   File
"/usr/local/lib/python3.8/site-packages/prefect/engine/flow_runner.py",
line 669, in get_flow_run_state     state = self.determine_final_state(
File
"/usr/local/lib/python3.8/site-packages/prefect/engine/flow_runner.py",
line 720, in determine_final_state     if
self.flow.terminal_state_handler: AttributeError: 'Flow' object has no
attribute 'terminal_state_handler'
z
Hi @Mohammad GH what version of Prefect is your agent running? And what version of Prefect Core did you use to register the flow?
m
Hi @Zach Angell both 0.14.22
k
Hey @Mohammad GH, what is the version of Prefect in the image you are using? This error is likely a version mismatch issue somewhere. Are you using Prefect Cloud or Server also?
m
Hi @Kevin Kho I am using cloud version. The prefect version of image is also 0.14.22
I also saw some threads related to this mismatch but at least I have no mismatch in any component
k
What RunConfig and Storage are you using?
m
flow.storage = Docker(
base_image="prefecthq/prefect:0.14.22-python3.8",
registry_url=f"{registry_url},
image_name=f"{image_name}",
image_tag="latest",
python_dependencies=[f"{pip_packages}"],
)
flow.run_config = KubernetesRun(
image=f"{registry_url}/{image_name}",
labels=['k8s']
)
k
That KubernetesRun has 0.14.22? Was it updated recently? With k8s, the default pull policy is
IfNotPresent
so there are cases where the image doesn’t update and you have to do`flow.run_config = KubernetesRun(image_pull_policy="Always")` . If you check the pod, do you see the 0.14.22?
m
ok, let me run a job to check your suggestion
although the image is new in each run but i will check that
@Kevin Kho thanks
it solved my issue
k
Nice! Glad you got it sorted