Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] fatal error: concurrent map writes #12186

Closed
yusing opened this issue Oct 6, 2024 · 1 comment
Closed

[BUG] fatal error: concurrent map writes #12186

yusing opened this issue Oct 6, 2024 · 1 comment

Comments

@yusing
Copy link

yusing commented Oct 6, 2024

Description

[+] Running 0/0
 ⠋ Container morphic  Stopping                                                                                                             0.1s 
fatal error: concurrent map writes

goroutine 44 [running]:
github.com/docker/compose/v2/pkg/compose.(*convergence).stopDependentContainers(_, {_, _}, _, {{0xc00040aa27, 0x7}, {0x0, 0x0, 0x0}, 0x0, ...})
        github.com/docker/compose/v2/pkg/compose/convergence.go:235 +0x1b4
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService(_, {_, _}, _, {{0xc00040aa27, 0x7}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
        github.com/docker/compose/v2/pkg/compose/convergence.go:162 +0x694
github.com/docker/compose/v2/pkg/compose.(*composeService).create.(*convergence).apply.func1.1({0x2747d48, 0xc000571aa0})
        github.com/docker/compose/v2/pkg/compose/convergence.go:103 +0x10b
github.com/docker/compose/v2/internal/tracing.SpanWrapFunc.func1({0x2747d80, 0xc000632140})
        github.com/docker/compose/v2/internal/tracing/wrap.go:43 +0x1c4
github.com/docker/compose/v2/pkg/compose.(*composeService).create.(*convergence).apply.func1({0x2747d80, 0xc000632140}, {0xc00040aa27, 0x7})
        github.com/docker/compose/v2/pkg/compose/convergence.go:104 +0x2e3
github.com/docker/compose/v2/pkg/compose.(*graphTraversal).run.func1()
        github.com/docker/compose/v2/pkg/compose/dependencies.go:184 +0x99
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 28
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75 +0x96

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc0001f7578?)
        runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x21ecec0?)
        sync/waitgroup.go:116 +0x48
golang.org/x/sync/errgroup.(*Group).Wait(0xc0002e8580)
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:56 +0x25
github.com/docker/compose/v2/pkg/progress.RunWithStatus({0x2747d48, 0xc00076a2a0}, 0xc000762260, 0xc0003177a0, {0x23a0c25, 0x7})
        github.com/docker/compose/v2/pkg/progress/writer.go:97 +0x1ef
github.com/docker/compose/v2/pkg/progress.Run({0x2747d48, 0xc00076a2a0}, 0xc0002e8540, 0xc0003177a0)
        github.com/docker/compose/v2/pkg/progress/writer.go:61 +0x85
github.com/docker/compose/v2/pkg/compose.(*composeService).Up(0xc0002e8a80, {0x2747d48, 0xc00076a2a0}, _, {{0xc00076c000, {0xc0002651d0, 0x0, 0x1}, 0x0, 0x0, ...}, ...})
        github.com/docker/compose/v2/pkg/compose/up.go:40 +0x233
github.com/docker/compose/v2/cmd/compose.runUp({_, _}, {_, _}, {_, _}, {0x0, 0x0, {0x239eff0, 0x6}, ...}, ...)
        github.com/docker/compose/v2/cmd/compose/up.go:295 +0xc14
github.com/docker/compose/v2/cmd/compose.upCommand.func2({0x2747d48, 0xc00076a2a0}, 0xc0006c8990, {0xc0002651d0, 0x0, 0x1})
        github.com/docker/compose/v2/cmd/compose/up.go:136 +0x2d8
github.com/docker/compose/v2/cmd/compose.upCommand.(*ProjectOptions).WithServices.func4({0x2747d80, 0xc0006320f0}, {0xc0002651d0, 0x0, 0x1})
        github.com/docker/compose/v2/cmd/compose/compose.go:170 +0x1a3
github.com/docker/compose/v2/cmd/compose.upCommand.(*ProjectOptions).WithServices.Adapt.func6({0x2747d80?, 0xc0006320f0?}, 0x2?, {0xc0002651d0?, 0x272d550?, 0x10cb2f3?})
        github.com/docker/compose/v2/cmd/compose/compose.go:125 +0x30
github.com/docker/compose/v2/cmd/compose.upCommand.(*ProjectOptions).WithServices.Adapt.AdaptCmd.func7(0xc00045d208, {0xc0002651d0, 0x0, 0x1})
        github.com/docker/compose/v2/cmd/compose/compose.go:101 +0x154
