Brad I
07/07/2021, 1:12 AMfailed to authenticate, missing token
. It works if I set the key in both variables, is this expected?
env:
- name: PREFECT__CLOUD__AGENT__AUTH_TOKEN
value: XXXXXXXX
- name: PREFECT__CLOUD__API
value: <https://api.prefect.io>
- name: PREFECT__BACKEND
value: cloud
- name: PREFECT__CLOUD__API_KEY
value: XXXXXXXX
- name: PREFECT__CLOUD__TENANT_ID
value: TTTTTTTT
image: prefecthq/prefect:0.15.0-python3.7
Kevin Kho
Zanie
Brad I
07/07/2021, 3:20 PMFailed to verify authentication
Tyler Wanner
07/07/2021, 3:20 PMZanie
# Verify API tokens -- API keys do not need a type-check
if config.backend == "cloud" and not self.client.api_key:
self.logger.debug("Verifying authentication with Prefect Cloud...")
try:
self._verify_token(self.client.get_auth_token())
self.logger.debug("Authentication successful!")
except Exception as exc:
self.logger.error("Failed to verify authentication.")
raise RuntimeError(
f"Error while contacting API at {config.cloud.api}",
) from exc
Zanie
not self.client.api_key
Brad I
07/07/2021, 3:26 PMPREFECT__CLOUD__AGENT__AUTH_TOKEN
env var completely removed and with it set to an empty string, received the same error message for both variations. That looks like the same code I found when googling the error message, I didn’t have to change my API_KEY var to make it work so I’m not sure why that block executed. I can try it again at some point today when I spin up our prod agent.Zanie
Zanie
Zanie
Zanie
Brad I
07/07/2021, 6:09 PM