#.export() throws failed to create synctarget dest dir error, when directory on host already exists

1 messages · Page 1 of 1 (latest)

drifting brook
#

I may be missing something simple, so let's figure out what I'm doing wrong.

Host filesystem:

Root
- app
-- project name
- CI
-- test-results
{other files and folders}

This example works and creates "sandbox_test.txt" in the Root folder on Host:

my_container = await (
    my_container.with_exec(
        [
            "sh",
            "-c",
            (
                "echo -n Hello World > /tmp/sandbox_test.txt"
            ),
        ])
    .file("/tmp/sandbox_test.txt")
    .export("sandbox_test.txt")
)

This example throws and error when trying to export a file to CI or CI/test-results:

dagger.QueryError: unexpected closing recv msg: rpc error: code = Unknown desc = failed to create synctarget dest dir /CI: mkdir /CI: permission denied
my_container = await (
    my_container.with_exec(
        [
            "sh",
            "-c",
            (
                "echo -n Hello World > /tmp/sandbox_test.txt"
            ),
        ])
    .file("/tmp/sandbox_test.txt")
    .export("/CI/sandbox_test.txt")
)

I want to aggregate all the files generated by my process in a single folder back on my host and not sure why I can't put them inside a folder.

What am I doing wrong?

tacit fulcrum
#

@drifting brook does it also happen if you export to "./CI/sandbox_test.txt"?

#

It's strange that it's trying to create the directory if it already exists

drifting brook
#

I was just going to post /CI vs CI with CI being a working solution.

tacit fulcrum