Skip to content

[BUG] fatal error: concurrent map iteration and map write during compose command #10319

Closed
@mikecl24

Description

@mikecl24

Description

There seems to be a race condition in the compose code. It happens ~5% of runs when the specific command I'm running is:

docker compose -f docker-compose.yml up --force-recreate --scale my-service=20 -d

which returns

fatal error: concurrent map iteration and map write

The complete stacktrace is here

goroutine 64 [running]:
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:456 +0x96
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc0000061a0?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x3166701?)
sync/waitgroup.go:139 +0x52
golang.org/x/sync/errgroup.(*Group).Wait(0xc0000c2ac0)
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:53 +0x27
github.com/docker/compose/v2/pkg/progress.RunWithStatus({0x222c500, 0xc00019be40}, 0xc0002bec70)
github.com/docker/compose/v2/pkg/progress/writer.go:91 +0x21e
github.com/docker/compose/v2/pkg/progress.Run({0x222c500, 0xc00019be40}, 0xc000365620)
github.com/docker/compose/v2/pkg/progress/writer.go:62 +0x6d
github.com/docker/compose/v2/pkg/compose.(*composeService).Up(0xc000312f60, {0x222c500, 0xc00019be40}, 0xc00017bae0, {{{0xc00019bc80, 0x0, 0x4}, 0x0, 0x0, {0x1ef5d84, ...}, ...}, ...})
github.com/docker/compose/v2/pkg/compose/up.go:34 +0x13f
github.com/docker/compose/v2/pkg/api.(*ServiceProxy).Up(0xc0004222d0, {0x222c500, 0xc00019be40}, 0x0?, {{{0xc00019bc80, 0x0, 0x4}, 0x0, 0x0, {0x1ef5d84, ...}, ...}, ...})
github.com/docker/compose/v2/pkg/api/proxy.go:181 +0x143
github.com/docker/compose/v2/cmd/compose.runUp({0x222c500?, 0xc00019be40}, {0x7fa60080ef98, 0xc0001fa600}, {0x2242f10, 0xc0004222d0}, {0x0, 0x0, {0x1ef941a, 0x7}, ...}, ...)
github.com/docker/compose/v2/cmd/compose/up.go:191 +0x931
github.com/docker/compose/v2/cmd/compose.upCommand.func2({0x222c500, 0xc00019be40}, 0xc00017bae0, {0xc00019bc80, 0x0, 0x4})
github.com/docker/compose/v2/cmd/compose/up.go:87 +0x1e5
github.com/docker/compose/v2/cmd/compose.(*ProjectOptions).WithServices.func1({0x222c500, 0xc00019be40}, {0xc00019bc80, 0x0, 0x4})
github.com/docker/compose/v2/cmd/compose/compose.go:127 +0xd7
github.com/docker/compose/v2/cmd/compose.Adapt.func1({0x222c500?, 0xc00019be40?}, 0x2?, {0xc00019bc80?, 0x1?, 0x0?})
github.com/docker/compose/v2/cmd/compose/compose.go:92 +0x36
github.com/docker/compose/v2/cmd/compose.AdaptCmd.func1(0xc000129b00, {0xc00019bc80, 0x0, 0x4})
github.com/docker/compose/v2/cmd/compose/compose.go:71 +0x21c
github.com/spf13/cobra.(*Command).execute(0xc000129b00, {0xc0001ab8c0, 0x4, 0x4})
github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000425500)
github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.6.1/command.go:968
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0x40db07?, 0xc000129800, {{0x1ef54f1, 0x5}, {0x1efec87, 0xb}, {0x2209b28, 0x7}, {0x0, 0x0}, ...})
github.com/docker/cli@v23.0.0+incompatible/cli-plugins/plugin/plugin.go:51 +0x130
github.com/docker/cli/cli-plugins/plugin.Run(0x2012c20, {{0x1ef54f1, 0x5}, {0x1efec87, 0xb}, {0x2209b28, 0x7}, {0x0, 0x0}, {0x0, ...}, ...})
github.com/docker/cli@v23.0.0+incompatible/cli-plugins/plugin/plugin.go:64 +0xee
main.pluginMain()
github.com/docker/compose/v2/cmd/main.go:36 +0xdf
main.main()
github.com/docker/compose/v2/cmd/main.go:68 +0x198

goroutine 19 [syscall]:
os/signal.signal_recv()
runtime/sigqueue.go:152 +0x2f
os/signal.loop()
os/signal/signal_unix.go:23 +0x19
created by os/signal.Notify.func1.1
os/signal/signal.go:151 +0x2a

