Karolína Bzdušek
02/18/2021, 5:43 PMflow.storage = GitHub(repo="cividi/gemeinde_workflows",path="/workflows/residential_density.py",access_token_secret="GITHUB_ACCESS_TOKEN")
"GITHUB_ACCESS_TOKEN"
is stored in secret in Cloud.
However, when I run flow through UI, I am still getting this and not sure why.
Note: repository is private and own by our team, I am using token generated under my account.
What I am missing? Thanks for your help in advance.Zanie
Karolína Bzdušek
02/18/2021, 5:45 PMZanie
Karolína Bzdušek
02/18/2021, 5:53 PMZanie
flow.storage = Github(...)
code looks fine, it should workLocalAgent
?--env GITHUB_ACCESS_TOKEN=<your-token>
and see if that works?Karolína Bzdušek
02/18/2021, 5:55 PMLocalAgent
Zanie
if self.access_token_secret is not None:
# If access token secret specified, load it
access_token = Secret(self.access_token_secret).get()
else:
# Otherwise, fallback to loading from local secret or environment variable
access_token = prefect.context.get("secrets", {}).get("GITHUB_ACCESS_TOKEN")
if access_token is None:
access_token = os.getenv("GITHUB_ACCESS_TOKEN")
Karolína Bzdušek
02/18/2021, 5:57 PM--env GITHUB_ACCESS_TOKEN=<your-token>
, I have to go to call now, write later.prefect agent local start --env GITHUB_ACCESS_TOKEN=<token> --label <label1> --label <label2> --name "Local Agent"
And getting the very same log as beforeZanie
# Create a token at <https://github.com/settings/tokens> with repo scope access
TOKEN = ""
# Set your repo name
REPO = "PrefectHQ/acsfas"
# Ensure you have python github installed
# - pip install PyGithub
from github import Github
client = Github(TOKEN)
client.get_repo(REPO)
Karolína Bzdušek
02/18/2021, 8:28 PMTraceback (most recent call last):
File "residential_density.py", line 178, in <module>
client.get_repo(REPO)
File "/home/karolina/gemeinde_workflows/prefect/lib64/python3.8/site-packages/github/MainClass.py", line 345, in get_repo
headers, data = self.__requester.requestJsonAndCheck(
File "/home/karolina/gemeinde_workflows/prefect/lib64/python3.8/site-packages/github/Requester.py", line 315, in requestJsonAndCheck
return self.__check(
File "/home/karolina/gemeinde_workflows/prefect/lib64/python3.8/site-packages/github/Requester.py", line 340, in __check
raise self.__createException(status, responseHeaders, output)
github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "<https://docs.github.com/rest/reference/repos#get-a-repository>"}
Zanie
Karolína Bzdušek
02/18/2021, 8:40 PMZanie
curl
or something to hit the API (https://docs.github.com/en/rest/reference/repos#get-a-repository) to ensure the token is functioning as expected and eliminate more variables.