Hi, I am trying to set up a flow with Azure storag...
# ask-community
j
Hi, I am trying to set up a flow with Azure storage and AKS for the agent and cloud server. The flow registers but when I try to quick run it I get the error 'Failed to load and execute Flow's environment: AttributeError("'NoneType' object has no attribute 'rstrip'") - not sure what I am doing wrong
y
Hi Jai, this seems like a configuration problem with Storage and execution. May I ask what execution environment did you use? (Docker, k8s, or local machine)
j
I am using AKS - azure kubernetes service
That creates the agent but the flow is stored as an azure blob on azure storage
y
Got it, using agents with AKS and the execution is on Azure Cloud
There’s two potential issues I’d like to explore more, 1. Some tasks involved with a relative path, which cause the error when the agents is running in different file path. (not in your root directory) - this can be fixed by getting rid of relative path 2. The storage didn’t load in successfully, so you used local storage by accident. *less likely to be true since you used Azure storage, should be easy to verify if the Azure storage is working!
Maybe a good way to investigate is to check where did you call
.rstrip
? That object seems to be None, so some upstream operation with that object doesn’t work as exepected
Let me know what you think 🙂 some Prefect folks like @Kevin Kho can jump in as well when ET work hours starts
j
I don't actually use .rstrip at all - that probably some internal prefect routine
y
Hey Jai - good point, that’s something from Prefect. I found a relevant issue that has similar problem - @ciaran mentioned a solution of putting the azure storage in RunConfig to solve this problem:
Copy code
run_config=KubernetesRun(
    image="prefecthq/prefect:0.14.17-python3.8",
    env={"AZURE_STORAGE_CONNECTION_STRING": os.environ["FLOW_STORAGE_CONNECTION_STRING"]},
    labels=json.loads(os.environ["PREFECT__CLOUD__AGENT__LABELS"]),
),
Do you think that could be a promising solution?
j
Hi Yueh - that worked !!! Thank you so much