Nelson Griffiths
03/23/2022, 1:20 PMTraceback (most recent call last):
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/cli/base.py", line 59, in wrapper
return fn(*args, **kwargs)
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/utilities/asyncio.py", line 120, in wrapper
return run_async_in_new_loop(async_fn, *args, **kwargs)
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/utilities/asyncio.py", line 67, in run_async_in_new_loop
return anyio.run(partial(__fn, *args, **kwargs))
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/anyio/_core/_eventloop.py", line 56, in run
return asynclib.run(func, *args, **backend_options)
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 233, in run
return native_run(wrapper(), debug=debug)
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 228, in wrapper
return await func(*args)
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/cli/agent.py", line 71, in start
await agent.get_and_submit_flow_runs()
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/agent.py", line 88, in get_and_submit_flow_runs
submittable_runs = await self.client.get_runs_in_work_queue(
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/client.py", line 747, in get_runs_in_work_queue
response = await <http://self._client.post|self._client.post>(
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/utilities/httpx.py", line 137, in post
return await self.request(
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/prefect/utilities/httpx.py", line 80, in request
response.raise_for_status()
File "/home/nelson/miniconda3/envs/my_project/lib/python3.9/site-packages/httpx/_models.py", line 1510, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '403 Forbidden' for url '<https://api-beta.prefect.io/api/accounts/df4b7089-cc2a-48ae-b4ce-baea44b163d6/workspaces/b22af91f-f810-4bc3-ac90-a1fa0e042c55/work_queues/c91e1439-be7e-4a98-8df0-da39515197b2/get_runs>'
For more information check: <https://httpstatuses.com/403>
An exception occurred.
Any ideas what might be causing this?Kevin Kho
03/23/2022, 1:22 PMAnna Geller
03/23/2022, 1:37 PMDeploymentSpec(
name="example",
flow=docker_flow,
tags=["local"],
flow_runner=DockerFlowRunner(
image="prefecthq/prefect:2.0ba2-python3.9",
env={
"EXTRA_PIP_PACKAGES": "pandas",
"PREFECT_API_KEY": "xxx",
},
volumes=["/Users/anna/.aws:/root/.aws"],
),
)
Kubernetes:
DeploymentSpec(
name="prod",
flow=kubernetes_flow,
tags=["local"],
flow_runner=KubernetesFlowRunner(
env=dict(
PREFECT_API_URL="<https://api-beta.prefect.io/api/accounts/yyy/workspaces/xxx>",
PREFECT_API_KEY="YOUR_API_KEY",
),
),
)
DeploymentSpec(
name="cloud",
flow=universal_flow,
tags=["local"],
flow_runner=UniversalFlowRunner(
env=dict(
PREFECT_API_URL="<https://api-beta.prefect.io/api/accounts/yyy/workspaces/xxx>",
PREFECT_API_KEY="YOUR_API_KEY",
),
),
)
Kevin Kho
03/23/2022, 2:04 PMNelson Griffiths
03/23/2022, 2:21 PMDeploymentSpec(flow=ingest_tweets,
name="udot-data-collection",
parameters={"username": "UDOTTRAFFIC", "lookback_days": 1},
tags=["db", "local"],
schedule=IntervalSchedule(interval=timedelta(minutes=5)))
Anna Geller
03/23/2022, 2:35 PMSubprocessFlowRunner
Nelson Griffiths
03/23/2022, 2:36 PMAnna Geller
03/23/2022, 2:41 PMflow_runner=UniversalFlowRunner(
env=dict(
PREFECT_API_URL="<https://api-beta.prefect.io/api/accounts/yyy/workspaces/xxx>",
PREFECT_API_KEY="YOUR_API_KEY",
),
),
I saw a similar error with the Docker flow runner and I assumed that this container (sub)process didn't get the API key... I'll ask the team about this but this is worth tryingNelson Griffiths
03/23/2022, 2:54 PMKevin Kho
03/23/2022, 4:05 PMNelson Griffiths
03/23/2022, 4:06 PMKevin Kho
03/24/2022, 1:26 AMNelson Griffiths
03/24/2022, 4:41 PMKevin Kho
03/24/2022, 4:44 PMNelson Griffiths
03/24/2022, 4:46 PMKevin Kho
03/25/2022, 3:26 AMNelson Griffiths
04/02/2022, 1:09 PMAnna Geller
04/02/2022, 8:28 PMNelson Griffiths
04/09/2022, 7:58 PMAnna Geller
04/09/2022, 11:23 PMprefect config set PREFECT_LOGGING_LEVEL='DEBUG'
#2 To check if the agent process is running, you can inspect your running processes on the instance:
ps -ef | grep "prefect agent start"
But the easiest way is to inspect the work queue the agent polls for:
prefect work-queue inspect 'acffbcc8-ae65-4c83-a38a-96e2e5e5b441'