goroutine 36 [chan receive]:
github.com/docker/compose/v2/cmd/compose.AdaptCmd.func1.1()
github.com/docker/compose/v2/cmd/compose/compose.go:67 +0x28
created by github.com/docker/compose/v2/cmd/compose.AdaptCmd.func1
github.com/docker/compose/v2/cmd/compose/compose.go:66 +0x1da

goroutine 37 [chan receive]:
github.com/docker/compose/v2/cmd/compose.AdaptCmd.func1.1()
github.com/docker/compose/v2/cmd/compose/compose.go:67 +0x28
created by github.com/docker/compose/v2/cmd/compose.AdaptCmd.func1
github.com/docker/compose/v2/cmd/compose/compose.go:66 +0x1da

goroutine 39 [select]:
github.com/docker/compose/v2/pkg/progress.(*ttyWriter).Start(0xc0005b6d90, {0x222c538, 0xc0001a6000})
github.com/docker/compose/v2/pkg/progress/tty.go:52 +0x114
github.com/docker/compose/v2/pkg/progress.RunWithStatus.func1()
github.com/docker/compose/v2/pkg/progress/writer.go:77 +0x30
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 40 [semacquire]:
sync.runtime_Semacquire(0xc000356100?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x222c500?)
sync/waitgroup.go:139 +0x52
golang.org/x/sync/errgroup.(*Group).Wait(0xc0003560c0)
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:53 +0x27
github.com/docker/compose/v2/pkg/compose.(*graphTraversal).visit(0xc0001800a0, {0x222c5a8, 0xc0002c0660}, 0x40db07?)
github.com/docker/compose/v2/pkg/compose/dependencies.go:108 +0x10f
github.com/docker/compose/v2/pkg/compose.InDependencyOrder({0x222c5a8, 0xc0002c0660}, 0xc000055fc0?, 0xc0005b6000, {0x0, 0x0, 0xa?})
github.com/docker/compose/v2/pkg/compose/dependencies.go:86 +0x110
github.com/docker/compose/v2/pkg/compose.(*convergence).apply(0xc000010240, {0x222c5a8, 0xc0002c0660}, 0xc00017bae0, {{0xc0002beca0, 0x1, 0x1}, 0x0, 0x0, {0x1ef5d84, ...}, ...})
github.com/docker/compose/v2/pkg/compose/convergence.go:90 +0x111
github.com/docker/compose/v2/pkg/compose.(*composeService).create(0xc000312f60?, {0x222c5a8, 0xc0002c0660}, 0xc00017bae0, {{0xc0002beca0, 0x1, 0x1}, 0x0, 0x0, {0x1ef5d84, ...}, ...})
github.com/docker/compose/v2/pkg/compose/create.go:114 +0x6b0
github.com/docker/compose/v2/pkg/compose.(*composeService).Up.func1({0x222c5a8, 0xc0002c0660})
github.com/docker/compose/v2/pkg/compose/up.go:35 +0xaa
github.com/docker/compose/v2/pkg/progress.Run.func1({0x222c5a8?, 0xc0002c0660?})
github.com/docker/compose/v2/pkg/progress/writer.go:63 +0x27
github.com/docker/compose/v2/pkg/progress.RunWithStatus.func2()
github.com/docker/compose/v2/pkg/progress/writer.go:84 +0x87
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 42 [IO wait]:
internal/poll.runtime_pollWait(0x7fa6007c52f8, 0x72)
runtime/netpoll.go:305 +0x89
internal/poll.(*pollDesc).wait(0xc0001b8c00?, 0xc00023d000?, 0x0)
internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0001b8c00, {0xc00023d000, 0x1000, 0x1000})
internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc0001b8c00, {0xc00023d000?, 0x4062b1?, 0x4?})
net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000012b90, {0xc00023d000?, 0x0?, 0x0?})
net/net.go:183 +0x45
net/http.(*persistConn).Read(0xc0002bcc60, {0xc00023d000?, 0xc0000c8000?, 0xc00058ad30?})
net/http/transport.go:1929 +0x4e
bufio.(*Reader).fill(0xc000454780)
bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc000454780, 0x1)
bufio/bufio.go:144 +0x5d
net/http.(*persistConn).readLoop(0xc0002bcc60)
net/http/transport.go:2093 +0x1ac
created by net/http.(*Transport).dialConn
net/http/transport.go:1751 +0x173e

goroutine 43 [select]:
net/http.(*persistConn).writeLoop(0xc0002bcc60)
net/http/transport.go:2392 +0xf5
created by net/http.(*Transport).dialConn
net/http/transport.go:1752 +0x1791

