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

symlink error building from jboss/base-jdk:8 #352

Closed
Bashton-MattBuckland opened this issue Sep 13, 2018 · 4 comments · Fixed by #456
Closed

symlink error building from jboss/base-jdk:8 #352

Bashton-MattBuckland opened this issue Sep 13, 2018 · 4 comments · Fixed by #456
Assignees
Labels
kind/bug Something isn't working

Comments

@Bashton-MattBuckland
Copy link

Actual behavior
When I run this:

docker run -v ${PWD}:/workspace -w /workspace -it gcr.io/kaniko-project/executor:v0.3.0 -d .

I get this:

INFO[0000] appending to multi args .
INFO[0000] Downloading base image jboss/base-jdk:8
2018/09/13 13:21:16 No matching credentials were found, falling back on anonymous
INFO[0002] Mounted directories: [/kaniko /var/run /proc /dev /dev/pts /sys /sys/fs/cgroup /sys/fs/cgroup/systemd /sys/fs/cgroup/devices /sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/rdma /sys/fs/cgroup/cpuset /sys/fs/cgroup/perf_event /sys/fs/cgroup/memory /sys/fs/cgroup/freezer /sys/fs/cgroup/pids /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/hugetlb /sys/fs/cgroup/blkio /dev/mqueue /workspace /etc/resolv.conf /etc/hostname /etc/hosts /dev/shm /dev/console /proc/bus /proc/fs /proc/irq /proc/sys /proc/sysrq-trigger /proc/kcore /proc/keys /proc/timer_list /proc/sched_debug /proc/scsi /sys/firmware]
INFO[0003] Unpacking layer: 3
INFO[0024] Unpacking layer: 2
INFO[0025] Not adding /etc because it was added by a prior layer
INFO[0025] Not adding /var because it was added by a prior layer
INFO[0025] Not adding /var/log because it was added by a prior layer
INFO[0025] Unpacking layer: 1
INFO[0026] Not adding /etc because it was added by a prior layer
INFO[0026] Not adding /etc/X11 because it was added by a prior layer
INFO[0026] Not adding /etc/alternatives because it was added by a prior layer
INFO[0026] Not adding /etc/ld.so.cache because it was added by a prior layer
INFO[0026] Not adding /run because it was added by a prior layer
INFO[0026] Not adding /tmp because it was added by a prior layer
INFO[0026] Not adding /usr because it was added by a prior layer
INFO[0026] Not adding /usr/bin because it was added by a prior layer
INFO[0027] Not adding /usr/lib because it was added by a prior layer
INFO[0027] Not adding /usr/lib/jvm because it was added by a prior layer
INFO[0027] Not adding /usr/lib/jvm-exports because it was added by a prior layer
INFO[0027] Not adding /usr/lib/jvm-private because it was added by a prior layer
INFO[0028] Not adding /usr/lib64 because it was added by a prior layer
INFO[0029] Not adding /usr/lib64/pkgconfig because it was added by a prior layer
INFO[0029] Not adding /usr/share because it was added by a prior layer
INFO[0030] Not adding /usr/share/licenses because it was added by a prior layer
INFO[0030] Not adding /var because it was added by a prior layer
INFO[0030] Not adding /var/cache because it was added by a prior layer
INFO[0030] Not adding /var/cache/ldconfig because it was added by a prior layer
INFO[0030] Not adding /var/cache/ldconfig/aux-cache because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum/x86_64 because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum/x86_64/7 because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum/x86_64/7/base because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum/x86_64/7/base/gen because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum/x86_64/7/base/packages because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum/x86_64/7/extras because it was added by a prior layer
INFO[0030] Not adding /var/cache/yum/x86_64/7/extras/gen because it was added by a prior layer                                                                                                                       
INFO[0030] Not adding /var/cache/yum/x86_64/7/timedhosts because it was added by a prior layer                                                                                                                       
INFO[0030] Not adding /var/cache/yum/x86_64/7/updates because it was added by a prior layer                                                                                                                          
INFO[0030] Not adding /var/cache/yum/x86_64/7/updates/gen because it was added by a prior layer                                                                                                                      
INFO[0030] Not adding /var/cache/yum/x86_64/7/updates/packages because it was added by a prior layer                                                                                                                 
INFO[0030] Not adding /var/lib because it was added by a prior layer                                                                                                                                                 
INFO[0030] Not adding /var/lib/alternatives because it was added by a prior layer                                                                                                                                    
INFO[0030] Not adding /var/lib/rpm because it was added by a prior layer                                                                                                                                             
INFO[0030] Not adding /var/lib/rpm/.dbenv.lock because it was added by a prior layer                                                                                                                                 
INFO[0030] Not adding /var/lib/rpm/.rpm.lock because it was added by a prior layer                                                                                                                                   
INFO[0030] Not adding /var/lib/rpm/Basenames because it was added by a prior layer                                                                                                                                   
INFO[0030] Not adding /var/lib/rpm/Conflictname because it was added by a prior layer                                                                                                                                
INFO[0030] Not adding /var/lib/rpm/Dirnames because it was added by a prior layer                                                                                                                                    
INFO[0030] Not adding /var/lib/rpm/Group because it was added by a prior layer                                                                                                                                       
INFO[0030] Not adding /var/lib/rpm/Installtid because it was added by a prior layer                                                                                                                                  
INFO[0030] Not adding /var/lib/rpm/Name because it was added by a prior layer                                                                                                                                        
INFO[0030] Not adding /var/lib/rpm/Obsoletename because it was added by a prior layer                                                                                                                                
INFO[0030] Not adding /var/lib/rpm/Packages because it was added by a prior layer                                                                                                                                    
INFO[0031] Not adding /var/lib/rpm/Providename because it was added by a prior layer                                                                                                                                 
INFO[0031] Not adding /var/lib/rpm/Requirename because it was added by a prior layer                                                                                                                                 
INFO[0031] Not adding /var/lib/rpm/Sha1header because it was added by a prior layer                                                                                                                                  
INFO[0031] Not adding /var/lib/rpm/Sigmd5 because it was added by a prior layer                                                                                                                                      
INFO[0031] Not adding /var/lib/rpm/Triggername because it was added by a prior layer                                                                                                                                 
INFO[0031] Not adding /var/lib/rpm/__db.001 because it was added by a prior layer
INFO[0031] Not adding /var/lib/rpm/__db.002 because it was added by a prior layer
INFO[0031] Not adding /var/lib/rpm/__db.003 because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum/history because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum/history/2018-08-04 because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum/history/history-2018-08-04.sqlite because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum/history/history-2018-08-04.sqlite-journal because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum/rpmdb-indexes because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum/yumdb because it was added by a prior layer
INFO[0031] Not adding /var/lib/yum/yumdb/a because it was added by a prior layer
INFO[0031] Whiting out /var/lib/yum/yumdb/a/.wh.26cb720a7995364140e82e072b2171e73d64759c-audit-libs-2.8.1-3.el7-x86_64
INFO[0031] Not adding /var/lib/yum/yumdb/c because it was added by a prior layer
INFO[0031] Whiting out /var/lib/yum/yumdb/c/.wh.db0ee635726608d6adf5d6ee221d94da9a1099ed-centos-release-7-5.1804.1.el7.centos-x86_64
INFO[0031] Whiting out /var/lib/yum/yumdb/d/.wh.7b4fac8cf83258849b225b361e88a08038ec1c66-dracut-033-535.el7-x86_64
INFO[0031] Not adding /var/lib/yum/yumdb/j because it was added by a prior layer
INFO[0031] Whiting out /var/lib/yum/yumdb/k/.wh.c151735f4bbcf02cb1352d96e93d14fd1a4cbcf4-kpartx-0.4.9-119.el7-x86_64
INFO[0031] Not adding /var/lib/yum/yumdb/l because it was added by a prior layer
INFO[0031] Whiting out /var/lib/yum/yumdb/l/.wh.03ddbf27e282109446e1bd381274f3f1898cd93e-libmount-2.23.2-52.el7-x86_64
INFO[0031] Whiting out /var/lib/yum/yumdb/l/.wh.5660b1b845680df2ef85a581b9f128507e38e1d1-libblkid-2.23.2-52.el7-x86_64
INFO[0031] Whiting out /var/lib/yum/yumdb/l/.wh.66918175747959bd5ad315a26449d377339ece4a-libuuid-2.23.2-52.el7-x86_64
INFO[0031] Not adding /var/lib/yum/yumdb/s because it was added by a prior layer
INFO[0031] Whiting out /var/lib/yum/yumdb/s/.wh.8f7d02746558cdd1ed90e3036c56fe9f8e1316dc-systemd-libs-219-57.el7-x86_64
INFO[0031] Whiting out /var/lib/yum/yumdb/s/.wh.fd0bbd2160a727720f89526b50238fe0ec65ddbf-systemd-219-57.el7-x86_64
INFO[0031] Whiting out /var/lib/yum/yumdb/u/.wh.d047f1f3114da9025f56e5e9f0e8259bf354ea38-util-linux-2.23.2-52.el7-x86_64
INFO[0031] Not adding /var/log because it was added by a prior layer
INFO[0031] Not adding /var/log/lastlog because it was added by a prior layer
INFO[0031] Not adding /var/log/yum.log because it was added by a prior layer
INFO[0031] Not adding /var/tmp because it was added by a prior layer
INFO[0031] Unpacking layer: 0
INFO[0031] Not adding /dev because it is whitelisted
INFO[0031] Not adding /etc because it was added by a prior layer
INFO[0031] Not adding /etc/.pwd.lock because it was added by a prior layer
INFO[0031] Not adding /etc/X11 because it was added by a prior layer
INFO[0031] Not adding /etc/X11/fontpath.d because it was added by a prior layer
INFO[0031] Not adding /etc/X11/xorg.conf.d because it was added by a prior layer
INFO[0031] Not adding /etc/alternatives because it was added by a prior layer
INFO[0031] Not adding /etc/binfmt.d because it was added by a prior layer
INFO[0031] Not adding /etc/centos-release because it was added by a prior layer
INFO[0031] Not adding /etc/centos-release-upstream because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1 because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d/org.freedesktop.hostname1.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d/org.freedesktop.import1.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d/org.freedesktop.locale1.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d/org.freedesktop.login1.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d/org.freedesktop.machine1.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d/org.freedesktop.systemd1.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dbus-1/system.d/org.freedesktop.timedate1.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dracut.conf because it was added by a prior layer
INFO[0031] Not adding /etc/dracut.conf.d because it was added by a prior layer
INFO[0031] Not adding /etc/group because it was added by a prior layer
INFO[0031] Not adding /etc/group- because it was added by a prior layer
INFO[0031] Not adding /etc/gshadow because it was added by a prior layer
INFO[0031] Not adding /etc/gshadow- because it was added by a prior layer
INFO[0031] Not adding /etc/hosts because it is whitelisted
INFO[0031] Not adding /etc/issue because it was added by a prior layer
INFO[0031] Not adding /etc/issue.net because it was added by a prior layer
INFO[0031] Not adding /etc/ld.so.cache because it was added by a prior layer
INFO[0031] Not adding /etc/libaudit.conf because it was added by a prior layer
INFO[0031] Not adding /etc/machine-id because it was added by a prior layer
INFO[0031] Not adding /etc/modules-load.d because it was added by a prior layer
ERRO[0031] symlink ../proc/self/mounts /etc/mtab: file exists

