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] Docker compose Down make the program crash #11520

Closed
vlakius opened this issue Feb 19, 2024 · 2 comments
Closed

[BUG] Docker compose Down make the program crash #11520

vlakius opened this issue Feb 19, 2024 · 2 comments

Comments

@vlakius
Copy link

vlakius commented Feb 19, 2024

Description

Running the command docker-compose down crashes the program.
Running docker-compose -f <path_file.yml> down makes no difference.
Here is the traceback:

panic: interface conversion: interface {} is map[string]interface {}, not string

goroutine 1 [running]:
github.com/compose-spec/compose-go/v2/override.keyValueIndexer({0x1eb2360?, 0xc00035a450?}, {0xc0002afb60?, 0x1?})
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/override/uncity.go:111 +0x79
github.com/compose-spec/compose-go/v2/override.enforceUnicity({0x1d705c0?, 0xc000464c00?}, {0xc00058abe0, 0x20})
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/override/uncity.go:92 +0x415
github.com/compose-spec/compose-go/v2/override.enforceUnicity({0x1eb2360?, 0xc000505ef0?}, {0xc00005acf0, 0x14})
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/override/uncity.go:79 +0x1b3
github.com/compose-spec/compose-go/v2/override.enforceUnicity({0x1eb2360?, 0xc000505ec0?}, {0x2268cdb, 0x8})
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/override/uncity.go:79 +0x1b3
github.com/compose-spec/compose-go/v2/override.enforceUnicity({0x1eb2360?, 0xc000505710?}, {0x0, 0x0})
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/override/uncity.go:79 +0x1b3
github.com/compose-spec/compose-go/v2/override.EnforceUnicity(0x0?)
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/override/uncity.go:68 +0x46
github.com/compose-spec/compose-go/v2/loader.loadYamlModel.func1({0x1eb2360?, 0xc000505950?}, {0xc0005382b8, 0x1, 0x1})
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/loader/loader.go:385 +0x3e5
github.com/compose-spec/compose-go/v2/loader.loadYamlModel({0x25d8880?, 0xc0000c4190}, {{0x0, 0x0}, {0xc000514120, 0x17}, {0xc0005048d0, 0x1, 0x1}, 0xc0005045d0}, ...)
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/loader/loader.go:412 +0x8ff
github.com/compose-spec/compose-go/v2/loader.load({0x25d8880, 0xc0000c4190}, {{0x0, 0x0}, {0xc000514120, 0x17}, {0xc0005048d0, 0x1, 0x1}, 0xc0005045d0}, ...)
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/loader/loader.go:471 +0x38e
github.com/compose-spec/compose-go/v2/loader.LoadWithContext({0x25d8880, 0xc0000c4190}, {{0x0, 0x0}, {0xc000514120, 0x17}, {0xc0005048d0, 0x1, 0x1}, 0xc0005045d0}, ...)
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/loader/loader.go:322 +0x46f
github.com/compose-spec/compose-go/v2/cli.ProjectFromOptions(0xc0005086e0)
        github.com/compose-spec/compose-go/v2@v2.0.0-rc.7/cli/options.go:458 +0x612
github.com/docker/compose/v2/cmd/compose.(*ProjectOptions).ToProject(0xc000545860, {0x25d8880?, 0xc0000c4190}, {0x25eb940, 0xc00014f600}, {0x37aa220, 0x0, 0x0}, {0xc0005396d0, 0x1, ...})
        github.com/docker/compose/v2/cmd/compose/compose.go:246 +0x608
github.com/docker/compose/v2/cmd/compose.(*ProjectOptions).projectOrName(0xc000539728?, {0x25d8880?, 0xc0000c4190?}, {0x25eb940?, 0xc00014f600?}, {0x37aa220?, 0xc000539758?, 0x42521c?})
        github.com/docker/compose/v2/cmd/compose/compose.go:173 +0x87
github.com/docker/compose/v2/cmd/compose.runDown({0x25d8880, 0xc0000c4190}, {0x25eb940?, 0xc00014f600}, {0x25f4280, 0xc000480c60}, {0xc000545860, 0x0, 0x0, 0x0, ...}, ...)
        github.com/docker/compose/v2/cmd/compose/down.go:81 +0x95
github.com/docker/compose/v2/cmd/compose.downCommand.func2({0x25d8880?, 0xc0000c4190?}, {0x37aa220?, 0xc0000061a0?, 0x1c4e7f9?})
        github.com/docker/compose/v2/cmd/compose/down.go:60 +0x73
github.com/docker/compose/v2/cmd/compose.downCommand.Adapt.func5({0x25d8880?, 0xc0000c4190?}, 0x2?, {0x37aa220?, 0x0?, 0x0?})
        github.com/docker/compose/v2/cmd/compose/compose.go:109 +0x30
github.com/docker/compose/v2/cmd/compose.downCommand.Adapt.AdaptCmd.func7(0x0?, {0x37aa220, 0x0, 0x0})
        github.com/docker/compose/v2/cmd/compose/compose.go:88 +0x14e
github.com/docker/compose/v2/cmd/cmdtrace.Setup.wrapRunE.func2(0xc00014f900?, {0x37aa220?, 0x0?, 0x0?})
        github.com/docker/compose/v2/cmd/cmdtrace/cmd_span.go:84 +0x65
github.com/spf13/cobra.(*Command).execute(0xc0004fcf00, {0xc0003fb6d0, 0x0, 0x0})
        github.com/spf13/cobra@v1.8.0/command.go:983 +0xabc
github.com/spf13/cobra.(*Command).ExecuteC(0xc000503500)
        github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0xc0003fb1c0?, 0xc0004fc900, {{0x2263e7b, 0x5}, {0x226d9e6, 0xb}, {0x25af8d0, 0x7}, {0x0, 0x0}, ...})
        github.com/docker/cli@v25.0.3+incompatible/cli-plugins/plugin/plugin.go:64 +0x10e
github.com/docker/cli/cli-plugins/plugin.Run(0x239ff80, {{0x2263e7b, 0x5}, {0x226d9e6, 0xb}, {0x25af8d0, 0x7}, {0x0, 0x0}, {0x0, ...}})
        github.com/docker/cli@v25.0.3+incompatible/cli-plugins/plugin/plugin.go:77 +0xe5
main.pluginMain()
        github.com/docker/compose/v2/cmd/main.go:37 +0xa5
main.main()
        github.com/docker/compose/v2/cmd/main.go:94 +0x19c

Steps To Reproduce

  • Binary has been placed on /root/bin

Compose Version

Docker Compose version v2.24.6

Docker Environment

Client:
 Version:    24.0.7-ce
 Context:    default
 Debug Mode: false

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 7
 Server Version: 24.0.7-ce
 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: oci runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 4e1fe7492b9df85914c389d1f15a3ceedbb280ac
 runc version: v1.1.11-0-g4bccb38cc9cf
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: builtin
 Kernel Version: 5.14.21-150500.55.44-default
 Operating System: SUSE Linux Enterprise Server 15 SP5
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.869GiB
 Name: ********
 ID: 6803300d-5114-41e7-b1d5-7d8ed5ebc00e
 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

@jhrotko
Copy link
Contributor

jhrotko commented Feb 19, 2024

Hey! Thank you for reporting the issue. Could you please also share more info? Could you give a sample compose.yml(s) ? did you do some changes before compose down?

@milas
Copy link
Contributor

milas commented Mar 6, 2024

This fix has been included in Compose 2.24.7+. If you continue to have problems after upgrading, comment here and we can re-open the issue or create a new one as appropriate. Thanks for the report!

@milas milas closed this as completed Mar 6, 2024
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

4 participants