flavienbwk
10/10/2020, 12:03 AMFailed to load and execute Flow's environment: ModuleNotFoundError("No module named '/root/'")
I don't understand the problem as I don't have any relative import in my code and the latter is pretty simple : https://github.com/flavienbwk/prefect-docker-compose/blob/main/scripts/weather.pyChris White
flavienbwk
10/10/2020, 12:14 AM/root/.prefect/flows
) ?Chris White
path
is displayed; so my rough takeaway is that your agent is looking for your Flow in a path that is /root/.prefect/flows
but unable to access that, but I can’t 100% explain it. If you exec into your agent’s docker container, can you confirm that the flow exists at the right location?flavienbwk
10/10/2020, 12:19 AM/root/.prefect/flows
directory didn't even exist. I created it, re-run the flow and am still having the same error.
Nothing is present in the /root/.prefect/flows
directory.Chris White
prefect execute flow-run
to run in a subprocess
- this code is then run, which is where your error arises from: https://github.com/PrefectHQ/prefect/blob/master/src/prefect/cli/execute.py#L74-L93
Here’s how you might drill down into what step is failing:
- change the labels on your Flow in the UI (so your agent won’t pick anything up), and create a new flow run
- within your agent’s docker container, run each of the python commands in that file I linked to, starting with this line: https://github.com/PrefectHQ/prefect/blob/master/src/prefect/cli/execute.py#L56
My guess is that you’ll see this error arise either at this line:
flow = storage.get_flow(storage.flows[flow_data.name])
/root/.prefect/flows
prefect.core.flow.Flow.load(flow_location)
with your Flow’s locationflavienbwk
10/10/2020, 12:33 AM/root/.prefect/flows
. Is it correct ?Chris White
flavienbwk
10/10/2020, 12:39 AME*xecution in your cloud; orchestration in ours*Yeah it's not very easy to understand and maybe the documentation should include a step by step guide to understand how Prefect's storage system work. But I'm convinced it's a bright idea, so I will deep dive into the documentation and try to understand more about Prefect storage system.