https://prefect.io logo
#prefect-community
Title
# prefect-community
f

Frederick Thomas

04/27/2022, 5:39 PM
I have some weirdness going on with a flow that pulls from Azure secrets into the prefect.config object(?) Anyways, the main issue is that the code gives this error
File "/mnt/data/prefect/venv/lib/python3.8/site-packages/box/box.py", line 490, in __getattr__
raise BoxKeyError(str(err)) from None
box.exceptions.BoxKeyError: "'Config' object has no attribute 'staging_db_constring'"
However if I attempt to print out the config object the code works as expected. I haven't touched the config.toml file and Googling hasn't helped. Any help would be appreciated. Thanks
k

Kevin Kho

04/27/2022, 5:44 PM
I am pretty confused what is going on here. How does it pull from Azure secrets into
prefect.config
? Do you have a task that pulls and then tries to set the value?
f

Frederick Thomas

04/27/2022, 5:44 PM
Yes!!
Hi btw
k

Kevin Kho

04/27/2022, 5:46 PM
I think what is happening is you are mutating the config in a task and calling it in a downstream task. The config/context can’t be mutated like this. Mutations to it don’t persist outside the current task. So you need to explicitly pass that secret downstream. The way to persist data is the KV Store but that is not really meant to be sure so you pretty much need to pass it
And hello! 👋
f

Frederick Thomas

04/27/2022, 5:52 PM
I'll look at it and see what I find. Thanks!!
3 Views