redhat-buildpacks / poc

Project to be used to perform go build of images using Buildah, ...
3 stars 6 forks source link

Kaniko cannot read or extract files in a pod #8

Closed cmoulliard closed 2 years ago

cmoulliard commented 2 years ago

Issue

When we create a pod top of a kubernetes cluster, then we got the following error reported by our kaniko app

Command

kubectl delete -f k8s/manifest.yml

Log

kc logs -n kaniko kaniko -cbuild
time="2021-11-19T17:58:47Z" level=info msg="The layered tzg files will be extracted to the home dir ..."
INFO[0000] Starting the Kaniko application to process a Dockerfile ...
INFO[0000] Initialize the BuildPackConfig and set the defaults values ...
INFO[0000] Kaniko      dir: /kaniko
INFO[0000] Workspace   dir: /workspace
INFO[0000] Cache       dir: /cache
INFO[0000] Dockerfile name: Dockerfile
INFO[0000] Extract layer files ? true
INFO[0000] Building the Dockerfile
INFO[0000] Retrieving image manifest alpine
INFO[0000] Retrieving image alpine from registry index.docker.io
INFO[0001] Built cross stage deps: map[]
INFO[0001] Retrieving image manifest alpine
INFO[0001] Returning cached image manifest
INFO[0001] Executing 0 build triggers
INFO[0001] Unpacking rootfs as cmd COPY ./hello.txt /workspace requires it.
INFO[0003] COPY ./hello.txt /workspace
INFO[0003] Taking snapshot of files...
INFO[0003] RUN apk add wget curl
INFO[0003] Taking snapshot of full filesystem...
INFO[0003] cmd: /bin/sh
INFO[0003] args: [-c apk add wget curl]
INFO[0003] Running: [/bin/sh -c apk add wget curl]
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/8) Installing ca-certificates (20191127-r5)
(2/8) Installing brotli-libs (1.0.9-r5)
(3/8) Installing nghttp2-libs (1.43.0-r0)
(4/8) Installing libcurl (7.79.1-r0)
(5/8) Installing curl (7.79.1-r0)
(6/8) Installing libunistring (0.9.10-r1)
(7/8) Installing libidn2 (2.3.1-r0)
(8/8) Installing wget (1.21.1-r1)
Executing busybox-1.33.1-r6.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 10 MiB in 22 packages
INFO[0006] Taking snapshot of full filesystem...
INFO[0007] Reading dir content of: /kaniko
123173651 false
824560982 false
config.json false
INFO[0007] Export the layers as tar gzip files under the /cache ...
INFO[0007] Generated 3 layers
INFO[0007] Tar layer file: /kaniko/sha256:97518928ae5f3d52d4164b314a7e73654eb686ecd8aafa0b79acd980773a740d.tgz
INFO[0009] Tar layer file: /kaniko/sha256:448808ad956edda3a9b7636470d04844c6aecd2ae0cfa1085ccd3f44bede0733.tgz
INFO[0009] Tar layer file: /kaniko/sha256:106da25a9a30e59a024cf0032c8d01ff089c927233ec2c427f088c552565ada4.tgz
INFO[0009] Copy the files created from the Kaniko dir to the /cache dir ...
INFO[0009] Kaniko stage is: alpine, index: 0
INFO[0009] Retrieving image manifest alpine
INFO[0009] Returning cached image manifest
INFO[0009] Layer digest of base image is: sha256:97518928ae5f3d52d4164b314a7e73654eb686ecd8aafa0b79acd980773a740d
INFO[0009] Extract the content of the tgz file the / filesystem ...
INFO[0009] Tgz file to be extracted sha256:448808ad956edda3a9b7636470d04844c6aecd2ae0cfa1085ccd3f44bede0733
INFO[0009] Opening the gzip file: /kaniko/sha256:448808ad956edda3a9b7636470d04844c6aecd2ae0cfa1085ccd3f44bede0733.tgz
INFO[0009] Creating a gzip reader for: /kaniko/sha256:448808ad956edda3a9b7636470d04844c6aecd2ae0cfa1085ccd3f44bede0733.tgz
INFO[0009] Tgz file to be extracted sha256:106da25a9a30e59a024cf0032c8d01ff089c927233ec2c427f088c552565ada4
INFO[0009] Opening the gzip file: /kaniko/sha256:106da25a9a30e59a024cf0032c8d01ff089c927233ec2c427f088c552565ada4.tgz
INFO[0009] Creating a gzip reader for: /kaniko/sha256:106da25a9a30e59a024cf0032c8d01ff089c927233ec2c427f088c552565ada4.tgz
lstat /proc/1/fd/10: no such file or directory
lstat /proc/1/fdinfo/10: no such file or directory
lstat /proc/1/task/1/fd/10: no such file or directory
lstat /proc/1/task/1/fdinfo/10: no such file or directory
lstat /proc/1/task/10/fd/10: no such file or directory
lstat /proc/1/task/10/fdinfo/10: no such file or directory
lstat /proc/1/task/11/fd/10: no such file or directory
lstat /proc/1/task/11/fdinfo/10: no such file or directory
lstat /proc/1/task/12/fd/10: no such file or directory
lstat /proc/1/task/12/fdinfo/10: no such file or directory
lstat /proc/1/task/13/fd/10: no such file or directory
lstat /proc/1/task/13/fdinfo/10: no such file or directory
lstat /proc/1/task/14/fd/10: no such file or directory
lstat /proc/1/task/14/fdinfo/10: no such file or directory
lstat /proc/1/task/7/fd/10: no such file or directory
lstat /proc/1/task/7/fdinfo/10: no such file or directory
lstat /proc/1/task/8/fd/10: no such file or directory
lstat /proc/1/task/8/fdinfo/10: no such file or directory
lstat /proc/1/task/9/fd/10: no such file or directory
lstat /proc/1/task/9/fdinfo/10: no such file or directory

The lstat messages are perhaps not important. To be confirmed of course !

cmoulliard commented 2 years ago

Using debug mode, we can see the files extracted

│ DEBU[0009] File found: /usr/bin/curl                                                                                                                         │
│ DEBU[0009] File found: /workspace/hello.txt