https://prefect.io logo
#prefect-server
Title
# prefect-server
p

Peyton Runyan

02/01/2021, 1:10 PM
Hi all, I'm having a bit of trouble getting prefect server to work with github. The environment variable where the agent is running is set
PREFECT__CONTEXT__SECRETS__GITHUB_ACCESS_TOKEN= <my_token>
The flow is
Copy code
storage = GitHub(
    repo="my_repo",
    path="simple_flow.py",
    secrets=["GITHUB_ACCESS_TOKEN"]
)

with Flow("github_flow", storage=storage) as f:
If I remove storage and run it, it runs fine. With storage, it hangs indefinitely on
scheduled
. Any ideas?
Following up on this, I've confirmed that the prefect context does have the correct token, and that the token can be used to access the repo in a separate py file.
k

Kyle Moon-Wright

02/01/2021, 5:59 PM
Hmm, if the flow is hanging in a Scheduled State, Iā€™d make sure your Agent is able to pick up the flow by checking both flow/Agent labels and that the Agent has the ability to retrieve the code from your repo, in terms of outbound network access for runtime retrieval. If the flow is working without this Storage method, then Local Storage is working as intended, but one of those other ^ options is potentially blocking execution. There are some additional tips here.
šŸ™ 1
p

Peyton Runyan

02/01/2021, 7:13 PM
Turns out it was in fact a labels issue. Using no labels for either the run or the agent caused it to hang, but adding a matching label to each got it working.
@Kyle Moon-Wright that's twice you've helped me today. Do you have a buy you a beer/coffee link? You've saved me an incredible headache
k

Kyle Moon-Wright

02/01/2021, 7:19 PM
Yes, I accept
${mode}coin
as well as
${cashmoney}
āœ… 1
Haha, no problem at all! Iā€™m happy to help. šŸ‘