Prefect-worker pod fails with error - 405 Method Not Allowed

We are hosting prefect2 using helm charts on AKS. However the worker pod fails due to the below error

  File "/usr/local/lib/python3.11/site-packages/prefect/client/", line 275, in send
  File "/usr/local/lib/python3.11/site-packages/prefect/client/", line 135, in raise_for_status
    raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '405 Method Not Allowed' for url 'https://prefect2-url/api/work_pools/'
Response: {'detail': 'Method Not Allowed'}
For more information check:
An exception occurred.

We have only updated the below config in the values.yaml:

  apiConfig: "server"

    # -- prefect account ID
    accountId: ""
    # -- prefect workspace ID
    workspaceId: ""

      # -- prefect API secret name
      name: prefect-api-key
      # -- prefect API secret key
      key: key

    # -- prefect cloud API url; the full URL is constructed as https://cloudUrl/accounts/accountId/workspaces/workspaceId

    # -- prefect API url (PREFECT_API_URL); should be in-cluster URL if the agent is deployed in the same cluster as the API
    apiUrl: https://prefect2-url/api

Did you fix this error?

I am also having the same issue when deployed using Helm and setting the API config type to “server”

Hi @dasarpmar,

Could you check that your API URL is correct?