libcompose icon indicating copy to clipboard operation
libcompose copied to clipboard

nil panic error

Open bfosberry opened this issue 9 years ago • 10 comments

I get this error when building custom ServiceConfigs, either there is an internal bug, or something I'm configuring in my service config is not valid.

Any ideas?

INFO[0000] Building jet--_app...                        
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x5cc961]

goroutine 22 [running]:
encoding/json.(*Decoder).refill(0xc8203564e0, 0x0, 0x0)
    /usr/local/go/src/encoding/json/stream.go:152 +0x281
encoding/json.(*Decoder).readValue(0xc8203564e0, 0x1, 0x0, 0x0)
    /usr/local/go/src/encoding/json/stream.go:128 +0x41b
encoding/json.(*Decoder).Decode(0xc8203564e0, 0xa821c0, 0xc82036a090, 0x0, 0x0)
    /usr/local/go/src/encoding/json/stream.go:57 +0x159
github.com/docker/docker/pkg/jsonmessage.DisplayJSONMessagesStream(0x0, 0x0, 0x7f5862e84428, 0xc82002e010, 0x1, 0x1, 0x0, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go:161 +0x19e
github.com/docker/libcompose/docker.(*DaemonBuilder).Build(0xc8202fa388, 0xc820404620, 0x9, 0xc820301f80, 0x7f5860e00fd8, 0xc8203fa920, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/docker/builder.go:83 +0x8f7
github.com/docker/libcompose/docker.(*Service).build(0xc8203fa920, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/docker/service.go:143 +0x130
github.com/docker/libcompose/docker.(*Service).Build(0xc8203fa920, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/docker/service.go:135 +0x4f
github.com/docker/libcompose/project.(*Project).Build.func1.1(0x7f5860e00fd8, 0xc8203fa920, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/project.go:172 +0x33
github.com/docker/libcompose/project.(*serviceWrapper).Do(0xc8203f3340, 0xc8203c79b0, 0x15, 0x16, 0xcf2508)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/service-wrapper.go:100 +0x1f6
github.com/docker/libcompose/project.(*Project).Build.func1(0xc8203f3340, 0xc8203c79b0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/project.go:173 +0x49
created by github.com/docker/libcompose/project.(*Project).startService
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/project.go:378 +0x581

goroutine 1 [runnable]:
sync.runtime_Semacquire(0xc8203f336c)
    /usr/local/go/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc8203f3360)
    /usr/local/go/src/sync/waitgroup.go:126 +0xb4
github.com/docker/libcompose/project.(*serviceWrapper).Wait(0xc8203f3340, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/service-wrapper.go:112 +0x39
github.com/docker/libcompose/project.(*Project).traverse(0xc820301f80, 0xc820163401, 0xc8200eb500, 0xc8203c79b0, 0xcf2510, 0x0, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/project.go:425 +0x88c
github.com/docker/libcompose/project.(*Project).forEach(0xc820301f80, 0xc8200eb848, 0x1, 0x1, 0xcf2510, 0x0, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/project.go:332 +0x21e
github.com/docker/libcompose/project.(*Project).perform(0xc820301f80, 0x2b, 0x2c, 0xc8200eb848, 0x1, 0x1, 0xcf2510, 0x0, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/project.go:314 +0x9f
github.com/docker/libcompose/project.(*Project).Build(0xc820301f80, 0xc8200eb848, 0x1, 0x1, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/project.go:174 +0x79
github.com/codeship/jet/lib/compose.(*client).Load(0xc8203ca730, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc8200eb848, ...)
    /home/bfosberry/.go/src/github.com/codeship/jet/lib/compose/client.go:93 +0x1af
github.com/codeship/jet/lib/compose.(*client).Run(0xc8203ca730, 0x0, 0x0, 0x7fff198ae239, 0x3, 0x7fff198ae23d, 0x8, 0x0, 0x0, 0x0, ...)
    /home/bfosberry/.go/src/github.com/codeship/jet/lib/compose/client.go:51 +0x146
github.com/codeship/jet/lib/jet.(*client).Run.func1(0x7f5860e00aa0, 0xc8203ca730, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/codeship/jet/lib/jet/client.go:101 +0xfe
github.com/codeship/jet/lib/jet.(*client).dockerClientCall.func2(0x0, 0x0)
    /home/bfosberry/.go/src/github.com/codeship/jet/lib/jet/client.go:193 +0x49
github.com/codeship/jet/lib/jet.(*client).tryHandleUserError(0xc8203c3030, 0xc8200eba48, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/codeship/jet/lib/jet/client.go:226 +0x2d
github.com/codeship/jet/lib/jet.(*client).dockerClientCall(0xc8203c3030, 0xc8203d1100, 0xc820395d20, 0xc8200ebae8, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/codeship/jet/lib/jet/client.go:193 +0x134
github.com/codeship/jet/lib/jet.(*client).Run(0xc8203c3030, 0x7fff198ae239, 0x3, 0x7fff198ae23d, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/bfosberry/.go/src/github.com/codeship/jet/lib/jet/client.go:102 +0x247
main.main.func6(0xc820357040, 0xc82035ffb0, 0x2, 0x3)
    /home/bfosberry/.go/src/github.com/codeship/jet/cmd/jet/main.go:147 +0x3a1
github.com/spf13/cobra.(*Command).execute(0xc820357040, 0xc82035ff20, 0x3, 0x3, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/spf13/cobra/command.go:495 +0x6e3
github.com/spf13/cobra.(*Command).Execute(0xc8203576c0, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/spf13/cobra/command.go:560 +0x180
main.main()
    /home/bfosberry/.go/src/github.com/codeship/jet/cmd/jet/main.go:217 +0xfa3

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 5 [syscall]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/local/go/src/os/signal/signal_unix.go:28 +0x37

goroutine 18 [select, locked to thread]:
runtime.gopark(0xcf3228, 0xc82002cf28, 0xbabe60, 0x6, 0x433918, 0x2)
    /usr/local/go/src/runtime/proc.go:185 +0x163
runtime.selectgoImpl(0xc82002cf28, 0x0, 0x18)
    /usr/local/go/src/runtime/select.go:392 +0xa64
runtime.selectgo(0xc82002cf28)
    /usr/local/go/src/runtime/select.go:212 +0x12
runtime.ensureSigM.func1()
    /usr/local/go/src/runtime/signal1_unix.go:227 +0x353
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 20 [chan receive]:
github.com/docker/libcompose/project.(*defaultListener).start(0xc8203fa020)
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/listener.go:47 +0x9e
created by github.com/docker/libcompose/project.NewDefaultListener
    /home/bfosberry/.go/src/github.com/docker/libcompose/project/listener.go:42 +0xb5

goroutine 28 [runnable]:
archive/tar.isASCII(0xc820405e00, 0xb, 0xb)
    /usr/local/go/src/archive/tar/common.go:310 +0x4b
archive/tar.(*Writer).cString(0xc820350480, 0xc82035053b, 0xc, 0x178, 0xc820405e00, 0xb, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/archive/tar/writer.go:74 +0x59
archive/tar.(*Writer).octal(0xc820350480, 0xc82035053b, 0xc, 0x178, 0x5678b40f)
    /usr/local/go/src/archive/tar/writer.go:99 +0xea
archive/tar.(*Writer).numeric(0xc820350480, 0xc82035053b, 0xc, 0x178, 0x5678b40f, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/archive/tar/writer.go:108 +0x89
archive/tar.(*Writer).writeHeader(0xc820350480, 0xc8203e1e10, 0xc82012ab01, 0x0, 0x0)
    /usr/local/go/src/archive/tar/writer.go:194 +0xbd9
archive/tar.(*Writer).WriteHeader(0xc820350480, 0xc8203e1e10, 0x0, 0x0)
    /usr/local/go/src/archive/tar/writer.go:139 +0x3c
github.com/docker/docker/pkg/archive.(*tarAppender).addTarFile(0xc8205cfdd0, 0xc820405290, 0xe, 0xc820405c40, 0xf, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/docker/pkg/archive/archive.go:326 +0x8e6
github.com/docker/docker/pkg/archive.TarWithOptions.func1.2(0xc820405290, 0xe, 0x7f5862e88b88, 0xc82059f900, 0x0, 0x0, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/docker/pkg/archive/archive.go:609 +0x6f1
path/filepath.walk(0xc820405290, 0xe, 0x7f5862e88b88, 0xc82059f900, 0xc8205cfe18, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:349 +0x80
path/filepath.walk(0xc8205a36e0, 0x9, 0x7f5862e88b88, 0xc82059f540, 0xc8205cfe18, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:374 +0x4fc
path/filepath.walk(0xc8205a29e0, 0x4, 0x7f5862e88b88, 0xc82059e280, 0xc8205cfe18, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:374 +0x4fc
path/filepath.walk(0xc8205a2010, 0x4, 0x7f5862e88b88, 0xc82059e0a0, 0xc8205cfe18, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:374 +0x4fc
path/filepath.Walk(0xc8205a2010, 0x4, 0xc8205cfe18, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:396 +0xe1
github.com/docker/docker/pkg/archive.TarWithOptions.func1(0x7f5860e0d928, 0xc820142fe0, 0xc82046c6c0, 0xc82002fee0, 0xc820151d60, 0xc820142fc0, 0x2, 0x2, 0xc8201354d0, 0x2, ...)
    /home/bfosberry/.go/src/github.com/docker/docker/pkg/archive/archive.go:613 +0x882
created by github.com/docker/docker/pkg/archive.TarWithOptions
    /home/bfosberry/.go/src/github.com/docker/docker/pkg/archive/archive.go:615 +0x45d

goroutine 34 [runnable]:
github.com/docker/engine-api/client/transport/cancellable.Do.func3(0x7f5860e0da00, 0xc820294e60, 0xc82016a270, 0xc8203d4060)
    /home/bfosberry/.go/src/github.com/docker/engine-api/client/transport/cancellable/cancellable.go:77
created by github.com/docker/engine-api/client/transport/cancellable.Do
    /home/bfosberry/.go/src/github.com/docker/engine-api/client/transport/cancellable/cancellable.go:84 +0x335

goroutine 32 [runnable]:
sync.runtime_Syncsemacquire(0xc8205ed9c0)
    /usr/local/go/src/runtime/sema.go:237 +0x201
sync.(*Cond).Wait(0xc8205ed9b0)
    /usr/local/go/src/sync/cond.go:62 +0x9b
io.(*pipe).read(0xc8205ed980, 0xc820274000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/local/go/src/io/pipe.go:52 +0x2d2
io.(*PipeReader).Read(0xc82002fed8, 0xc820274000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/local/go/src/io/pipe.go:134 +0x50
github.com/docker/docker/pkg/progress.(*Reader).Read(0xc820148540, 0xc820274000, 0x8000, 0x8000, 0xc8202fa318, 0x0, 0x0)
    /home/bfosberry/.go/src/github.com/docker/docker/pkg/progress/progressreader.go:30 +0x73
io.(*multiReader).Read(0xc8203fa2a0, 0xc820274000, 0x8000, 0x8000, 0x8000, 0x0, 0x0)
    /usr/local/go/src/io/multi.go:13 +0xa4
io.copyBuffer(0x7f5860e0ed50, 0xc8203d1a20, 0x7f5860e0ec48, 0xc8203fa2a0, 0xc820274000, 0x8000, 0x8000, 0x70000, 0x0, 0x0)
    /usr/local/go/src/io/io.go:381 +0x247
io.Copy(0x7f5860e0ed50, 0xc8203d1a20, 0x7f5860e0ec48, 0xc8203fa2a0, 0xc8203d1a20, 0x0, 0x0)
    /usr/local/go/src/io/io.go:351 +0x64
net/http.(*transferWriter).WriteBody(0xc820153f10, 0x7f5860e0ecf8, 0xc8202fa318, 0x0, 0x0)
    /usr/local/go/src/net/http/transfer.go:218 +0x2b2
net/http.(*Request).write(0xc8203121c0, 0x7f5860e0d900, 0xc820156e80, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/request.go:462 +0xbb9
net/http.(*persistConn).writeLoop(0xc820090580)
    /usr/local/go/src/net/http/transport.go:1015 +0x27c
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:686 +0xc9d

bfosberry avatar Feb 23 '16 00:02 bfosberry

I managed to track this down, this happens when I create multiple projects with the same name :P

bfosberry avatar Feb 23 '16 02:02 bfosberry

@bfosberry hum, thanks for the report, marked it as bug as it shouldn't painc :stuck_out_tongue_closed_eyes:

vdemeester avatar Feb 23 '16 07:02 vdemeester

Yeah,I am sure I should not be doing that :P, thanks!

bfosberry avatar Feb 23 '16 15:02 bfosberry

This also happens when you have the wrong name for dockercfg_service in your steps definition. I had dockercfg_service: gcr_dockercfg in steps while defining the service as dockercfg_generator in services and got the same error.

d-Pixie avatar Mar 01 '16 11:03 d-Pixie

Hey, I am assuming you are using jet, which does not use this repo yet, I'll create a bug in our system for you, but any issues you have are not related to this repo.... Yet

bfosberry avatar Mar 01 '16 11:03 bfosberry

Hey @d-Pixie, I tracked this in our system, if you need to keep track if it please reach out to [email protected] with the bug id 114803397, just to keep this project clean.

bfosberry avatar Mar 01 '16 19:03 bfosberry

No worries :) I found the error quick enough, but I'm guessing it's not intended behavior for that case and a better error message might be in order.

/Jonas On 1 Mar 2016 20:05, "Brendan Fosberry" [email protected] wrote:

Hey @d-Pixie https://github.com/d-Pixie, I tracked this in our system, if you need to keep track if it please reach out to [email protected] with the bug id 114803397, just to keep this project clean.

— Reply to this email directly or view it on GitHub https://github.com/docker/libcompose/issues/158#issuecomment-190854432.

d-Pixie avatar Mar 01 '16 19:03 d-Pixie

Totally, thanks for reporting it!

On Tue, Mar 1, 2016 at 1:29 PM Jonas Schubert Erlandsson < [email protected]> wrote:

No worries :) I found the error quick enough, but I'm guessing it's not intended behavior for that case and a better error message might be in order.

/Jonas On 1 Mar 2016 20:05, "Brendan Fosberry" [email protected] wrote:

Hey @d-Pixie https://github.com/d-Pixie, I tracked this in our system, if you need to keep track if it please reach out to [email protected] with the bug id 114803397, just to keep this project clean.

— Reply to this email directly or view it on GitHub <https://github.com/docker/libcompose/issues/158#issuecomment-190854432 .

— Reply to this email directly or view it on GitHub https://github.com/docker/libcompose/issues/158#issuecomment-190864978.

bfosberry avatar Mar 01 '16 19:03 bfosberry

Np :) On 1 Mar 2016 20:50, "Brendan Fosberry" [email protected] wrote:

Totally, thanks for reporting it!

On Tue, Mar 1, 2016 at 1:29 PM Jonas Schubert Erlandsson < [email protected]> wrote:

No worries :) I found the error quick enough, but I'm guessing it's not intended behavior for that case and a better error message might be in order.

/Jonas On 1 Mar 2016 20:05, "Brendan Fosberry" [email protected] wrote:

Hey @d-Pixie https://github.com/d-Pixie, I tracked this in our system, if you need to keep track if it please reach out to [email protected] with the bug id 114803397, just to keep this project clean.

— Reply to this email directly or view it on GitHub < https://github.com/docker/libcompose/issues/158#issuecomment-190854432 .

— Reply to this email directly or view it on GitHub <https://github.com/docker/libcompose/issues/158#issuecomment-190864978 .

— Reply to this email directly or view it on GitHub https://github.com/docker/libcompose/issues/158#issuecomment-190873221.

d-Pixie avatar Mar 01 '16 20:03 d-Pixie

Hi, amazon-ecs-cli depends on libcompose and we have customers seeing similar errors https://github.com/aws/amazon-ecs-cli/issues/193. Is the issue that the compose file is invalid?

yinshiua avatar Mar 09 '17 19:03 yinshiua