Skip to content

Docker panic when merging volume configs #2916

@misterjdrg

Description

@misterjdrg
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Merging configs and creating services.

Actual behavior

Panic.

panic: reflect: reflect.Value.Set using unaddressable value

goroutine 1 [running]:
reflect.flag.mustBeAssignableSlow(0x95)
	reflect/value.go:260 +0x13f
reflect.flag.mustBeAssignable(...)
	reflect/value.go:247
reflect.Value.Set(0x55b2de3046e0, 0xc0000a5b50, 0x95, 0x55b2de3046e0, 0xc000579cb0, 0x15)
	reflect/value.go:1558 +0x3d
github.com/docker/cli/vendor/github.com/imdario/mergo.deepMerge(0x55b2de3046e0, 0xc0000a5b50, 0x95, 0x55b2de3046e0, 0xc0000a5b00, 0x95, 0xc000131660, 0x2, 0xc00059a0e0, 0x0, ...)
	github.com/docker/cli/vendor/github.com/imdario/mergo/merge.go:90 +0x1646
github.com/docker/cli/vendor/github.com/imdario/mergo.deepMerge(0x55b2de466160, 0xc0000a5b30, 0x99, 0x55b2de466160, 0xc0000a5ae0, 0x99, 0xc000131660, 0x1, 0xc00059a0e0, 0x0, ...)
	github.com/docker/cli/vendor/github.com/imdario/mergo/merge.go:79 +0x27f9
github.com/docker/cli/vendor/github.com/imdario/mergo.deepMerge(0x55b2de302460, 0xc000118e70, 0x195, 0x55b2de302460, 0xc000118e78, 0x195, 0xc000131660, 0x0, 0xc00059a0e0, 0x195, ...)
	github.com/docker/cli/vendor/github.com/imdario/mergo/merge.go:122 +0xa3b
github.com/docker/cli/vendor/github.com/imdario/mergo._map(0x55b2de230940, 0xc000118e70, 0x55b2de230940, 0xc000118e78, 0xc000131890, 0x1, 0x1, 0x0, 0x0)
	github.com/docker/cli/vendor/github.com/imdario/mergo/map.go:160 +0x3be
github.com/docker/cli/vendor/github.com/imdario/mergo.Map(...)
	github.com/docker/cli/vendor/github.com/imdario/mergo/map.go:133
github.com/docker/cli/cli/compose/loader.mergeVolumes(...)
	github.com/docker/cli/cli/compose/loader/merge.go:241
github.com/docker/cli/cli/compose/loader.merge(0xc000590c60, 0x2, 0x2, 0x1, 0x2, 0xc000590c60)
	github.com/docker/cli/cli/compose/loader/merge.go:31 +0x20d
github.com/docker/cli/cli/compose/loader.Load(0xc000412b90, 0x3, 0xc0000525c0, 0x12, 0xc0001346f0, 0x2, 0x2, 0xc000134720, 0x0, 0x0, ...)
	github.com/docker/cli/cli/compose/loader/loader.go:125 +0x40e
github.com/docker/cli/cli/command/stack/loader.LoadComposefile(0x55b2de6210a0, 0xc0000b2dd0, 0xc000382280, 0x2, 0x2, 0x7ffcb538c598, 0x4, 0x55b2ddf3bda2, 0x6, 0x0, ...)
	github.com/docker/cli/cli/command/stack/loader/loader.go:28 +0x175
github.com/docker/cli/cli/command/stack.newDeployCommand.func1(0xc000329340, 0xc00033e0a0, 0x1, 0x5, 0x0, 0x0)
	github.com/docker/cli/cli/command/stack/deploy.go:28 +0x145
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc000329340, 0xc0001b5670, 0x5, 0x5, 0xc000329340, 0xc0001b5670)
	github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:850 +0x47c
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc00021a2c0, 0xc0001b5650, 0x7, 0x7)
	github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:958 +0x375
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(...)
	github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:895
main.runDocker(0xc0000b2dd0, 0x55b2de5ac740, 0xc000010020)
	github.com/docker/cli/cmd/docker/docker.go:287 +0x1de
main.main()
	github.com/docker/cli/cmd/docker/docker.go:298 +0xf3

Steps to reproduce the behavior

docker stack deploy -c base.yml -c ext.yml Test

base.yml

version: "3.3"
volumes:
  volume1:

ext.yml

version: "3.3"
volumes:
  volume1:
    driver: local
    driver_opts:
      type: nfs
      o: addr=10.0.0.1
      device: ":/data/volume1"

Output of docker version:

Client:
 Version:           20.10.2
 API version:       1.40
 Go version:        go1.15.6
 Git commit:        2291f610ae
 Built:             Tue Jan  5 19:56:21 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          19.03.13-ce
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.15.2
  Git commit:       4484c46d9d
  Built:            Sat Sep 26 12:03:35 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.4.1.m
  GitCommit:        c623d1b36f09f8ef6536a057bd658b3aa8632828.m
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-tp-docker)

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 19
 Server Version: 19.03.13-ce
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 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
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: c623d1b36f09f8ef6536a057bd658b3aa8632828.m
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0 (expected: fec3683)
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.8.12-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.927GiB
 Name: atomic
 ID: UD2B:QCM7:RAWT:32DF:MY6W:MME2:UXTL:IDN4:PYAN:ZAOQ:AQ6Z:ZEH6
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions