https://prefect.io logo
Title
a

Adam Roderick

03/07/2022, 6:06 PM
Hi, after upgrading to prefect 1.0 we are seeing this warning during our deployments
...venv/lib/python3.8/site-packages/prefect/client/client.py:848: UserWarning: A flow with the same name is already contained in storage; if you changed your Flow since the last build, you might experience unexpected issues and should re-create your storage object.
I don't understand why we see that, because, we create a new Docker storage object on every deployment
flow.storage = Docker(....)
Can anyone explain what this error means, or how to address it?
k

Kevin Kho

03/07/2022, 6:08 PM
What did you upgrade from? Nothing rings a bell around this. How do you register also?
a

Adam Roderick

03/07/2022, 6:09 PM
It's been a while 0.14 I believe
flow.register(
        project_name=client_code,   
        labels=[environment, client_code],
    )
k

Kevin Kho

03/07/2022, 6:11 PM
Can I see the storage definition?
a

Adam Roderick

03/07/2022, 6:38 PM
sure
flow.storage = Docker(
        registry_url=image_registry_url(),
        python_dependencies=["boto3"],
        dockerfile=dockerfile_path,
        image_tag="latest",
        env_vars={
            "DATATEER_ENV": environment,
        },
        build_kwargs={
            "buildargs": {
                "MELTANO_DATABASE_URI": os.getenv("MELTANO_DATABASE_URI"),
                "DEPLOY_KEY_PREFECT_LIB": deploy_key_prefect_lib,
            }
        },
    )
I also noticed in the last run it appears that the docker build is running twice--that might explain the warning. I'm digging to see if something in our script might be triggering a second build
give me a moment to look there
k

Kevin Kho

03/07/2022, 6:42 PM
Ohh I see. It all looks good here.
a

Adam Roderick

03/07/2022, 9:37 PM
Confirmed, there was a path in the build script that could attempt to register twice. Thanks @Kevin Kho
k

Kevin Kho

03/07/2022, 9:38 PM
Ah ok. Glad you figured it out