goroutine 50 [semacquire]:
sync.runtime_Semacquire(0xc000055fc0?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0xd?)
sync/waitgroup.go:139 +0x52
golang.org/x/sync/errgroup.(*Group).Wait(0xc000356180)
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:53 +0x27
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService(, {, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:239 +0x3e8
github.com/docker/compose/v2/pkg/compose.(*convergence).apply.func1({0x222c500, 0xc000356040}, {0xc00012e198, 0x12})
github.com/docker/compose/v2/pkg/compose/convergence.go:100 +0x1ce
github.com/docker/compose/v2/pkg/compose.(*graphTraversal).run.func1()
github.com/docker/compose/v2/pkg/compose/dependencies.go:127 +0x63
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 51 [semacquire]:
sync.runtime_Semacquire(0x1ef1301?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc00043b900?, 0x1?}, {0x80?, 0x8c?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0xc0007ac348?, {0x1ef1300?, 0xc00043b900?, 0x1?}, {0x80?, 0x3e?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc00043b900?, {0x1ef1300?, 0xc00043b900?}, {0xd8?, 0xc3?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc00043b900})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 52 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0004c2500?, 0x30?}, {0x18?, 0xef?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0004c2500?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0004c2500?, {0x1ef1300?, 0xc0004c2500?}, {0xd8?, 0x83?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0004c2500})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 53 [semacquire]:
sync.runtime_Semacquire(0x1ef1301?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0001c8a00?, 0xc0002c0a80?}, {0x0?, 0x0?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0xc000740348?, {0x1ef1300?, 0xc0001c8a00?, 0x0?}, {0x80?, 0x3e?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0001c8a00?, {0x1ef1300?, 0xc0001c8a00?}, {0xd8?, 0x3?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0001c8a00})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 54 [runnable]:
sync.runtime_SemacquireMutex(0x40?, 0x0?, 0xc00048e000?)
runtime/sema.go:77 +0x25
sync.(*Mutex).lockSlow(0xc00022d028)
sync/mutex.go:171 +0x165
sync.(*Mutex).Lock(...)
sync/mutex.go:90
github.com/docker/compose/v2/pkg/progress.(*ttyWriter).Event(0xc0005b6d90, {{0xc00048e000, 0x35}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x1efa583, 0x8}, ...})
github.com/docker/compose/v2/pkg/progress/tty.go:72 +0x6d
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(, {, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:414 +0x17b
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 55 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0004c2a00?, 0x30?}, {0x18?, 0xef?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0004c2a00?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0004c2a00?, {0x1ef1300?, 0xc0004c2a00?}, {0xd8?, 0x3?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0004c2a00})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 56 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0007b8000?, 0x30?}, {0xb8?, 0xe5?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0007b8000?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0007b8000?, {0x1ef1300?, 0xc0007b8000?}, {0xd8?, 0x43?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0007b8000})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 57 [runnable]:
reflect.(*rtype).Name(0x1bf7540?)
reflect/type.go:919 +0xb0
encoding/json.typeFields({0x22439f0, 0x1ef1300})
encoding/json/encode.go:1271 +0xd36
encoding/json.cachedTypeFields({0x22439f0?, 0x1ef1300})
encoding/json/encode.go:1416 +0xab
encoding/json.newStructEncoder({0x22439f0?, 0x1ef1300?})
encoding/json/encode.go:770 +0x27
encoding/json.newTypeEncoder({0x22439f0, 0x1ef1300}, 0x1)
encoding/json/encode.go:450 +0x313
encoding/json.typeEncoder({0x22439f0?, 0x1ef1300})
encoding/json/encode.go:403 +0x16b
encoding/json.valueEncoder({0x1ef1300?, 0xc000241900?, 0x80?})
encoding/json/encode.go:377 +0x4a
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc000241900?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x4a
encoding/json.(*encodeState).marshal(0xc000241900?, {0x1ef1300?, 0xc000241900?}, {0xd8?, 0x23?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc000241900})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 58 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc00074c000?, 0x30?}, {0x8?, 0xe1?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc00074c000?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc00074c000?, {0x1ef1300?, 0xc00074c000?}, {0xd8?, 0x83?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc00074c000})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 59 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc00074c500?, 0x30?}, {0x8?, 0xe1?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc00074c500?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc00074c500?, {0x1ef1300?, 0xc00074c500?}, {0xd8?, 0x23?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc00074c500})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 60 [runnable]:
encoding/json.Marshal({0x1ef1300, 0xc0007b8f00})
encoding/json/encode.go:157 +0x127
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 61 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0007b8a00?, 0x30?}, {0xb8?, 0xe5?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0007b8a00?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0007b8a00?, {0x1ef1300?, 0xc0007b8a00?}, {0xd8?, 0x63?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0007b8a00})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 62 [runnable]:
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 63 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0007b8500?, 0x30?}, {0xb8?, 0xe5?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0007b8500?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0007b8500?, {0x1ef1300?, 0xc0007b8500?}, {0xd8?, 0xe3?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0007b8500})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 65 [runnable]:
sync.runtime_SemacquireMutex(0x40?, 0x0?, 0xc000374180?)
runtime/sema.go:77 +0x25
sync.(*Mutex).lockSlow(0xc00022d028)
sync/mutex.go:171 +0x165
sync.(*Mutex).Lock(...)
sync/mutex.go:90
github.com/docker/compose/v2/pkg/progress.(*ttyWriter).Event(0xc0005b6d90, {{0xc000374180, 0x36}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x1efa583, 0x8}, ...})
github.com/docker/compose/v2/pkg/progress/tty.go:72 +0x6d
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(, {, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:414 +0x17b
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 66 [runnable]:
sync.runtime_SemacquireMutex(0x40?, 0x0?, 0xc0003741c0?)
runtime/sema.go:77 +0x25
sync.(*Mutex).lockSlow(0xc00022d028)
sync/mutex.go:171 +0x165
sync.(*Mutex).Lock(...)
sync/mutex.go:90
github.com/docker/compose/v2/pkg/progress.(*ttyWriter).Event(0xc0005b6d90, {{0xc0003741c0, 0x36}, {0x0, 0x0}, {0x0, 0x0}, 0x0, {0x1efa583, 0x8}, ...})
github.com/docker/compose/v2/pkg/progress/tty.go:72 +0x6d
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(, {, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:414 +0x17b
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 67 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0004c3400?, 0x30?}, {0x18?, 0xef?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0004c3400?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0004c3400?, {0x1ef1300?, 0xc0004c3400?}, {0xd8?, 0x83?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0004c3400})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 68 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0004c3900?, 0x30?}, {0x18?, 0xef?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0004c3900?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0004c3900?, {0x1ef1300?, 0xc0004c3900?}, {0xd8?, 0x3?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0004c3900})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 69 [runnable]:
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 70 [semacquire]:
sync.runtime_Semacquire(0x1ef1300?)
runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1ef1300?)
sync/waitgroup.go:139 +0x52
encoding/json.typeEncoder.func1(0x1ef1300?, {0x1ef1300?, 0xc0004c2000?, 0x30?}, {0x18?, 0xef?})
encoding/json/encode.go:395 +0x55
encoding/json.(*encodeState).reflectValue(0x0?, {0x1ef1300?, 0xc0004c2000?, 0x40db07?}, {0x78?, 0x0?})
encoding/json/encode.go:359 +0x78
encoding/json.(*encodeState).marshal(0xc0004c2000?, {0x1ef1300?, 0xc0004c2000?}, {0xd8?, 0xe3?})
encoding/json/encode.go:331 +0xfa
encoding/json.Marshal({0x1ef1300, 0xc0004c2000})
encoding/json/encode.go:160 +0x45
github.com/docker/compose/v2/pkg/compose.ServiceHash({{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
github.com/docker/compose/v2/pkg/compose/hash.go:36 +0xc5
github.com/docker/compose/v2/pkg/compose.(*composeService).prepareLabels(, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:463 +0x1fd
github.com/docker/compose/v2/pkg/compose.(*composeService).getCreateOptions(
, {_, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/create.go:242 +0x8f
github.com/docker/compose/v2/pkg/compose.(*composeService).createMobyContainer(
, {
, }, , {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:481 +0xe6
github.com/docker/compose/v2/pkg/compose.(*composeService).recreateContainer(
, {
, _}, _, {{0xc00012e198, 0x12}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
github.com/docker/compose/v2/pkg/compose/convergence.go:428 +0x3f2
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService.func2()
github.com/docker/compose/v2/pkg/compose/convergence.go:199 +0xd0
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

Steps To Reproduce

  1. As far as I can tell the issue is not environment specific
  2. No special config, use any arbitrary docker image that can be scaled
  3. Run docker compose -f docker-compose.yml up --force-recreate --scale my-service=20 -d

I have reproduced it less often with scaling =4 (~2%), so maybe the race condition is proportionally likely to the scale number (or maybe I was just unlucky).

Compose Version

docker compose version:
Docker Compose version v2.16.0


docker-compose version not installed

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.16.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 9
  Running: 9
  Paused: 0
  Stopped: 0
 Images: 36
 Server Version: 23.0.1
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 3.10.0-1160.83.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 64
 Total Memory: 125.4GiB
 Name: hostname.local
 ID: 
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions