Hi - I got an error message in Prefect Cloud `Fail...
# prefect-community
i
Hi - I got an error message in Prefect Cloud
Failed to load and execute Flow's environment: SyntaxError("invalid or missing encoding declaration for '/home/.../MOC/etl_moc.py'")
-After the flow began and executed some tasks successfully. The flow was run locally. Is this a bug or something not configured correctly on my end? Thanks
c
Hi itay - it’s hard to say for sure, but this appears to be an issue with the Flow’s storage configuration. Could you share some reproducible code?
i
Reproducible flow code? As for storage this is the config
Copy code
etl_moc_flow.storage = Local(
    labels=["scrape-moc"],
    path="/home/itay/MOC/etl_moc.py",
)
c
gotcha, if you are storing your flow as a
.py
script you additionally need to specify
stored_as_script=True
i
Ok will try it --- But why did the same flow run fine yesterday? And why does it decide on this error in the middle or end of a script?
c
too many unknowns for me to say - something must have changed; also not sure what you mean by “middle or end of a script” - loading the flow’s environment is the first step in running the flow, which is when I would expect this error to get raised
i
Loading the flow’s environment is the first step in running the flow, which is when I would expect this error to get raised
I agree with that statement - what surprises me is that is happens on a terminal task or task with an upstream edge and downstream edge.