github.com/docker/cli/cli-plugins/plugin.RunPlugin.func1.1.2(0xc00045d208, {0xc0002651d0, 0x0, 0x1})
        github.com/docker/cli@v27.3.0-rc.2+incompatible/cli-plugins/plugin/plugin.go:64 +0x6c
github.com/docker/compose/v2/cmd/cmdtrace.Setup.wrapRunE.func2(0xc00045d208?, {0xc0002651d0?, 0x0?, 0x1?})
        github.com/docker/compose/v2/cmd/cmdtrace/cmd_span.go:85 +0x63
github.com/spf13/cobra.(*Command).execute(0xc00045d208, {0xc00036f1f0, 0x1, 0x1})
        github.com/spf13/cobra@v1.8.1/command.go:985 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003b4908)
        github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.8.1/command.go:1041
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0xc0003968c0, 0xc00045cf08, {{0x239daa7, 0x5}, {0x23a79d5, 0xb}, {0x271cd50, 0x7}, {0x0, 0x0}, ...})
        github.com/docker/cli@v27.3.0-rc.2+incompatible/cli-plugins/plugin/plugin.go:79 +0x145
github.com/docker/cli/cli-plugins/plugin.Run(0x24ec588, {{0x239daa7, 0x5}, {0x23a79d5, 0xb}, {0x271cd50, 0x7}, {0x0, 0x0}, {0x0, ...}})
        github.com/docker/cli@v27.3.0-rc.2+incompatible/cli-plugins/plugin/plugin.go:94 +0x165
main.pluginMain()
        github.com/docker/compose/v2/cmd/main.go:38 +0xa5
main.main()
        github.com/docker/compose/v2/cmd/main.go:98 +0x19c

goroutine 11 [IO wait]:
internal/poll.runtime_pollWait(0x7508a6e41700, 0x72)
        runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc0001e9e80?, 0xc000505fbf?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0001e9e80, {0xc000505fbf, 0x1, 0x1})
        internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc0001e9e80, {0xc000505fbf?, 0x0?, 0x0?})
        net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc0000bba58, {0xc000505fbf?, 0x0?, 0x0?})
        net/net.go:185 +0x45
github.com/docker/cli/cli-plugins/socket.ConnectAndWait.func1()
        github.com/docker/cli@v27.3.0-rc.2+incompatible/cli-plugins/socket/socket.go:162 +0x45
created by github.com/docker/cli/cli-plugins/socket.ConnectAndWait in goroutine 1
        github.com/docker/cli@v27.3.0-rc.2+incompatible/cli-plugins/socket/socket.go:159 +0x118

goroutine 15 [select]:
go.opentelemetry.io/otel/sdk/trace.(*batchSpanProcessor).processQueue(0xc0003b35e0)
        go.opentelemetry.io/otel/sdk@v1.21.0/trace/batch_span_processor.go:312 +0x11d
go.opentelemetry.io/otel/sdk/trace.NewBatchSpanProcessor.func1()
        go.opentelemetry.io/otel/sdk@v1.21.0/trace/batch_span_processor.go:128 +0x54
created by go.opentelemetry.io/otel/sdk/trace.NewBatchSpanProcessor in goroutine 1
        go.opentelemetry.io/otel/sdk@v1.21.0/trace/batch_span_processor.go:126 +0x2e5

goroutine 13 [IO wait]:
internal/poll.runtime_pollWait(0x7508a6e41608, 0x72)
        runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc0003fe980?, 0xc0003b9000?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0003fe980, {0xc0003b9000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc0003fe980, {0xc0003b9000?, 0xc0005cff28?, 0xc000790000?})
        net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc0000bbb40, {0xc0003b9000?, 0x0?, 0xc0005a26a0?})
        net/net.go:185 +0x45
net/http.(*persistConn).Read(0xc000313b00, {0xc0003b9000?, 0x454840?, 0xc0005cff28?})
        net/http/transport.go:1977 +0x4a
bufio.(*Reader).fill(0xc0000e30e0)
        bufio/bufio.go:110 +0x103
bufio.(*Reader).Peek(0xc0000e30e0, 0x1)
        bufio/bufio.go:148 +0x53
net/http.(*persistConn).readLoop(0xc000313b00)
        net/http/transport.go:2141 +0x1b9
created by net/http.(*Transport).dialConn in goroutine 12
        net/http/transport.go:1799 +0x152f

