https://prefect.io logo
n

nicholasnet

07/12/2023, 4:56 PM
Good morning, I am getting
403
when I am trying to update the deployment all of a sudden.
Copy code
Deployment YAML created at '/var/app/load_bullhorn_data-deployment.yaml'.
Deployment storage None does not have upload capabilities; no files uploaded.  
Pass --skip-upload to suppress this warning.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 255, in coroutine_wrapper
    return call()
           ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 383, in __call__
    return self.result()
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 283, in result
    return self.future.result(timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 169, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 346, in _run_async
    result = await coro
             ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/cli/deployment.py", line 1210, in build
    deployment_id = await deployment.apply()
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/deployments/deployments.py", line 739, in apply
    await client.delete_resource_owned_automations(
  File "/usr/local/lib/python3.11/site-packages/prefect/client/orchestration.py", line 2527, in delete_resource_owned_automations
    await self._client.delete(f"/automations/owned-by/{resource_id}")
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1952, in delete
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 280, in send
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 138, in raise_for_status
    raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '***/automations/owned-by/prefect.deployment.db3765f1-ed5d-42f6-82ac-217dcbbe63e7'
Response: {'detail': 'Forbidden'}
Even though this user have deployment edit permission.
c

Christopher Boyd

07/12/2023, 5:01 PM
Hey Nicholas - it looks like it might be an issue with your API key perhaps? would you midn verifying with this against the same account / workspace? https://discourse.prefect.io/t/how-can-i-tell-if-there-is-an-issue-with-my-api-key/2185
n

nicholasnet

07/12/2023, 5:04 PM
thanks let me try that I will let you know.
Where do I get the account info?
However, when I do
prefect cloud login -k <KEY>
it works and I am logged in.
ok I found it.
I am getting 200 response so looks like key is not an issue.
c

Christopher Boyd

07/12/2023, 5:16 PM
gotcha - and that’s the same exact user right? that is trying to take the action with the deployment?
n

nicholasnet

07/12/2023, 5:17 PM
yes
c

Christopher Boyd

07/12/2023, 5:17 PM
hrmm
n

nicholasnet

07/12/2023, 5:17 PM
Was working well yesterday.
Running the job again 🤞
c

Christopher Boyd

07/12/2023, 5:18 PM
Copy code
File "/usr/local/lib/python3.11/site-packages/prefect/deployments/deployments.py", line 739, in apply
    await client.delete_resource_owned_automations(
it looks it’s maybe doing a delete operation in the output?
which is missing perms?
what happens if you add that perm just even temporarily?
n

nicholasnet

07/12/2023, 5:18 PM
ok let me add that.
ok Delete permission is added now.
lets see
c

Christopher Boyd

07/12/2023, 5:19 PM
ahh
No I see it
it’s the automation
not the deployment
You are missing perms to edit the automation which is the failure:
Copy code
prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '***/automations/owned-by/prefect.deployment.db3765f1-ed5d-42f6-82ac-217dcbbe63e7'
n

nicholasnet

07/12/2023, 5:20 PM
hmm but I am not editing any automation here though.
ok added that let me retry.
Yeah that was it thank you. But I am confused why it needs that permission now all of a sudden.
c

Christopher Boyd

07/12/2023, 5:36 PM
Were there automations attached to that deployment before?
n

nicholasnet

07/12/2023, 5:36 PM
No
c

Christopher Boyd

07/12/2023, 5:36 PM
interesting, I don’t know the code path, I can ask the engineering team
n

nicholasnet

07/12/2023, 5:40 PM
ok thank you very much. I really appreciate your quick response.