Hello everybody. I’m running a local agent inside ...
# prefect-server
r
Hello everybody. I’m running a local agent inside a docker container and triggering a flow from Prefect Cloud and getting this stacktrace:
Copy code
[2021-01-20 18:57:29,015] INFO - agent | Deploying flow run 0ed795b0-8eb3-4086-bf40-c19a54792a7b
'NoneType' object has no attribute 'setup'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/site-packages/prefect/__main__.py", line 4, in <module>
    cli()
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/prefect/cli/execute.py", line 90, in flow_run
    raise exc
  File "/usr/local/lib/python3.8/site-packages/prefect/cli/execute.py", line 75, in flow_run
    environment.setup(flow)
AttributeError: 'NoneType' object has no attribute 'setup'
[2021-01-20 18:58:11,469] INFO - agent | Process PID 188 returned non-zero exit code
However, I can run it locally using flow.run() without issue. I can see in the code that environment is not set, but I don’t understand what I’m doing wrong… Thanks in advance!
c
Hi Robert - this appears to be a situation where your agent has an older version of Prefect, and your Flow is using a newer version. For Local Agents we recommend keeping those versions in sync — if you upgrade your agent I believe this will go away
r
@Chris White Thanks, I re-registered my flow with Prefect Cloud and the version listed in the UI changed from 0.13.x to 0.14.2 and now it works. My local prefect is also 0.14.2 so now I know. Thanks!
c
Anytime - glad I could help!