https://prefect.io logo
Title
v

Vadym Dytyniak

09/09/2022, 12:44 PM
I receive an error that agent can't create a queue even if it exists, I use service account API key with role member. Should it be role with more permissions?
m

Mason Menges

09/09/2022, 3:08 PM
Hey @Vadym Dytyniak would you be able to post the full error message and the command that's being run when trying to create the workqueue in this thread?
v

Vadym Dytyniak

09/09/2022, 3:10 PM
prefect agent start -q k8s-queue
Don't have full error message, but can get it if needed
it is what I have right now from infra team
Failed to create work queue 'k8s-queue'
m

Mason Menges

09/09/2022, 6:51 PM
Yeah the full error I think would be helpful here
v

Vadym Dytyniak

09/12/2022, 10:55 AM
@Mason Menges
10:55:12.585 | ERROR   | prefect.agent - Failed to create work queue 'k8s-queue'.                                                                                                                                      │
│ Traceback (most recent call last):                                                                                                                                                                                     │
│   File "/usr/local/lib/python3.10/site-packages/prefect/agent.py", line 88, in get_work_queues                                                                                                                         │
│     work_queue = await self.client.create_work_queue(name=name)                                                                                                                                                        │
│   File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 835, in create_work_queue                                                                                                                     │
│     response = await <http://self._client.post|self._client.post>("/work_queues/", json=data)                                                                                                                                                     │
│   File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1842, in post                                                                                                                                  │
│     return await self.request(                                                                                                                                                                                         │
│   File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1527, in request                                                                                                                               │
│     return await self.send(request, auth=auth, follow_redirects=follow_redirects)                                                                                                                                      │
│   File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 279, in send                                                                                                                                  │
│     response.raise_for_status()                                                                                                                                                                                        │
│   File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 225, in raise_for_status                                                                                                                      │
│     raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__                                                                                                                                              │
│ prefect.exceptions.PrefectHTTPStatusError: Client error '404 Not Found' for url '<https://api.prefect.cloud/api/accounts/60b38cc6-c00d-4e61-8757-f9a7fa6b6f90/workspaces/245aa934-2480-45c4-845e-2f66f1cdf298/work_queu> │
│ es/'                                                                                                                                                                                                                   │
│ Response: {'detail': 'Not Found'}
I think I know the issue
I didn't know that I have to attach service account to the workspace
Last question - what workspace role should I use for the agent service account? Collaborator?
m

Mason Menges

09/12/2022, 3:28 PM
Hey @Vadym Dytyniak Glad to hear you figured it out, yes Collaborator should be fine for the service account 😄
🙌 1
1