goroutine 14 [select]:
net/http.(*persistConn).writeLoop(0xc000313b00)
        net/http/transport.go:2458 +0xf0
created by net/http.(*Transport).dialConn in goroutine 12
        net/http/transport.go:1800 +0x1585

goroutine 40 [syscall]:
os/signal.signal_recv()
        runtime/sigqueue.go:152 +0x29
os/signal.loop()
        os/signal/signal_unix.go:23 +0x13
created by os/signal.Notify.func1.1 in goroutine 1
        os/signal/signal.go:151 +0x1f

goroutine 41 [chan receive]:
github.com/docker/compose/v2/cmd/compose.upCommand.AdaptCmd.func3.1()
        github.com/docker/compose/v2/cmd/compose/compose.go:95 +0x27
created by github.com/docker/compose/v2/cmd/compose.upCommand.AdaptCmd.func3 in goroutine 1
        github.com/docker/compose/v2/cmd/compose/compose.go:94 +0x11c

goroutine 42 [chan receive]:
github.com/docker/compose/v2/cmd/compose.upCommand.(*ProjectOptions).WithServices.Adapt.AdaptCmd.func7.1()
        github.com/docker/compose/v2/cmd/compose/compose.go:95 +0x27
created by github.com/docker/compose/v2/cmd/compose.upCommand.(*ProjectOptions).WithServices.Adapt.AdaptCmd.func7 in goroutine 1
        github.com/docker/compose/v2/cmd/compose/compose.go:94 +0x11c

goroutine 27 [select]:
github.com/docker/compose/v2/pkg/progress.(*ttyWriter).Start(0xc0003fe780, {0x2747a08, 0x39ed6e0})
        github.com/docker/compose/v2/pkg/progress/tty.go:54 +0x105
github.com/docker/compose/v2/pkg/progress.RunWithStatus.func1()
        github.com/docker/compose/v2/pkg/progress/writer.go:83 +0x2a
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75 +0x96

goroutine 28 [semacquire]:
sync.runtime_Semacquire(0x1d21ce8?)
        runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x1?)
        sync/waitgroup.go:116 +0x48
golang.org/x/sync/errgroup.(*Group).Wait(0xc0004569c0)
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:56 +0x25
github.com/docker/compose/v2/pkg/compose.(*graphTraversal).visit(0xc000632000, {0x2747d48, 0xc0006350e0}, 0xc0000d6400)
        github.com/docker/compose/v2/pkg/compose/dependencies.go:163 +0x226
github.com/docker/compose/v2/pkg/compose.InDependencyOrder({0x2747d48, 0xc0006350e0}, 0xc000447880?, 0xc0001e8180, {0x0, 0x0, 0xc0002e8a80?})
        github.com/docker/compose/v2/pkg/compose/dependencies.go:88 +0xf1
github.com/docker/compose/v2/pkg/compose.(*convergence).apply(...)
        github.com/docker/compose/v2/pkg/compose/convergence.go:92
github.com/docker/compose/v2/pkg/compose.(*composeService).create(0xc0002e8a80, {0x2747d48, 0xc0006350e0}, 0xc0006c8990, {0xc00076c000, {0xc0002e8780, 0x3, 0x4}, 0x0, 0x0, ...})
        github.com/docker/compose/v2/pkg/compose/create.go:118 +0x5c5
github.com/docker/compose/v2/pkg/compose.(*composeService).Up.func1({0x2747d48, 0xc0006350e0})
        github.com/docker/compose/v2/pkg/compose/up.go:41 +0x85
github.com/docker/compose/v2/pkg/compose.(*composeService).Up.SpanWrapFunc.func5({0x2747d48, 0xc0006350b0})
        github.com/docker/compose/v2/internal/tracing/wrap.go:43 +0x152
github.com/docker/compose/v2/pkg/progress.Run.func1({0x2747d48?, 0xc0006350b0?})
        github.com/docker/compose/v2/pkg/progress/writer.go:62 +0x22
github.com/docker/compose/v2/pkg/progress.RunWithStatus.func2()
        github.com/docker/compose/v2/pkg/progress/writer.go:90 +0x7f
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75 +0x96

goroutine 43 [select]:
github.com/docker/compose/v2/pkg/compose.(*graphTraversal).visit.func1()
        github.com/docker/compose/v2/pkg/compose/dependencies.go:147 +0x10c
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 28
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75 +0x96

goroutine 85 [IO wait]:
internal/poll.runtime_pollWait(0x7508a6e41418, 0x72)
        runtime/netpoll.go:345 +0x85
