seeing this error on Prefect cloud when attempting...
# ask-community
k
seeing this error on Prefect cloud when attempting to programatically start a flow run. Our authentication tokens have not changed so I'm wondering if something happend?
Copy code
File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 978, in create_flow_run
    res = self.graphql(create_mutation, variables=dict(input=inputs))
  File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 275, in graphql
    result = <http://self.post|self.post>(
  File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 230, in post
    response = self._request(
  File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 373, in _request
    token = self.get_auth_token()
  File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 503, in get_auth_token
    self._refresh_access_token()
  File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 618, in _refresh_access_token
    payload = self.graphql(
  File "/usr/local/lib/python3.8/site-packages/prefect/client/client.py", line 294, in graphql
    raise ClientError(result["errors"])
prefect.utilities.exceptions.ClientError: [{'path': ['refresh_token'], 'message': 'Unauthorized', 'extensions': {'code': 'FORBIDDEN'}}]
n
Hi @kevin - how are you authenticating?
k
we're executing a login like this, passing some args to
login_to_tenant
Copy code
client = Client()
client.login_to_tenant()
n
Hm, you should be able to pass your service account API Key or user API key directly to
Client
and it should work
k
if I don't pass any args to the
Client()
constructor it should pick up the creds from my
.env
file right?
n
It should but this will tell us if the token you have is good or not
k
I think the issue is moot, I created a new token using the new web API UI rather than the Personal Access Tokens and the error seems to have stopped persisting
n
Interesting, thanks for reporting, I'll flag this for the team. Technically those tokens are being deprecated but I would expect them to still work
k
yea, I'm not entirely sure what happened, I wished I had more insight to help you triage but it seems everything's okay for now
n
No worries at all, thanks for the update!