https://prefect.io logo
m

Mohamed Kamal El-Shazly

07/25/2023, 2:17 PM
hey guys, i used prefect 1 and i have the same issue discussed here, but when i try to implement the solution in the answer (task create a flow), it works probably on my machine but it doesn’t work on prefect cloud and this exception is thrown:
Copy code
Unexpected error while running flow: KeyError('Task slug environment is not found in the current Flow. This is usually caused by a mismatch between the flow version stored in the Prefect backend and the flow that was loaded from storage.\n- Did you change the flow without re-registering it?\n- Did you register the flow without updating it in your storage location (if applicable)?')
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/prefect/engine/cloud/flow_runner.py", line 398, in initialize_run
    task = tasks[task_run.task_slug]
KeyError: 'environment'
Does anyone here face this issue ? Summary of the issue: i want to create dynamic tasks that depend on each other. such that the flow first make some calculation and finally get a dictionary contain the task and all its dependencies after that the flow should create each task on the dictionary and maintain their dependencies