Zhibin Dai
02/24/2022, 12:49 AMKevin Kho
from prefect.client import Secret
Secret("GITHUB_ACCESS_TOKEN").get()
and then print that to see if you can retrieve it?Zhibin Dai
02/24/2022, 1:38 AMFLOW_NAME = "02_dbt_staging"
GITHUB_ACCESS_TOKEN = PrefectSecret('GITHUB_ACCESS_TOKEN')
STORAGE = GitHub(
repo="",
path=f"flows/ppi/{FLOW_NAME}.py",
access_token_secret=GITHUB_ACCESS_TOKEN
)
Kevin Kho
PrefectSecret('GITHUB_ACCESS_TOKEN')
is evaluated during the Flow run because it is a task so you should only use it inside Flows. You can use Secret.get()
here insteadZhibin Dai
02/24/2022, 1:43 AM└── 20:41:03 | ERROR | Failed to load and execute Flow's environment: KeyError('The secret ghp_R... was not found. Please ensure that it was set correctly in your tenant: <https://docs.prefect.io/orchestration/concepts/secrets.html>')
GITHUB_ACCESS_TOKEN = Secret("GITHUB_ACCESS_TOKEN").get()
STORAGE = GitHub(
repo="",
path=f"flows/ppi/{FLOW_NAME}.py",
access_token_secret=GITHUB_ACCESS_TOKEN
)
Kevin Kho
access_token_secret
takes in a stringaccess_token_secret="GITHUB_ACCESS_TOKEN"
and then Prefect will fetch the secret for you. Just take out the line that uses the StringZhibin Dai
02/24/2022, 1:50 AMFailed to load and execute Flow's environment: UnknownObjectException(404, {'message': 'Not Found', '
Kevin Kho
""
or you took it out just to paste the code? What is FLOW_NAME
in that script?Zhibin Dai
02/24/2022, 2:03 AMKevin Kho
Zhibin Dai
02/24/2022, 2:10 AMKevin Kho
ref
keyword in Github storageZhibin Dai
02/24/2022, 2:11 AMKevin Kho