Docker Compose Up runtime error when in ECS

  amazon-ec2, amazon-ecs, docker, docker-compose

I’ve been attempting to move a Docker project over from a local context to ECS following the guide from the docs, but when I try to run docker compose up in the ECS context, I get the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x253aeea]

goroutine 27 [running]:
github.com/docker/compose-cli/ecs.(*ecsAPIService).createTaskRole(0xc00035e940, 0xc00080a820, 0xc000837e90, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x49cbd88, ...)
        github.com/docker/compose-cli/ecs/cloudformation.go:465 +0x34a
github.com/docker/compose-cli/ecs.(*ecsAPIService).createService(0xc00035e940, 0xc00080a820, 0xc000837e90, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x49cbd88, ...)
        github.com/docker/compose-cli/ecs/cloudformation.go:174 +0x118
github.com/docker/compose-cli/ecs.(*ecsAPIService).convert(0xc00035e940, 0x37929e8, 0xc00052b410, 0xc00080a820, 0x0, 0x0, 0xc0001322b8)
        github.com/docker/compose-cli/ecs/cloudformation.go:153 +0x638
github.com/docker/compose-cli/ecs.(*ecsAPIService).Convert(0xc00035e940, 0x37929e8, 0xc00052b410, 0xc00080a820, 0x339ef88, 0x4, 0x0, 0x0, 0x0, 0x0, ...)
        github.com/docker/compose-cli/ecs/cloudformation.go:60 +0xb5
github.com/docker/compose-cli/ecs.(*ecsAPIService).Up(0xc00035e940, 0x37929e8, 0xc00052b410, 0xc00080a820, 0x0, 0x0, 0x0)
        github.com/docker/compose-cli/ecs/up.go:89 +0x17b
github.com/docker/compose-cli/api/compose.(*ServiceProxy).Up(0xc0002d6000, 0x37929e8, 0xc00052b410, 0xc00080a820, 0x0, 0x0, 0x0)
        github.com/docker/compose-cli/api/compose/proxy.go:186 +0xd0
github.com/docker/compose-cli/cli/cmd/compose.runUp.func1(0x37929e8, 0xc00052b410, 0x0, 0x0)
        github.com/docker/compose-cli/cli/cmd/compose/up.go:218 +0x63
github.com/docker/compose-cli/api/progress.Run.func1(0x37929e8, 0xc00052b410, 0x0, 0x0, 0x0, 0x0)
        github.com/docker/compose-cli/api/progress/writer.go:60 +0x39
github.com/docker/compose-cli/api/progress.RunWithStatus.func2(0x0, 0x0)
        github.com/docker/compose-cli/api/progress/writer.go:81 +0x79
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc00052b3b0, 0xc000998f00)
        golang.org/x/[email protected]/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
        golang.org/x/[email protected]/errgroup/errgroup.go:54 +0x66

I’m not sure what could be causing this since the container runs fine in a local context, and I’ve made sure the context has all of the required permissions.

Any advice on what I might be missing here would be greatly appreciated.

Source: Docker Questions

LEAVE A COMMENT