My pwd contains a Dockerfile with the following contents:

FROM jboss/base-jdk:8

I have also tried with :latest, but that gives up even sooner and gives me a usage error for some reason:

Status: Downloaded newer image for gcr.io/kaniko-project/executor:latest
INFO[0000] appending to multi args .
INFO[0000] Downloading base image jboss/base-jdk:8
2018/09/13 13:34:37 No matching credentials were found, falling back on anonymous
INFO[0003] Mounted directories: [/kaniko /var/run /etc/mtab /proc /dev /dev/pts /sys /sys/fs/cgroup /sys/fs/cgroup/systemd /sys/fs/cgroup/devices /sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/rdma /sys/fs/cgroup/cpuset /sys/fs/cgroup/perf_event /sys/fs/cgroup/memory /sys/fs/cgroup/freezer /sys/fs/cgroup/pids /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/hugetlb /sys/fs/cgroup/blkio /dev/mqueue /workspace /etc/resolv.conf /etc/hostname /etc/hosts /dev/shm /dev/console /proc/bus /proc/fs /proc/irq /proc/sys /proc/sysrq-trigger /proc/kcore /proc/keys /proc/timer_list /proc/sched_debug /proc/scsi /sys/firmware]
INFO[0003] Extracting layer 0
INFO[0019] Extracting layer 1
INFO[0024] Extracting layer 2
INFO[0025] Extracting layer 3
Error: error building image: error building stage: link /var/lib/yum/yumdb/a/3e307aa89e8d2e11e2884b65d33506ab8eadd5a7-alsa-lib-1.1.4.1-2.el7-x86_64/checksum_type /var/lib/yum/yumdb/l/0d8cb5db55731bd5ca02afc97a0b214f8bdd246c-libcap-ng-0.7.5-4.el7-x86_64/checksum_type: file exists
Usage:
  executor [flags]

