Thread
#prefect-community
    kevin

    kevin

    1 year ago
    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?
    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'}}]
    nicholas

    nicholas

    1 year ago
    Hi @kevin - how are you authenticating?
    kevin

    kevin

    1 year ago
    we're executing a login like this, passing some args to
    login_to_tenant
    client = Client()
    client.login_to_tenant()
    nicholas

    nicholas

    1 year ago
    Hm, you should be able to pass your service account API Key or user API key directly to
    Client
    and it should work
    kevin

    kevin

    1 year ago
    if I don't pass any args to the
    Client()
    constructor it should pick up the creds from my
    .env
    file right?
    nicholas

    nicholas

    1 year ago
    It should but this will tell us if the token you have is good or not
    kevin

    kevin

    1 year ago
    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
    nicholas

    nicholas

    1 year ago
    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
    kevin

    kevin

    1 year ago
    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
    nicholas

    nicholas

    1 year ago
    No worries at all, thanks for the update!