https://prefect.io logo
Title
k

Klemen Strojan

06/30/2020, 5:35 AM
I have an issue with File based flow storage. I followed the instructions (https://docs.prefect.io/core/idioms/file-based.html) and could not register the flow with
prefect register -f flows/my_flow.py
. I got an error
Error: no such option: -f
. When I register the flow with
flow.register()
it becomes available in UI but I am unable to run it, the tasks are pending and I can see this error
Failed to load and execute Flow's environment: ModuleNotFoundError("No module named 'github'")
. I am using
0.12.1
and Cloud. Any ideas?
😛refect-cloud: 1
j

josh

06/30/2020, 11:37 AM
Hi @Klemen Strojan the command is
prefect register flow -f ...
For the module not found error, which agent are you using to run this flow?
k

Klemen Strojan

06/30/2020, 11:52 AM
Hi @josh, thanks for the proper command, my bad. I am using a local agent running on my mac, but I also have two existing agents running on Linux machines with older versions of Prefect. I am registering the flow like this:
prefect auth login -t $prefect_user_token
prefect register flow -f flows/my_flow.py --project Dev_project
prefect agent start -t $prefect_runner_token
Should I specify the agent somehow?
j

josh

06/30/2020, 11:55 AM
Is there a chance the older agents picked up the flow run? That ModuleNotFoundError looks to be that the flow was either picked up by an agent that is running on an older version of prefect or the flow was deployed by an agent in an environment that doesn’t have prefect’s
github
extras installed.
👍 1
k

Klemen Strojan

06/30/2020, 12:08 PM
I was missing extras, a clean
pip install "prefect[github]"
changed the error to
Failed to load and execute Flow's environment: UnknownObjectException(404, {'message': 'Not Found', 'documentation_url': '<https://developer.github.com/v3/repos/#get'}>)
pointing me to GitHub API docs. I had to set proper permissions for Access Token (repo), and now it works 🙂 Thanks!
j

josh

06/30/2020, 12:08 PM
Great!