kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Storing source image from stage 0: unexpected EOF

Open chris-morandi opened this issue 4 years ago • 7 comments

Actual behavior Kaniko build failing, approximately 30% of the time at stage 0 when storing the image, hanging for up to 10 minutes then reporting an "unexpected EOF"

Expected behavior All stages build and the image is pushed to the destination registry

To Reproduce This is an intermittent error. Which occured when switching registries.

Additional Information We are building in a kubernetes cluster 1.21 using docker version 20

We had not see this error until moving to a new mirror and destination registry. We are a bit confused with the error as the log line indicates INFO[0050] Storing source image from stage 0 at path /kaniko/stages/0. So unless this is a timing issue we can't see why how storing and the registry are related.

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [ ]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

chris-morandi avatar Mar 24 '22 21:03 chris-morandi

We are seeing the same issue. Using kaniko executor:v1.8.1-slim.

rafagsiqueira avatar May 03 '22 15:05 rafagsiqueira

Has anyone had any luck getting to the bottom of this? :)

nejch avatar May 25 '22 14:05 nejch

Same issue here, but the job continue in the background.

Environment :

  • Kubernetes runner : drone/drone-runner-kube:1.0.0-rc.3
  • Kaniko : latest
  • Drone 2.16.0

bat553 avatar Jan 10 '23 09:01 bat553

Thanks for flagging this @chris-morandi. Can anyone in the thread here provide a series of steps to reproduce this issue, perhaps repro project + steps or some additional context on how they are able to trigger this? Thanks!

aaron-prindle avatar Jun 14 '23 22:06 aaron-prindle

@aaron-prindle @chris-morandi we get the same issiue. 1.case by node disk or harbor io 2.case by memory fragmentation,when we build if the base image lager than 30G. log like this in os Jun 8 11:04:35 node-1 kernel: runc:[1:CHILD]: page allocation failure: order:6, mode:0xc0d0 Jun 8 11:04:35 node-1 kernel: kmem_cache_create(nf_conntrack_48971) failed with error -12 ...... Jun 8 11:04:35 node-1 kernel: Unable to create nf_conn slab cache

SuperLight-007 avatar Jun 15 '23 07:06 SuperLight-007

Not sure if related but an issue w/ "unexpected EOF" was reported here: https://github.com/GoogleContainerTools/kaniko/issues/2589

That issue is related to using the warmer though which it isn't clear to me from the above if that was used here as well

aaron-prindle avatar Jul 25 '23 22:07 aaron-prindle

We get a similar error from time to time, but not at stage 0. The first time we faced the issue was something like two weeks ago, being on the kaniko-project/executor:debug tag.

We're running two builds in parallel on the same sources. I'll make those sequential and will give you an update if that works out better.

We're using Kaniko as a container in a Kubernetes Pod. Here's the output of the Jenkins pipeline:

[2023-09-07T09:00:06.063Z] + /kaniko/executor '--dockerfile=Dockerfile' '--context=dir:///home/jenkins/agent/workspace/APP_app-rust_PR-70' --log-timestamp '--registry-mirror=docker-hub.intranet.io' --reproducible '--build-arg=BINARY_NAME=myapp' --no-push
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Using dockerignore file: /home/jenkins/agent/workspace/APP_app-rust_PR-70/.dockerignore 
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Retrieving image manifest docker-registry.intranet.io/base-images/debian:11-slim 
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Retrieving image docker-registry.intranet.io/base-images/debian:11-slim from registry docker-registry.intranet.io 
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Built cross stage deps: map[]                
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Retrieving image manifest docker-registry.intranet.io/base-images/debian:11-slim 
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Returning cached image manifest              
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Executing 0 build triggers                   
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Building stage 'docker-registry.intranet.io/base-images/debian:11-slim' [idx: '0', base-idx: '-1'] 
[2023-09-07T09:00:06.063Z] INFO [2023-09-07T09:00:05Z] Unpacking rootfs as cmd COPY target/x86_64-unknown-linux-gnu/release/$BINARY_NAME /app requires it. 
[2023-09-07T09:00:08.625Z] INFO [2023-09-07T09:00:08Z] ARG BINARY_NAME                              
[2023-09-07T09:00:08.625Z] INFO [2023-09-07T09:00:08Z] COPY target/x86_64-unknown-linux-gnu/release/$BINARY_NAME /app 
[2023-09-07T09:00:08.883Z] INFO [2023-09-07T09:00:08Z] Taking snapshot of files...                  
[2023-09-07T09:00:13.066Z] INFO [2023-09-07T09:00:12Z] ENV RUST_LOG=info                            
[2023-09-07T09:00:13.066Z] INFO [2023-09-07T09:00:12Z] CMD ["/app"]                                 
[2023-09-07T09:00:21.248Z] error building image: setting layer times: writing layer file: unexpected EOF
script returned exit code 1

andre161292 avatar Sep 07 '23 09:09 andre161292