https://prefect.io logo
l

Leon Kozlowski

09/12/2022, 7:55 PM
Hi all, I’m try to deploy an orion agent - I’m getting the following error:
Copy code
prefect.exceptions.PrefectHTTPStatusError: Client error '404 Not Found' for url '<https://api.prefect.cloud/work_queues/>'
Not sure if I have my api url wrong or some other configuration incorrect
1
It first failed when trying to create a work queue:
Copy code
19:51:19.313 | ERROR   | prefect.agent - Failed to create work queue 'dev'.
s

Serina

09/12/2022, 7:59 PM
I think it might need to be in this format:
'<https://api.prefect.cloud/api/accounts/abc-123-456/workspaces/xyz-987-654>'
l

Leon Kozlowski

09/12/2022, 7:59 PM
I’m not making this api call
Copy code
spec:
      containers:
      - name: agent
        command: [ "prefect", "agent", "start", "-q", "dev" ]
I’m using a helm chart to deploy the agent
(btw im on verison 2.3.0)
Full traceback:
Copy code
agent Starting v2.3.0 agent connected to <https://api.prefect.cloud>...
agent
agent   ___ ___ ___ ___ ___ ___ _____     _   ___ ___ _  _ _____
agent  | _ \ _ \ __| __| __/ __|_   _|   /_\ / __| __| \| |_   _|
agent  |  _/   / _|| _|| _| (__  | |    / _ \ (_ | _|| .` | | |
agent  |_| |_|_\___|_| |___\___| |_|   /_/ \_\___|___|_|\_| |_|
agent
agent
agent Agent started! Looking for work from queue(s): dev...
agent 19:51:19.313 | ERROR   | prefect.agent - Failed to create work queue 'dev'.
agent Traceback (most recent call last):
agent   File "/usr/local/lib/python3.10/site-packages/prefect/agent.py", line 88, in get_work_queues
agent     work_queue = await self.client.create_work_queue(name=name)
agent   File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 835, in create_work_queue
agent     response = await <http://self._client.post|self._client.post>("/work_queues/", json=data)
agent   File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1842, in post
agent     return await self.request(
agent   File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1527, in request
agent     return await self.send(request, auth=auth, follow_redirects=follow_redirects)
agent   File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 279, in send
agent     response.raise_for_status()
agent   File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 225, in raise_for_status
agent     raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
agent prefect.exceptions.PrefectHTTPStatusError: Client error '404 Not Found' for url '<https://api.prefect.cloud/work_queues/>'
agent For more information check: <https://httpstatuses.com/404>
z

Zanie

09/12/2022, 8:04 PM
What is your
PREFECT_API_URL
set to in the agent’s container? Serina is correct that it appars to be incorrectly specified.
You can see the value you should use by running
prefect cloud login --key …
then
prefect config view
l

Leon Kozlowski

09/12/2022, 8:05 PM
l

Leon Kozlowski

09/12/2022, 8:06 PM
Ah
Let me try that
z

Zanie

09/12/2022, 8:07 PM
@Serina can you look into adding documentation for this? Some inline comments there would probably be helpful in addition to a prose guide.
👍 1
l

Leon Kozlowski

09/12/2022, 8:08 PM
These values aren’t considered secrets are they?
c

Christopher Boyd

09/12/2022, 8:10 PM
your workspace / account are sensitive, but not exactly secrets
your API key is secret
l

Leon Kozlowski

09/12/2022, 8:10 PM
Right
c

Christopher Boyd

09/12/2022, 8:10 PM
generally, by default if you’re deploying with a helm chart, values.yaml should be checked for default overriding behavior, in this case, everyones API url will be different, and should be set at runtime, they will never match per person
👍 1
l

Leon Kozlowski

09/12/2022, 8:50 PM
I’ve made the change in my configmap, but it looks like since the deployment was unchanged the process is still restarting
c

Christopher Boyd

09/12/2022, 8:52 PM
Hi Leon, I would recommend tearing down the helm install, and installing fresh, supplying it with values.yaml, or even overriding it with a custom <something.yaml> and passing it in directly
I don’t think I’ve ever personally had to update the configmap
These are configured using the prefect agent manifest (not helm), but the end result is the same with the deployment
l

Leon Kozlowski

09/12/2022, 9:00 PM
I just restarted the deployment, it looks good now
thanks all - appreciate the help
🎉 1
3 Views