Flags:
      --azure-container-registry-config string   Path to the file containing Azure container registry configuration information.
      --build-arg multi-arg type                 This flag allows you to pass in ARG values at build time. Set it repeatedly for multiple values.
  -c, --context string                           Path to the dockerfile build context. (default "/workspace/")
  -d, --destination multi-arg type               Registry the final image should be pushed to. Set it repeatedly for multiple destinations. (default )
  -f, --dockerfile string                        Path to the dockerfile to be built. (default "Dockerfile")
      --force                                    Force building outside of a container
  -h, --help                                     help for executor
      --insecure                                 Push to insecure registry using plain HTTP
      --no-push                                  Do not push the image to the registry
      --reproducible                             Strip timestamps out of the image to make it reproducible
      --single-snapshot                          Take a single snapshot at the end of the build.
      --skip-tls-verify                          Push to insecure registry ignoring TLS verify
      --snapshotMode string                      Change the file attributes inspected during snapshotting (default "full")
      --tarPath string                           Path to save the image in as a tarball instead of pushing
      --target string                            Set the target build stage to build
  -v, --verbosity string                         Log level (debug, info, warn, error, fatal, panic (default "info")

Expected behavior

Run with no errors.

To Reproduce
Steps to reproduce the behavior:

  1. Create Dockerfile with above content
  2. Run command as above

Additional Information

  • Dockerfile
    See above
  • Build Context
    See above
  • Kaniko Image (fully qualified with digest)
    For v0.3.0: sha256:6324339a98d9074e9edfdb1798a7768b10866e273c257706cb5290ddf24d82cc
    For latest: sha256:42b4dd2a4651a300005bcaf23a0af74aaf25046c212f9c9556b4baeeda8985e5
@Bashton-MattBuckland
Copy link
Author

Ooh, looks related to this commit, so perhaps it's fixed?

63cecbf

@priyawadhwa
Copy link
Collaborator

@Bashton-MattBuckland , yah it looks like it should be solved by that commit! Could you give it a go with the latest version of the image (gcr.io/kaniko-project/executor:debug)

@priyawadhwa priyawadhwa added the kind/bug Something isn't working label Sep 13, 2018
@xanonid
Copy link
Contributor

xanonid commented Sep 19, 2018

The link bug with :latest is probably the same as in #351 and should be solved as soon as #360 is merged.

@rroller
Copy link

rroller commented Sep 21, 2018

I can confirm that #360 corrects the issue below... (I've tested it with one of my builds and it works fine now)

INFO[0000] Downloading base image gcr.io/google-appengine/openjdk:8 
INFO[0000] Mounted directories: [/kaniko /var/run /etc/mtab /proc /dev /dev/pts /sys /sys/fs/cgroup /sys/fs/cgroup/systemd /sys/fs/cgroup/cpuset /sys/fs/cgroup/blkio /sys/fs/cgroup/freezer /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/devices /sys/fs/cgroup/pids /sys/fs/cgroup/rdma /sys/fs/cgroup/memory /sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/perf_event /sys/fs/cgroup/hugetlb /dev/mqueue /source /containers /dev/termination-log /etc/resolv.conf /etc/hostname /etc/hosts /dev/shm /run/secrets/kubernetes.io/serviceaccount /proc/bus /proc/fs /proc/irq /proc/sys /proc/sysrq-trigger /proc/kcore /proc/timer_list /sys/firmware] 
INFO[0000] Extracting layer 0                           
error building image: error building stage: link /bin/gunzip /bin/uncompress: file exists

@priyawadhwa priyawadhwa self-assigned this Nov 16, 2018
priyawadhwa pushed a commit to priyawadhwa/kaniko that referenced this issue Nov 17, 2018
When we execute multistage builds, we store the fs of each intermediate
stage at /kaniko/<stage number> if it's used later in the build. This
created a bug when extracting hardlinks, because we weren't appending
the new directory to the link path.

So, if `/tmp/file1` and `/tmp/file2` were hardlinked, kaniko was trying
to link `/kaniko/0/tmp/file1` to `/tmp/file2` instead of
`/kaniko/0/tmp/file2`. This change will append the correct directory to
the link, and fixes GoogleContainerTools#437 GoogleContainerTools#362 GoogleContainerTools#352 GoogleContainerTools#342.
priyawadhwa pushed a commit to priyawadhwa/kaniko that referenced this issue Nov 17, 2018
When we execute multistage builds, we store the fs of each intermediate
stage at /kaniko/<stage number> if it's used later in the build. This
created a bug when extracting hardlinks, because we weren't appending
the new directory to the link path.

So, if `/tmp/file1` and `/tmp/file2` were hardlinked, kaniko was trying
to link `/kaniko/0/tmp/file1` to `/tmp/file2` instead of
`/kaniko/0/tmp/file2`. This change will append the correct directory to
the link, and fixes GoogleContainerTools#437 GoogleContainerTools#362 GoogleContainerTools#352 GoogleContainerTools#342.
priyawadhwa pushed a commit to priyawadhwa/kaniko that referenced this issue Nov 17, 2018
When we execute multistage builds, we store the fs of each intermediate
stage at /kaniko/<stage number> if it's used later in the build. This
created a bug when extracting hardlinks, because we weren't appending
the new directory to the link path.

So, if `/tmp/file1` and `/tmp/file2` were hardlinked, kaniko was trying
to link `/kaniko/0/tmp/file1` to `/tmp/file2` instead of
`/kaniko/0/tmp/file2`. This change will append the correct directory to
the link, and fixes GoogleContainerTools#437 GoogleContainerTools#362 GoogleContainerTools#352 GoogleContainerTools#342.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants