Hi! I see a very weird issue, where I can fetch the Secret locally fine, but when I register the flow, it failed for the Secret not exist in local error:
Copy code
ValueError: Local Secret "CRITEO_SECRET_KEEPS" was not found.
Is there any possible reasons? I clearly defined the secret in local config file.
Tony Yun
09/28/2021, 7:13 PM
I also have the secret defined on Cloud as well btw.
k
Kevin Kho
09/28/2021, 7:14 PM
Can you try setting
"PREFECT__CLOUD__USE_LOCAL_SECRETS" = "true"
?
Kevin Kho
09/28/2021, 7:15 PM
Oh wait this is different one sec
Kevin Kho
09/28/2021, 8:02 PM
Ok I tried it with a Docker Storage
Copy code
from prefect import Flow, task
from prefect.client.secrets import Secret
from prefect.storage import Docker
storage = Docker(base_image="prefecthq/prefect:0.15.5-python3.8")
x = Secret("TEST").get()
@task
def abc():
x = Secret("TEST").get()
return x
with Flow("test", storage=storage) as flow:
abc(x)
flow.register("dsdc")
and it’s working fine. I think at this point, I might need a reproducible example (or you can share you code with me privately if you are comfortable and I can try to re-create the structure)
t
Tony Yun
09/28/2021, 8:03 PM
ok! I’ll try get you a reproducible code when I have
Tony Yun
09/29/2021, 8:30 PM
As a note of record, I solved this issue by moving this line from the parent level of the .py file into a function and then it worked:
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.