Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[output clipped, log limit 1MiB reached] and then exit code 7 #484

Closed
jessehui opened this issue Dec 18, 2020 · 32 comments
Closed

[output clipped, log limit 1MiB reached] and then exit code 7 #484

jessehui opened this issue Dec 18, 2020 · 32 comments

Comments

@jessehui
Copy link

Docker build on my local machine works fine. But when I use GitHub actions to build the docker image, I got error.
First I see this log: [output clipped, log limit 1MiB reached], and after a few minutes, I got error code 7.
After multiple times of retry, the results are the same.

The log snippet is here (for full log, check this out: https://github.com/occlum/occlum/runs/1573929172?check_suite_focus=true):

2020-12-18T00:48:25.5043289Z #10 272.4 ../include/libunwind-common.h:39:31: note: in expansion of macro 'UNW_PASTE'
2020-12-18T00:48:25.5044095Z #10 272.4  # define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_)
2020-12-18T00:48:25.5044612Z #10 272.4                                ^~~~~~~~~
2020-12-18T00:48:25.5045321Z #10 272.4 ../include/libunwind-common.h:35:31: not
2020-12-18T00:48:25.5045945Z #10 272.4 [output clipped, log limit 1MiB reached]
2020-12-18T00:52:18.2647230Z #10 ERROR: executor failed running [/bin/sh -c git clone -b sgx_2.11_for_occlum https://github.com/occlum/linux-sgx &&     cd linux-sgx &&     ./compile_and_install.sh no_mitigation USE_OPT_LIBS=2 &&     echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc &&     rm -rf /tmp/linux-sgx]: exit code: 7
2020-12-18T00:52:18.2680001Z ------
2020-12-18T00:52:18.2682323Z  > [stage-1  6/30] RUN git clone -b sgx_2.11_for_occlum https://github.com/occlum/linux-sgx &&     cd linux-sgx &&     ./compile_and_install.sh no_mitigation USE_OPT_LIBS=2 &&     echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc &&     rm -rf /tmp/linux-sgx:
2020-12-18T00:52:18.2684280Z ------
2020-12-18T00:52:18.2686098Z failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c git clone -b sgx_2.11_for_occlum https://github.com/occlum/linux-sgx &&     cd linux-sgx &&     ./compile_and_install.sh no_mitigation USE_OPT_LIBS=2 &&     echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc &&     rm -rf /tmp/linux-sgx]: exit code: 7
2020-12-18T00:52:24.8045851Z ##[error]buildx call failed with: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c git clone -b sgx_2.11_for_occlum https://github.com/occlum/linux-sgx &&     cd linux-sgx &&     ./compile_and_install.sh no_mitigation USE_OPT_LIBS=2 &&     echo 'source /opt/intel/sgxsdk/environment' >> /root/.bashrc &&     rm -rf /tmp/linux-sgx]: exit code: 7
2020-12-18T00:52:24.8230306Z Post job cleanup.

Github actions yaml: https://github.com/occlum/occlum/actions/runs/428064733/workflow
dockerfile: https://github.com/occlum/occlum/blob/master/tools/docker/Dockerfile.centos8.1

@jiayunwei
Copy link

i met the problem too

@leimao
Copy link

leimao commented Dec 20, 2020

Any way to increase the log limit cache size?

@tonistiigi
Copy link
Member

clipping can be disabled with buildx create --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=-1 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=-1 but this should have no effect on the outcome of the build. If it does then please post a reproducer.

@Mr-K10
Copy link

Mr-K10 commented Jan 5, 2021

I am facing the same issue, Can someone tell me how to stop logging or increase log limits from 1 MiB to at least 10MiB.

@k-hashimoto
Copy link

I have same issue. I want to how to stop logging or increase limits.

@tonistiigi
Copy link
Member

increase log limits from 1 MiB to at least 10MiB.

for 10MB --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760

@jessehui
Copy link
Author

For those who use buildx github actions for image building, just need extra with to prevent this:

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
        with:
          driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760

@OmryAr
Copy link

OmryAr commented Jan 13, 2021

I'm struggling with this myself, running a buildkit enabled docker build from a linux command line - pulling hairs on how to pass those params... can anyone please point me to the right direction?
(docker does not accept --driver-opt, and restarting dockerd with BUILDKIT_STEP_LOG_MAX_SIZE=-1 and BUILDKIT_STEP_LOG_MAX_SPEED=-1 environment vars doesn't have any effect).

@jessehui
Copy link
Author

@OmryAr I believe these parameters are provided by buildx which means you should build image with docker buildx build. And these parameters are used when creating a buildx instance. For more info, please read the buildx doc.

@OmryAr
Copy link

OmryAr commented Jan 14, 2021

Thanks @jessehui ! So after a long while of digging into the docs and experimenting - I've managed to create a buildx instance set with these configuration params. Something on the lines of:

docker buildx create --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=1000000,env.BUILDKIT_STEP_LOG_MAX_SPEED=100000000 --use

So now my revised question would be - how can I configure the default instance (without creating another one - which I wasn't intending to... and seems wasteful)?

  • When running docker buildx build, out-of-the-box, I am running the default instance, right?
  • How can I pass --driver-opts to the default instance?

@yardenshoham
Copy link

I'm using a regular docker build, how can I increase the log limit?

@OmryAr
Copy link

OmryAr commented Jan 26, 2021

Hi @yardenshoham !
After researching this quite deeply, I can try to explain this:

  • At the time of this writing, log limits cannot be arbitrarily set using normal params to the docker build command.
  • To set log limits globally, you need set appropriate environment params for the dockerd service, and restart it for the configuration to take effect. Assuming a systemd based Linux-distro server, you'll need to add the following lines to /etc/sysconfig/docker:
    BUILDKIT_STEP_LOG_MAX_SIZE=10000000
    BUILDKIT_STEP_LOG_MAX_SPEED=10000000
  • Alternatively you might create a builder instance and set it up with your desired options, as shown in my comment above.

HTH!

@phdoerfler
Copy link

for convenience, here's a bash one-liner:
docker buildx build . --builder "$(docker buildx create --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000)"

@LukeIreland1
Copy link

clipping can be disabled with buildx create --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=-1 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=-1 but this should have no effect on the outcome of the build. If it does then please post a reproducer.

[output clipped, log limit -1B reached]

@myzcid
Copy link

myzcid commented Jun 9, 2021

[output clipped, log limit 1MiB reached]

@crazy-max
Copy link
Member

Fixed by moby/buildkit#1934

@xkszltl
Copy link

xkszltl commented Jul 10, 2021

The clipping issue has been creating big trouble for us for long.
It doubles the work of debugging because none of the meaningful error can be captured within the limited size.
All the error has to be repro by running Dockerfile commands manually within docker run.
And any one-off errors (e.g. network issues/race conditions/environment specific issues/...) is simply not reproducible.

However, even when we try to raise the limit with env var for dockerd (BUILDKIT_STEP_LOG_MAX_SIZE and BUILDKIT_STEP_LOG_MAX_SPEED set to 1~2G via systemd), it will just hang in the middle of build like this:

image

The docker build will hang there with partial log for hours in this case.

@zengqingfu1442
Copy link

zengqingfu1442 commented Jul 14, 2021

docker 19.03.1 does not support buildx subcommand. But 20.10.1 supports.

root@f05c610dce6d:/# docker buildx 
docker: 'buildx' is not a docker command.
See 'docker --help'

Update, 20.10.1 does not support either. Because I execute the above command in a docker-in-docker container.

@zaufi
Copy link

zaufi commented Aug 5, 2021

Also hit by this crap with normal docker build :(

Even --progress=plain doesn't help... This is insane!! I just can't get my full log and see the compiler error!

@TomBonnerAtDerivitec
Copy link

This is a fairly sad regression. Unable to view more than 1MB of logs on our own machine?

Here's my stats:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.6.3-docker)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Containers: 9
  Running: 1
  Paused: 0
  Stopped: 8
 Images: 25
 Server Version: 20.10.8
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.47-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.64GiB
 Name: docker-desktop

@JJ
Copy link

JJ commented Dec 25, 2021

The question here, is the error precisely that the max log size has been reached, or is it hiding some other error?

@maffei2443
Copy link

maffei2443 commented Jan 10, 2022

The true question is: how is this problem supposed to be solved? There must be a way to solve that, right?
Maybe extending the max log size or even setting it to "unlimited".

@abdennour
Copy link

[output clipped, log limit 1MiB reached]

Happen for us when there is no build cache, and the app requires a mess of dependencies ( jar files).
The log shows the downloaded dependencies & its nested dependencies until seeing that error:

[output clipped, log limit 1MiB reached]

We are using docker-compose to build using buildkit feature.
Any thoughts how to fix it at the level of docker daemon ?

@OmryAr
Copy link

OmryAr commented Feb 24, 2022

@abdennour @maffei2443 Please go early in this thread (around Jan-April 2021) for ways to solve this. It might have been addressed in a more elegant way in a later Docker release - so consider that too.

@xkszltl
Copy link

xkszltl commented Feb 24, 2022

@OmryAr
So far I haven't seen any good resolution in docker.
Adding env var to docker daemon via systemd doesn't help much as that somehow introduced a random hanging issue for large log, even when it's only a few MB.
We never had this issue until the release of this feature, or without setting those env var.

And there's no "unlimited" value.

I think a reasonable fix is to disable clipping by default, or at least have a reliable kill switch.

@bumerang07
Copy link

I have the docker 20.10.11
And it seems that the only working solution is to add this variable DOCKER_BUILDKIT=0 before running docker:

DOCKER_BUILDKIT=0 docker build

This will prevent using new build functionalities

@celetium
Copy link

I have the docker 20.10.11 And it seems that the only working solution is to add this variable DOCKER_BUILDKIT=0 before running docker:

DOCKER_BUILDKIT=0 docker build

This will prevent using new build functionalities

This really work! thanks!

@Doug910
Copy link

Doug910 commented Sep 27, 2022

This worked on Windows I added DOCKER_BUILDKIT with value 0 to the system environment variables, then ran Docker Desktop 4.12.0, when I do a build the log keeps going, running all the way with no limit or hang ups.

@okanbeydanol
Copy link

This worked on Windows I added DOCKER_BUILDKIT with value 0 to the system environment variables, then ran Docker Desktop 4.12.0, when I do a build the log keeps going, running all the way with no limit or hang ups.

Its working on mac too.

@ikovalyov
Copy link

This is still an issue with docker-compose. Seems to be no way to disable this log limit there.

tianon added a commit to tianon/dockerfiles that referenced this issue Mar 4, 2024
sateesh2020 added a commit to sateesh2020/dockerfiles that referenced this issue Mar 20, 2024
* Alpine 3.19

* Perl 5.38

* Ubuntu Jammy

* Rust 1.67

* Update docker-master

* Update docker-master

* Remove completed TODO

* Update docker-master

* Update docker-master

* Update buildkit to 0.12.5

* Update containerd to 1.7.13, runc 1.1.12

* Update jenkins to weekly 2.443

* Update microsoft-edge/dev to 122.0.2365.3-1

* Update signal-desktop to 6.46.0

* Update Docker Desktop to 4.27.1

* Update docker-master

* Add more Docker Desktop whitespace and protections

* Update DD's virtiofsd to Rust 1.75

* Update cygwin

* Update microsoft-edge/beta to 122.0.2365.8-1

* Update microsoft-edge/stable to 121.0.2277.98-1

* Update vultr-cli to 2.22.0

* Update docker-master

* Update docker-master

* Update infosiftr-moby to 20.10.27, engine 20.10.27-1~deb12u0, containerd 1.6.28-1~deb12u0, runc 1.1.12-1~deb12u0, cli 20.10.27-1~deb12u0, cli-plugin-buildx 0.12.1-1~deb12u0, unstable engine 20.10.27-1, unstable containerd 1.6.28-1, unstable runc 1.1.12-1, unstable cli 20.10.27-1, unstable cli-plugin-buildx 0.12.1-1

* Update docker-master

* Update microsoft-edge/beta to 122.0.2365.16-1

* Update microsoft-edge/stable to 121.0.2277.106-1

* Update cygwin

* Update firefox to 122.0.1

* Update jenkins to weekly 2.444

* Update microsoft-edge/dev to 123.0.2380.1-1

* Update microsoft-edge/stable to 121.0.2277.113-1

* Update signal-desktop to 6.47.0

* Update slack to 4.36.140

* Update ymlfmt to 0.18.6

* Let auto-update make docker-master PRs too, for now

* Update diffoscope to 256

* Update docker-master to 86b86412a1b7df7dcecc81aa6ba795ff6b0c3ce3, cli 34797d167891c11d2e10c1339b072166b77a3378, buildx d0177c6da31fba948b7f82d2e61fe952f35de5d1

* Update docker-master to buildx 481384b185d61356b47ad47af618c282b1b332e6

* Update handbrake to 1.7.3

* Update docker-master

* Revert "Let auto-update make docker-master PRs too, for now"

This reverts commit 8f420f3.

Server isn't fixed yet, but another machine is filling in for now.

* Update docker-master

* Update docker-master

* Update diffoscope to 257

* Update microsoft-edge/beta to 122.0.2365.30-1

* Update steam to 1.0.0.79

* Update docker-master

* Update docker-master

* Update docker-master

* Update jenkins to weekly 2.445

* Update microsoft-edge/dev to 123.0.2400.1-1

* Update plex/media-server to 1.40.0.7998-c29d4c0c8

* Update signal-desktop to 6.47.1

* Update docker-master

* Update docker-master

* Update microsoft-edge/stable to 121.0.2277.128-1

* Update tailscale to 1.60.0

* Update vultr-cli to 3.0.0

* Update docker-master

* Update docker-master

* Update microsoft-edge/beta to 122.0.2365.38-1

* Update docker-master

* Update backblaze-b2 to 3.16.0

* Update docker-master

* Update docker-master

* Update docker-master

* Update firefox to 123.0

* Update jenkins to weekly 2.446, lts 2.440.1

* Update signal-desktop to 6.48.0

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update prometheus to 2.50.0

* Update signal-desktop to 6.48.1

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update diffoscope to 258

* Update docker-master

* Update docker-master

* Update microsoft-edge/beta to 122.0.2365.52-1

* Update microsoft-edge/stable to 122.0.2365.52-1

* Add wireguard-tools to network-toolbox

* Update docker-master

* Add initial (multiarch) nolibc image based on Linux 6.1.9

* Update nolibc to linux 6.7.6

* Fix nolibc tag ordering

* Update docker-master

* Use chroot to better validate that nolibc is working correctly

* Update docker-master

* Update docker-master

* Update docker-master

* Update backblaze-b2 to 3.16.1

* Update prometheus to 2.50.1

* Update tinygo to 0.31.0

* Update zoom to 5.17.10.3512

* Add "multiarch" variant of sleeping-beauty compiled with nolibc

* Rename "multiarch" to "nolibc" (better reflects what this is instead of why this is)

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update jenkins to weekly 2.447

* Update microsoft-edge/beta to 122.0.2365.59-1

* Update microsoft-edge/dev to 123.0.2420.6-1

* Update microsoft-edge/stable to 122.0.2365.59-1

* Update vultr-cli to 3.0.1

* Update docker-master

* Update docker-master

* Update docker-master

* Update prometheus/alertmanager to 0.27.0

* Update tinygo to 0.31.1

* Update microsoft-edge/dev to 123.0.2400.1-1

* Update microsoft-edge/stable to 122.0.2365.52-1

* Add my now-ancient `hell/win` script (this is as good a home for it as any)

* Remove values that are already implied by the defaults (with workdir set appropriately)

This is the easy fix for:

    Error parsing command line arguments: flag 'storage.tsdb.path' cannot be repeated

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update microsoft-edge/beta to 123.0.2420.10-1

* Update microsoft-edge/dev to 123.0.2420.10-1

* Update microsoft-edge/stable to 122.0.2365.63-1

* Update signal-desktop to 7.0.0

* Update tailscale to 1.60.1

* Update docker-master

* Update docker-master

* Update docker-master

* Update diffoscope to 259

* Update nolibc to linux 6.7.7

* Update nolibc to linux 6.7.8

* Update docker-master

* Update docker-master

* Update docker-master

* Set BUILDKIT_STEP_LOG_MAX_SIZE and BUILDKIT_STEP_LOG_MAX_SPEED explicitly for better BuildKit logs

See docker/buildx#484 (comment)

* Update docker-master

* Update docker-master

* Update docker-master

* Scrape buildkit (minimal) Go version

* Update buildkit to 0.13.0, go 1.21

* Update firefox to 123.0.1

* Update infosiftr-moby to engine 20.10.27-2~deb12u0, unstable engine 20.10.27-2

* Update jenkins to weekly 2.448

* Update microsoft-edge/beta to 123.0.2420.20-1

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update microsoft-edge/dev to 124.0.2438.2-1

* Update nolibc to linux 6.7.9

* Update signal-desktop to 7.1.0

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update microsoft-edge/stable to 122.0.2365.80-1

* Update signal-desktop to 7.1.1

* Update docker-master

* Update docker-master

* Update diffoscope to 260

* Update cygwin

* Update zoom to 5.17.11.3835

* Update docker-master

* Update docker-master

* Update containerd to 1.7.14

* Update microsoft-edge/beta to 123.0.2420.32-1

* Update tinygo to 0.31.2

* Update docker-master

* Update docker-master

* Update jenkins to weekly 2.449

* Update microsoft-edge/dev to 124.0.2450.2-1

* Update vultr-cli to 3.0.2

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update signal-desktop to 7.2.0

* Update tailscale to 1.62.0

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update microsoft-edge/stable to 122.0.2365.92-1

* Update plex/media-server to 1.40.1.8227-c0dd5a73e

* Update docker-master

* Update docker-master

* Update docker-master

* Update backblaze-b2 to 3.17.0

* Update microsoft-edge/beta to 123.0.2420.41-1

* Update nolibc to linux 6.7.10

* Update vultr-cli to 3.0.3

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update docker-master

* Update buildkit to 0.13.1

* Update signal-desktop to 7.2.1

* Update docker-master

* Update docker-master

* Update docker-master

* Update firefox to 124.0

* Update jenkins to weekly 2.450

* Update microsoft-edge/dev to 124.0.2464.2-1

* Update prometheus to 2.51.0

---------

Co-authored-by: J0WI <J0WI@users.noreply.github.com>
Co-authored-by: Tianon Gravi <admwiggin@gmail.com>
Co-authored-by: Tianon (automated) <tianon@tianon.xyz>
@malaterre
Copy link

I have the docker 20.10.11 And it seems that the only working solution is to add this variable DOCKER_BUILDKIT=0 before running docker:

DOCKER_BUILDKIT=0 docker build

This will prevent using new build functionalities

Works for me ... but if you are running inside gitlab you'll eventually reach:

Job's log exceeded limit of 4194304 bytes.
Job execution will continue but no more output will be collected.

@prjemian
Copy link

prjemian commented Apr 2, 2024

Today, with DOCKER_BUILDKIT=0 docker build and Docker version 26.0.0, build 2ae903e on linux, this report:

# started:  2024-04-02T12:24:32-05:00
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
            environment-variable.

Sending build context to Docker daemon  29.18kB

SammyEnigma pushed a commit to SammyEnigma/dockerfiles that referenced this issue Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests