Skip to content

.Export partially transfers files and then gets stuck #6355

Closed

Description

@jedevc

This seems to be the same issue as upstream in buildkit: moby/buildkit#2950 (cc @sipsma)

We've seen from a customer, as well as reported on discord: https://discord.com/channels/707636530424053791/1191805052378161192/1191805052378161192:

I've not seen the issue happening without a large amount of files being exported, so this might be related indeed

We should try and commit some debugging resources to trying to track down the deadlock upstream, so that we can fix it once and for all 🎉

Activity

  1. added
    kind/upstream
    on Jan 3, 2024
  2. jedevc commented on Jan 3, 2024

    @jedevc
    ContributorAuthor

    The suggested workaround for users currently hitting this is to try and reduce the number of files being exported if possible - you can remove files from the target directory / container until the export reliably succeeds.

  3. studocu-sger commented on Jan 4, 2024

    @studocu-sger

    The code below tries to export enough files to trigger the issue consistently. If I leave /tmp/empty an empty directory, the process gets stuck. By accident it seems I've also found a workaround: If I create a file with fallocate -l 536870912 /tmp/empty/512MB.zip or dd if=/dev/zero of=/tmp/empty/zero.file bs=512k count=1000 before starting the job, the .export transfers all files correctly and the job succeeds.

    Environment specifics:

    • Kubernetes v1.24.17 on EKS
    • Dagger v0.9.5
    • Dagger engine deployed as Daemonset comparable with the Helm deployment
    • Dagger CLI is used with the _EXPERIMENTAL_DAGGER_RUNNER_HOST=kube-pod://<pod>?namespace=<namespace> environment variable
    #!/usr/local/env python3
    
    import sys
    import anyio
    import dagger
    
    async def main():
        async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
            out = await (
                client.container()
                .from_("node:18-alpine3.19")
                .with_directory("/host", client.host().directory("/tmp/empty/"))
                .with_exec(["npm", "install", "gulp-cli", "yo", "@microsoft/generator-sharepoint", "--global"])
                .directory("/usr/local/lib/node_modules")
                .export("/tmp/sandbox_new_out")
            )
        print(out)
    anyio.run(main)
  4. johnstonematt commented on Feb 28, 2024

    @johnstonematt

    I have had the same issue, trying to export a large directory containing many files. To hack around, I zipped up the directory to a .zip file and then exported the single file (instead of the directory), then unzipped on the host machine, and it worked.

  5. johnstonematt commented on Mar 1, 2024

    @johnstonematt

    I made a script to recreate the issue and explore it further, you can see it here.

    It's clearly related to not just file size, but file count, as you can successfully export a 10GB directory with only 5 files in it, but fail to export a 750MB directory with 60k files in it.

  6. removed
    kind/upstream
    on May 31, 2024
  7. locked and limited conversation to collaborators on Mar 24, 2026
  8. converted this issue into a discussion #12372 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions