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

reflect.Value.Set using unaddressable value #158

Closed
darccio opened this issue Jul 30, 2020 · 2 comments
Closed

reflect.Value.Set using unaddressable value #158

darccio opened this issue Jul 30, 2020 · 2 comments

Comments

@darccio
Copy link
Owner

darccio commented Jul 30, 2020

From docker/cli#1981:

Description

We are trying to deploy a stack with 2 docker-compose file, the second one overriding volume settings.
The stack deploy command fails with a reflect.Value.Set using unaddressable value error.

Steps to reproduce the issue:

  1. Create docker-compose.yml file with the following content:
version: '3.4'
volumes:
  app:
services:
  bash:
    image: bash
    command: cat docker-compose.override.yml
    volumes:
      - app:/app
    working_dir: /app
  1. Create docker-compose.override.yml file with the following content:
version: '3.4'
volumes:
  app:
    driver: local
    driver_opts:
      o: bind
      type: none
      device: $PWD
  1. Deploy a stack with the following command:
docker stack deploy --compose-file docker-compose.yml --compose-file docker-compose.override.yml test

Describe the results you received:
The command fails with :

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

goroutine 1 [running]:
reflect.flag.mustBeAssignable(0x95)
        /usr/local/go/src/reflect/value.go:234 +0x15e
reflect.Value.Set(0x5623e2feee80, 0xc4200bd150, 0x95, 0x5623e2feee80, 0xc420815b30, 0x15)
        /usr/local/go/src/reflect/value.go:1367 +0x31
github.com/docker/cli/vendor/github.com/imdario/mergo.deepMerge(0x5623e2feee80, 0xc4200bd150, 0x95, 0x5623e2feee80, 0xc4200bd100, 0x95, 0xc42067f5a8, 0x2, 0xc4202adca0, 0x0, ...)
        /go/src/github.com/docker/cli/vendor/github.com/imdario/mergo/merge.go:83 +0xe92
github.com/docker/cli/vendor/github.com/imdario/mergo.deepMerge(0x5623e3162600, 0xc4200bd130, 0x99, 0x5623e3162600, 0xc4200bd0e0, 0x99, 0xc42067f5a8, 0x1, 0xc4202adca0, 0x0, ...)
        /go/src/github.com/docker/cli/vendor/github.com/imdario/mergo/merge.go:72 +0x1bf6
github.com/docker/cli/vendor/github.com/imdario/mergo.deepMerge(0x5623e2fea020, 0xc42046d220, 0x195, 0x5623e2fea020, 0xc42046d228, 0x195, 0xc42067f5a8, 0x0, 0xc4202adca0, 0x195, ...)
        /go/src/github.com/docker/cli/vendor/github.com/imdario/mergo/merge.go:115 +0x6ee
github.com/docker/cli/vendor/github.com/imdario/mergo._map(0x5623e2f12a80, 0xc42046d220, 0x5623e2f12a80, 0xc42046d228, 0xc42067f7a8, 0x1, 0x1, 0x1, 0xc42046d228)
        /go/src/github.com/docker/cli/vendor/github.com/imdario/mergo/map.go:159 +0x38d
github.com/docker/cli/vendor/github.com/imdario/mergo.Map(0x5623e2f12a80, 0xc42046d220, 0x5623e2f12a80, 0xc42046d228, 0xc42067f7a8, 0x1, 0x1, 0x1, 0xc4203285f8)
        /go/src/github.com/docker/cli/vendor/github.com/imdario/mergo/map.go:132 +0x73
github.com/docker/cli/cli/compose/loader.mergeVolumes(0xc42047b3e0, 0xc420815500, 0x1, 0x0, 0x0)
        /go/src/github.com/docker/cli/cli/compose/loader/merge.go:216 +0xd3
github.com/docker/cli/cli/compose/loader.merge(0xc420827640, 0x2, 0x2, 0x1, 0x2, 0xc420827640)
        /go/src/github.com/docker/cli/cli/compose/loader/merge.go:31 +0x14f
github.com/docker/cli/cli/compose/loader.Load(0xc42032872b, 0x3, 0xc420042080, 0x28, 0xc4205a0540, 0x2, 0x2, 0xc4205a0570, 0x0, 0x0, ...)
        /go/src/github.com/docker/cli/cli/compose/loader/loader.go:111 +0x661
github.com/docker/cli/cli/command/stack/loader.LoadComposefile(0x5623e329a820, 0xc42039bb00, 0x0, 0x0, 0xc4202aca80, 0x2, 0x2, 0x7ffc5e25c0b7, 0x4, 0x5623e2839243, ...)
        /go/src/github.com/docker/cli/cli/command/stack/loader/loader.go:28 +0x18e
github.com/docker/cli/cli/command/stack.newDeployCommand.func1(0xc4204c3b80, 0xc4205005f0, 0x1, 0x5, 0x0, 0x0)
        /go/src/github.com/docker/cli/cli/command/stack/deploy.go:49 +0x23d
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc4204c3b80, 0xc42003a0b0, 0x5, 0x5, 0xc4204c3b80, 0xc42003a0b0)
        /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:762 +0x46a
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4200eca00, 0xc420503fa0, 0x5623e2f546c0, 0xc420503fb0)
        /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:852 +0x30c
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4200eca00, 0xc4200eca00, 0x5623e325b760)
        /go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:800 +0x2d
main.main()
        /go/src/github.com/docker/cli/cmd/docker/docker.go:180 +0xde

Describe the results you expected:
The test stack should be deployed correctly.

@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/imdario/mergo

@darccio
Copy link
Owner Author

darccio commented Sep 11, 2023

Closing in favour of #162

@darccio darccio closed this as completed Sep 11, 2023
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

1 participant