Billy McMonagle
08/11/2021, 3:19 PMBilly McMonagle
08/11/2021, 3:19 PM│ [2021-08-11 15:18:35,139] ERROR - agent | Failed to verify authentication. │
│ /usr/local/lib/python3.7/site-packages/prefect/client/client.py:171: UserWarning: Client was created with an API token configured for authentication. API tokens are deprecated, │
│ "Client was created with an API token configured for authentication. " │
│ Traceback (most recent call last): │
│ File "/usr/local/lib/python3.7/site-packages/prefect/agent/agent.py", line 901, in _setup_api_connection │
│ self._verify_token(self.client.get_auth_token()) │
│ File "/usr/local/lib/python3.7/site-packages/prefect/agent/agent.py", line 839, in _verify_token │
│ raise AuthorizationError("Provided token does not have a RUNNER scope.") │
│ prefect.exceptions.AuthorizationError: Provided token does not have a RUNNER scope.
Billy McMonagle
08/11/2021, 3:21 PMKevin Kho
Billy McMonagle
08/11/2021, 3:37 PMspec:
containers:
- name: agent
image: {{ .Values.agent.image }}
args:
- prefect agent kubernetes start
command:
- /bin/bash
- -c
env:
- name: PREFECT__CLOUD__AGENT__AUTH_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}
key: prefect_api_key
Mariia Kerimova
08/11/2021, 3:51 PMkubectl exec -it <pod name> -- env
) and verify that PREFECT__CLOUD__AGENT__AUTH_TOKEN
is set with a new service account key?Billy McMonagle
08/11/2021, 4:07 PMBilly McMonagle
08/11/2021, 4:10 PMprefect_runner_token
to prefect_api_key
so I know it is using the latest configuration. additionally, i have inspected the externalsecret
to verify that it's pointing at the correct key in our secret store (AWS SSM).Billy McMonagle
08/11/2021, 4:11 PMBilly McMonagle
08/11/2021, 4:19 PMBilly McMonagle
08/11/2021, 4:20 PM❯ prefect auth login -t <TOKEN>
WARNING: You logged in with an API key using the `--token` flag which is deprecated. Please use `--key` instead.
❯ python
>>> from prefect.client import Client
>>> client = Client()
>>> client.graphql(query="query { auth_info { api_token_scope } }")
{
"data": {
"auth_info": {
"api_token_scope": "RUNNER"
}
}
}
key
❯ prefect auth login --key <KEY>
❯ python
>>> from prefect.client import Client
>>> client = Client()
>>> client.graphql(query="query { auth_info { api_token_scope } }")
{
"data": {
"auth_info": {
"api_token_scope": null
}
}
}
Billy McMonagle
08/11/2021, 5:04 PMPREFECT__CLOUD__AGENT__API_KEY
instead of PREFECT__CLOUD__AGENT__AUTH_TOKEN
... let's see if that makes a difference.Billy McMonagle
08/11/2021, 5:08 PMMariia Kerimova
08/11/2021, 5:11 PMPREFECT__CLOUD__AGENT__AUTH_TOKEN
variable should have worked, but looks like it wasn't working for you. I'll open a ticket if neededBilly McMonagle
08/11/2021, 5:11 PMBilly McMonagle
08/11/2021, 5:12 PM│ ERROR:agent:Error while managing existing k8s jobs
│ Traceback (most recent call last):
│ File "/usr/local/lib/python3.7/site-packages/prefect/agent/kubernetes/agent.py", line 400, in heartbeat
│ self.manage_jobs()
│ File "/usr/local/lib/python3.7/site-packages/prefect/agent/kubernetes/agent.py", line 275, in manage_jobs
│ timestamp=event.last_timestamp.isoformat(),
│ File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 1985, in write_run_logs
│ mutation, variables=dict(input=dict(logs=logs))
│ File "/usr/local/lib/python3.7/site-packages/prefect/client/client.py", line 564, in graphql
│ raise ClientError(result["errors"])
│ prefect.exceptions.ClientError: [{'path': ['write_run_logs'], 'message': 'Unauthorized', 'extensions': {'code': 'FORBIDDEN'}}]
Mariia Kerimova
08/11/2021, 5:18 PMBilly McMonagle
08/11/2021, 5:20 PMwrite_run_logs
seems to be the issue?Mariia Kerimova
08/11/2021, 5:29 PMBilly McMonagle
08/11/2021, 5:30 PMBilly McMonagle
08/11/2021, 5:31 PM