Skip to content

[Bug]: "Transport became inactive" on 'container build' (0.5.0) – 16k limit on Container-files? #735

Open

Description

@srcshelton

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

The container-file at https://github.com/srcshelton/docker-gentoo-build/blob/master/gentoo-base/Dockerfile.env is 19k in size. Attempting to container build it results in:

$ /usr/local/bin/container build --file Dockerfile.env --tag localhost/gentoo-env:latest . 
Error: unavailable (14): Transport became inactive

… but doing nothing other than removing commented lines (bringing the total size below 16k) proceeds to attempt to build the container image.

Current behavior

Container-files of over 16k in length appear to fail to transfer to the builder buildkit instance.

Expected behavior

Container-files of arbitrary length should be processed correctly (or, at least, a meaningful error message produced if any length-limit is exceeded).

Environment

- OS: macOS 26.0.1
- Xcode: Version 26.0.1 (17A400)
- Container: container CLI version 0.5.0 (build: release, commit: 48230f3)

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added theissue type on Oct 7, 2025
  2. wlan0 commented on Oct 8, 2025

    @wlan0
    Contributor

    Hi @srcshelton, thanks for the bug report.

    I haven't confirmed it yet, but I believe this issue is due to GRPC header limit (16K default) and us sending the Dockerfile via GRPC header to the builder

    ("dockerfile", config.dockerfile.base64EncodedString()),

    I'll confirm the issue and change the builder protocol to expect Dockerfile in a GRPC message instead of header

  3. blacktop commented on Feb 4, 2026

    @blacktop

    bump

  4. danielweck commented on Mar 9, 2026

    @danielweck

    Ah! :)
    My 16+KB Dockerfile caused the obscure message Error: unavailable (14): Transport became inactive.
    Easy fix as I was able to remove loads of line comments in order to decrease the file size.
    May I suggest making the error message clearer?

  5. digitalpardoe commented on Mar 16, 2026

    @digitalpardoe

    I've just experienced this issue with a 28KB Dockerfile that can't really be trimmed down.

  6. added
    facet/builder
    on Apr 21, 2026
  7. added this to the 2026-05 milestone on Apr 21, 2026
  8. modified the milestone: 2026-05 on May 5, 2026
  9. deviantony commented on May 10, 2026

    @deviantony

    I think I hit a similar issue with container 0.12.3 on macOS 26, except that I got a different error message:

    $ container build --tag my-image:latest .
    Error: unavailable: "Stream unexpectedly closed."
    

    My Dockerfile failed at 425 lines (~15.4KB on disk, much of it inline comments and heredoc-formatted RUN blocks). After stripping inline comments to bring the file to ~400 lines, the build succeeds reliably.

  10. modified the milestones: 2026-05, 2026-06 on May 19, 2026
  11. 27 remaining items

  12. danielweck commented on Nov 9, 2026

    @danielweck

    One year on, this remains a pretty major shortcoming of Apple Container tooling :(
    When reducing/eliminating comments and externalizing "heredocs" doesn't sufficiently decrease the Containerfile/Dockerfile size, stacking images is an option but at that point one might have given up :)

  13. philwhln commented on Nov 13, 2026

    @philwhln

    The lag here might be that the Issue is assigned @wlan0 , who no longer works at Apple.

    Co-founder, sandboxrouter dot io | prev. Apple Containers, MinIO, Kubernetes, Docker

    @wlan0, do you know how to get some eyeballs on this or get it reassigned?

  14. danielweck commented on Nov 13, 2026

    @danielweck

    My current workaround for large Container|Dockerfiles is to use the docker CLi to build, and Apple Container to run. Not ideal but at least OCi interoperability helps here.

  15. jaeyeonme commented on Nov 14, 2026

    @jaeyeonme

    Sharing my findings in case they help whoever picks this up.

    I reproduced it on main. The cause is the HTTP/2 frame size, not a header limit. swift-nio-http2 sends all request headers in one HEADERS frame (no CONTINUATION), and grpc-go caps frames at 16384, so the base64 Dockerfile plus the other metadata overflows after HPACK. That's why builds fail anywhere from about 13.8 to 16.1 KB, below the #1634 guard.

    A possible minimal fix, along the lines of wlan0's earlier suggestion: the shim accepts the Dockerfile, .dockerignore, and secrets as the first stream message and advertises that in Info. The CLI uses it when the shim supports it and keeps the current header path otherwise.

    Measurements and details are below.

    Measurements and details

    Raw Dockerfile size at the pass/fail boundary, by padding type:

    Padding Last pass First fail
    long comment line 14,326 14,327
    random alphanumerics 14,823 14,824
    bytes that base64 to TTTT 13,815 13,816
    bytes that base64 to 7777 16,114 16,115
    long comment + 3,000 B .dockerignore 11,472 11,473
    • In every row, the Huffman-encoded size of the dockerfile value is about 16,118 bytes at the boundary. In the last row, that figure is the Dockerfile and .dockerignore values combined. The remaining fixed headers add about 265 bytes, which reaches 16,384.
    • The exact boundary moves by a few bytes between runs, because the random build-id UUID's encoded size varies.
    • Code paths:
      • HTTP2FrameEncoder.swift: always sets END_HEADERS, and throws frameSizeError when the payload exceeds the peer's max frame size. Upstream main is the same.
      • grpc-go: http2MaxFrameLen = 16384 is a constant.
      • grpc-swift: maxFrameSize only affects what the client receives.
    • A failing run leaves no serving grpc connection / session started lines in the shim log; only the Info call shows up.
    • Implementation notes:
      • The shim reads the first packet with Recv() before NewPipeline/Run, and dockerfile becomes optional in NewBuildOpts.
      • The CLI writes BuildConfig in the request producer before relaying the stream, because the terminal-resize task yields packets concurrently.
      • Add an integration test with a 64 KiB+ Dockerfile and a large secret.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

facet/builder

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions