Brad
04/07/2020, 11:13 PM[2020-04-07 22:52:35,213] ERROR - agent | Error while deploying flow: FileNotFoundError(2, "No such file or directory: 'prefect'")
Chris White
04/07/2020, 11:15 PM/.../venv/prefect_env_name/prefect agent start
You need to make sure you actually activate the prefect virtual environment, as the agent will pass down the environment that it is running withBrad
04/07/2020, 11:15 PMChris White
04/07/2020, 11:17 PMBrad
04/08/2020, 4:25 AM[2020-04-08 04:24:50,068] ERROR - prefect.CloudTaskRunner | Unexpected error: KeyError('state')
Traceback (most recent call last):
File "/venv/lib/python3.7/site-packages/prefect/engine/runner.py", line 48, in inner
new_state = method(self, state, *args, **kwargs)
File "/venv/lib/python3.7/site-packages/prefect/engine/cloud/task_runner.py", line 226, in check_task_is_cached
for key, res in (candidate_state.cached_inputs or {}).items()
File "/venv/lib/python3.7/site-packages/prefect/engine/cloud/task_runner.py", line 226, in <dictcomp>
for key, res in (candidate_state.cached_inputs or {}).items()
KeyError: 'state'
PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS
?)Chris White
04/08/2020, 3:34 PMKeyError
is coming from, I’d need to look deeper to better understand it; for changing the default task runner class, yes you can do that! You’ll need to start your agent like so:
prefect agent start -e PREFECT__ENGINE__TASK_RUNNER__DEFAULT_CLASS="full.importable.path.to.your.runner.class"
but note that you’ll want to subclass the CloudTaskRunner
as it knows how to update states through the Prefect APIBrad
04/08/2020, 11:34 PM