podman: building libpod using podman fails, if image already present.

Is this a BUG REPORT or FEATURE REQUEST?:

[//]: kind bug

Description If libpod is build using libpod, it fails if image is build once with following error

If image cache exists, error happens while resolving the symlinks.

error checking if cached image exists from a previous build: error checking if copied files match: error resolving symlinks and comparing modified times: "/home/kunal/go/src/github.com/containers/libpod": panic: runtime error: slice bounds out of range

Steps to reproduce the issue:

  1. sudo make dbuild

  2. after completion of build, make some changes in code.

  3. sudo make dbuild.

Describe the results you received:

sudo make dbuild
.
.
.
.
STEP 9: FROM 338ec34b19a9b4487720de6f7e16bd6e92083aa6ae971cfd99cd4bb95bd2eb17
STEP 10: RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list
--> Using cache 0b059236b43fe02da36f450c41ae633027b1092c0bb1885d4beaec369c036834
STEP 11: FROM 0b059236b43fe02da36f450c41ae633027b1092c0bb1885d4beaec369c036834
STEP 12: RUN apt-get update && apt-get install -y     apparmor     autoconf     automake     bison     build-essential     curl     e2fslibs-dev     gawk     gettext     go-md2man     iptables     pkg-config     libaio-dev     libcap-dev     libfuse-dev     libnet-dev     libnl-3-dev     libostree-dev     libprotobuf-dev     libprotobuf-c0-dev     libtool     libudev-dev     protobuf-c-compiler     protobuf-compiler     python-minimal     libglib2.0-dev     libapparmor-dev     btrfs-tools     libdevmapper1.02.1     libdevmapper-dev     libgpgme11-dev     liblzma-dev     netcat     socat     python3-pip     python3-dateutil     python3-setuptools     python3-psutil     python3-pytoml     lsof     xz-utils     --no-install-recommends     && apt-get clean
--> Using cache c97667b08dbd449bd40ca7992b4836c2b18d2d34ab5ad42cac7d6bfe18071a95
STEP 13: FROM c97667b08dbd449bd40ca7992b4836c2b18d2d34ab5ad42cac7d6bfe18071a95
STEP 14: ADD . /go/src/github.com/containers/libpod
error checking if cached image exists from a previous build: error checking if copied files match: error resolving symlinks and comparing modified times: "/home/kunal/go/src/github.com/containers/libpod": panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/containers/libpod/vendor/github.com/containers/buildah/imagebuildah.modTimeIsGreater(0x7ffe3556edef, 0x2f, 0x7ffe3556ee1f, 0x2f, 0x7ffe3556ee4f, 0x1e, 0xc4202bf698, 0x41cbec, 0x415a14)
        /go/src/github.com/containers/libpod/vendor/github.com/containers/buildah/imagebuildah/chroot_symlink.go:142 +0x3a2
github.com/containers/libpod/vendor/github.com/containers/buildah/imagebuildah.resolveSymlinkTimeModified()
        /go/src/github.com/containers/libpod/vendor/github.com/containers/buildah/imagebuildah/chroot_symlink.go:98 +0x211
github.com/containers/libpod/vendor/github.com/containers/storage/pkg/reexec.Init(0x1133a80)
        /go/src/github.com/containers/libpod/vendor/github.com/containers/storage/pkg/reexec/reexec.go:26 +0x77
main.main()
        /go/src/github.com/containers/libpod/cmd/podman/main.go:51 +0x71
: exit status 2
Makefile:150: recipe for target 'libpodimage' failed
make: *** [libpodimage] Error 125

Describe the results you expected: Build should not fail.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

$ sudo podman version
Version:       0.12.2-dev
Go Version:    go1.10.5
Git Commit:    "1c805191ba732aba770cab421cbfdf057dad6f3a-dirty"
Built:         Tue Dec 11 16:51:48 2018
OS/Arch:       linux/amd64

Output of podman info:

$ sudo podman info
host:
  BuildahVersion: 1.6-dev
  Conmon:
    package: Unknown
    path: /usr/libexec/podman/conmon
    version: 'conmon version 1.12.0-dev, commit: 6515d2577507771758b922cedf4874fa1811bce7'
  Distribution:
    distribution: elementary
    version: "5.0"
  MemFree: 1193598976
  MemTotal: 16529944576
  OCIRuntime:
    package: Unknown
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc5+dev
      commit: f3ce8221ea760f51b5403a9892a69ace43845c2c
      spec: 1.0.1-dev
  SwapFree: 2147217408
  SwapTotal: 2147479552
  arch: amd64
  cpus: 8
  hostname: kunal-HP-dev
  kernel: 4.15.0-42-generic
  os: linux
  rootless: false
  uptime: 27h 13m 42.9s (Approximately 1.12 days)
insecure registries:
  registries: []
registries:
  registries:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ContainerStore:
    number: 16
  GraphDriverName: overlay
  GraphOptions: null
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
  ImageStore:
    number: 74
  RunRoot: /var/run/containers/storage

Additional environment details (AWS, VirtualBox, physical, etc.):

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (23 by maintainers)

Most upvoted comments

I am able to recreate.

I put a debug message in modTimeIsGreater and got found out that path and rootdir are the same, which makes path[len(rootdir)+1:] invalid.

Both are /home/sjennings/projects/go/src/github.com/openshift/machine-config-operator in my case.