I have an issue with File based flow storage. I fo...
# prefect-community
k
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?
prefect cloud 1
j
Hi @Klemen Strojan the command is
Copy code
prefect register flow -f ...
For the module not found error, which agent are you using to run this flow?
k
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:
Copy code
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
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
I was missing extras, a clean
pip install "prefect[github]"
changed the error to
Copy code
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
Great!