buildpacks / pack

CLI for building apps using Cloud Native Buildpacks
https://buildpacks.io
Apache License 2.0
2.57k stars 286 forks source link

pack build panics on Travis #102

Closed scothis closed 5 years ago

scothis commented 5 years ago

Building and running pack on travis-ci results in a panic, while the same source and command passes on mac OS.

$ pack build foo/bar --builder projectriff/builder:0.2.0-snapshot-ci-912b954091ca --run-image packs/run:v3alpha2 --path fats-uppercase-java-boot/                                                            
Using user-provided builder image projectriff/builder:0.2.0-snapshot-ci-912b954091ca
Pulling builder image projectriff/builder:0.2.0-snapshot-ci-912b954091ca (use --no-pull flag to skip this step)
2019/02/28 15:53:16 Unable to read "/home/travis/.docker/config.json": open /home/travis/.docker/config.json: no such file or directory
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/Nvveen/Gotty.readTermInfo(0xc0000229e0, 0x1f, 0x0, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/!nvveen/!gotty@v0.0.0-20120604004816-cd527374f1e5/gotty.go:232 +0xce8
github.com/Nvveen/Gotty.OpenTermInfo(0xc0000220e5, 0xf, 0xc0000220e5, 0xf, 0x0)
        /home/travis/gopath/pkg/mod/github.com/!nvveen/!gotty@v0.0.0-20120604004816-cd527374f1e5/gotty.go:45 +0x287
github.com/docker/docker/pkg/jsonmessage.DisplayJSONMessagesStream(0xa1c240, 0xc0000820c0, 0xa1c420, 0xc00000e018, 0x1, 0x1, 0x0, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/docker/docker@v0.7.3-0.20181027010111-b8e87cfdad8d/pkg/jsonmessage/jsonmessage.go:263 +0x5b8
github.com/buildpack/lifecycle/image.(*Factory).pullImage(0xd97ba0, 0xa1c420, 0xc00000e018, 0xc000340180, 0x7fff4bec1240, 0x32, 0x435503, 0x4df564)
        /home/travis/gopath/pkg/mod/github.com/buildpack/lifecycle@v0.0.0-20190130224558-68e8abc962e2/image/local.go:433 +0x201
github.com/buildpack/lifecycle/image.(*Factory).NewLocal(0xd97ba0, 0x7fff4bec1240, 0x32, 0xc000205801, 0x1, 0x1, 0x3b, 0x8c5500)
        /home/travis/gopath/pkg/mod/github.com/buildpack/lifecycle@v0.0.0-20190130224558-68e8abc962e2/image/local.go:47 +0x452
github.com/buildpack/pack.(*BuildFactory).BuildConfigFromFlags(0xc000304500, 0xc00031bf80, 0xc000251820, 0xa23fe0, 0xd95d20)
        /home/travis/pack/build_factory.go:169 +0x308
github.com/buildpack/pack/commands.Build.func1(0xc0002ff680, 0xc0003288c0, 0x1, 0x7, 0x830440, 0xc000205c48)
        /home/travis/pack/commands/build.go:32 +0x19d
github.com/buildpack/pack/commands.logError.func1(0xc0002ff680, 0xc0003288c0, 0x1, 0x7, 0x0, 0x0)
        /home/travis/pack/commands/commands.go:32 +0x63
github.com/spf13/cobra.(*Command).execute(0xc0002ff680, 0xc000328850, 0x7, 0x7, 0xc0002ff680, 0xc000328850)
        /home/travis/gopath/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x473
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002ff400, 0x7, 0x0, 0xc000337680)
        /home/travis/gopath/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0xc0002ff400, 0xc000205f28, 0x1)
        /home/travis/gopath/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800 +0x2b
main.main()
        /home/travis/pack/cmd/pack/main.go:58 +0x6c3
$ git rev-parse HEAD
8ef83e3d4052bdb2a5ee9850935a1999b862b72a

$ go version
go version go1.11.5 linux/amd64
scothis commented 5 years ago

I've managed to work around this issue by pinning the code producing the index out of bounds. I'm still not sure as to the root cause.

replace github.com/Nvveen/Gotty => github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd

...seems a shame to replace 7 year old code with 2 year old code.

benmoss commented 5 years ago

I'm seeing this on my dev machine too when I built from f38cbcc8717b62c82140a937a87a090da9745114