#Secret Not Found after upgrading to 0.10.0

1 messages · Page 1 of 1 (latest)

dark vale
#

Hello, after upgrading to 0.10.0, my pipeline no longer works. It breaks in secret. WHat could be the reason?

 ERROR: secret 3665363537343732363362363133363739613038313464396563373732663935643737386333356663356666313639376334393337313536353363366337313231343432393263356164b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad: not found
#

Secret Not Found after upgrading to 0.10.0

#

my code looks like this

    netrc = client.set_secret("netrc", to_netrc(url, username or "", password or ""))

    clone = ["git", "clone", "--recursive"]
    if ref:
        clone.extend(["-b", ref])
    clone.extend([url, "."])

    container = (
        client.container()
        .from_("alpine/git")
        .with_env_variable("__CLONE_ID__", clone_id or str(time.time_ns()))
        .with_workdir("/src")
        .with_mounted_secret("/root/.netrc", netrc)
        .with_exec(clone, skip_entrypoint=True)
        .with_exec(["git", "rev-parse", "HEAD"], skip_entrypoint=True)
    )
wicked axle
dark vale
#

thanks @wicked axle

wicked axle
#

Do you have a minimal reproducer?

#

It's really weird, we do have tests for this behavior so I suspect there might be something else going on here as well

dark vale
dark vale
dark vale
# wicked axle Do you have a minimal reproducer?

here you go.

async def main():
    async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
        netrc = client.set_secret("netrc", "doesn't matter")
        clone = (
            client.container()
            .from_("alpine/git")
            .with_workdir("/src")
            .with_mounted_secret("/root/.netrc", netrc)
            .with_exec(
                [
                    "git",
                    "clone",
                    "--recursive",
                    "https://github.com/TelkomIndonesia/vector-vault-unseal",
                    ".",
                ],
                skip_entrypoint=True,
            )
            .with_exec(["git", "rev-parse", "HEAD"], skip_entrypoint=True)
        )
        await clone.directory("/src").docker_build().sync()


if __name__ == "__main__":
    anyio.run(main)
dark vale
dark vale
dark vale
#

hi @wicked axle , sorry for pinging, but is there any workaround for now,
i would love to use the dagger function on our existing pipeline

wicked axle
#

yeah no worries! sorry, i was off sick the last half of the week 😢

i've managed to reproduce the issue now, and i'll be trying to get a fix together for this week's patch release (which hopefully we'll be running tomorrow)

#

will let you know if i find a workaround!

wicked axle
#

ok i don't think there's a proper workaround sadly 😢
maybe you could Export the result of clone.directory, and then reload it in? I think that should work.

however, i've worked out a fix, you can track it's progress in https://github.com/dagger/dagger/pull/6809

dark vale
cursive turtle
#

here's a snippet that should work @dark vale

#
async def main():
    async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
        netrc = client.set_secret("netrc", "doesn't matter")
        cv = client.cache_volume("src")
        clone = (
            client.container()
            .from_("alpine/git")
            .with_mounted_cache("/src", cv, sharing=dagger.CacheSharingMode.PRIVATE)
            .with_workdir("/src")
            .with_mounted_secret("/root/.netrc", netrc)
            .with_exec(
                [
                    "git",
                    "clone",
                    "--recursive",
                    "https://github.com/TelkomIndonesia/vector-vault-unseal",
                    ".",
                ],
                skip_entrypoint=True,
            )
            .with_exec(["git", "rev-parse", "HEAD"], skip_entrypoint=True)
        )

        (await client
             .container().from_("alpine")
             .with_mounted_cache("/src", cv, sharing=dagger.CacheSharingMode.PRIVATE)
             .with_exec(["cp", "-r", "/src", "/app"])
             .directory("/app").docker_build()
        )


if __name__ == "__main__":
    anyio.run(main)
dark vale
#

i see, let me try, thanks @cursive turtle

cursive turtle
dark vale
wicked axle
#

mm no you're right, silly of me to not test the fix on the original repro

#

(confirmed on the repro)