internal/poll.(*pollDesc).wait(0xc00076c200?, 0xc000759000?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc00076c200, {0xc000759000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:164 +0x27a
net.(*netFD).Read(0xc00076c200, {0xc000759000?, 0xc0000c7f28?, 0xc000790660?})
        net/fd_posix.go:55 +0x25
net.(*conn).Read(0xc0005a2448, {0xc000759000?, 0x0?, 0x0?})
        net/net.go:185 +0x45
net/http.(*persistConn).Read(0xc000729d40, {0xc000759000?, 0x454840?, 0xc0000c7f28?})
        net/http/transport.go:1977 +0x4a
bufio.(*Reader).fill(0xc0005f6660)
        bufio/bufio.go:110 +0x103
bufio.(*Reader).Peek(0xc0005f6660, 0x1)
        bufio/bufio.go:148 +0x53
net/http.(*persistConn).readLoop(0xc000729d40)
        net/http/transport.go:2141 +0x1b9
created by net/http.(*Transport).dialConn in goroutine 84
        net/http/transport.go:1799 +0x152f

goroutine 86 [select]:
net/http.(*persistConn).writeLoop(0xc000729d40)
        net/http/transport.go:2458 +0xf0
created by net/http.(*Transport).dialConn in goroutine 84
        net/http/transport.go:1800 +0x1585

goroutine 45 [semacquire]:
sync.runtime_Semacquire(0xc00049e7b0?)
        runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0x21ec440?)
        sync/waitgroup.go:116 +0x48
golang.org/x/sync/errgroup.(*Group).Wait(0xc000456b40)
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:56 +0x25
github.com/docker/compose/v2/pkg/compose.(*convergence).ensureService(_, {_, _}, _, {{0xc00040a977, 0x5}, {0x0, 0x0, 0x0}, 0x0, ...}, ...)
        github.com/docker/compose/v2/pkg/compose/convergence.go:216 +0xd1f
github.com/docker/compose/v2/pkg/compose.(*composeService).create.(*convergence).apply.func1.1({0x2747d48, 0xc0006e9170})
        github.com/docker/compose/v2/pkg/compose/convergence.go:103 +0x10b
github.com/docker/compose/v2/internal/tracing.SpanWrapFunc.func1({0x2747d80, 0xc000632140})
        github.com/docker/compose/v2/internal/tracing/wrap.go:43 +0x1c4
github.com/docker/compose/v2/pkg/compose.(*composeService).create.(*convergence).apply.func1({0x2747d80, 0xc000632140}, {0xc00040a977, 0x5})
        github.com/docker/compose/v2/pkg/compose/convergence.go:104 +0x2e3
github.com/docker/compose/v2/pkg/compose.(*graphTraversal).run.func1()
        github.com/docker/compose/v2/pkg/compose/dependencies.go:184 +0x99
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 28
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75 +0x96

goroutine 47 [runnable]:
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 45
        golang.org/x/sync@v0.8.0/errgroup/errgroup.go:75 +0x96

Steps To Reproduce

  1. docker compose up -d
  2. changing content of compose.yml
  3. do another docker compose up -d
# This is a Docker Compose file for setting up the morphic-stack environment.

name: morphic-stack
services:
  morphic:
    container_name: morphic
    env_file: .env.local
    ports:
      - '3000'
    depends_on:
      - redis
      - searxng

  redis:
    image: redis:alpine
    volumes:
      - redis:/data
    command: redis-server --appendonly yes

  searxng:
    image: searxng/searxng
    ports:
      - '${SEARXNG_PORT:-8080}:8080'
    env_file: .env.local
    volumes:
      - ./searxng-limiter.toml:/etc/searxng/limiter.toml
      - ./searxng-settings.yml:/etc/searxng/settings.yml

volumes:
  redis:

Compose Version

Docker Compose version v2.29.7

Docker Environment

Client: Docker Engine - Community
 Version:    27.3.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.17.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.7
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 9
  Running: 8
  Paused: 0
  Stopped: 1
 Images: 64
 Server Version: 27.3.1
 Storage Driver: overlay2
  Backing Filesystem: zfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc version: v1.1.14-0-g2c9f560
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.12-2-pve
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 20
 Total Memory: 11.72GiB
 Name: codeserver
 ID: 26345a29-1833-41e6-a135-a00f2f0d0b38
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

@idsulik
Copy link
Collaborator

idsulik commented Oct 6, 2024

The bug was fixed here #12150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants