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

Keep getting: json: cannot unmarshal string into Go value of type []string #1638

Closed
tuanmh opened this issue Jul 3, 2015 · 14 comments
Closed

Comments

@tuanmh
Copy link

tuanmh commented Jul 3, 2015

Hi guys, after I upgraded to boot2docker 1.7.2, docker-compose up keeps throwing this error: json: cannot unmarshal string into Go value of type []string.

Could you please help me in this case. Thanks!

@tuanmh
Copy link
Author

tuanmh commented Jul 3, 2015

Here is my system information: boot2docker 1.7.2, Virtualbox 4.3.28, OSX 10.4.4, thanks again.

@aanand
Copy link

aanand commented Jul 3, 2015

This is a Docker 1.7.0 bug. If you like you can try the 1.7.1 release candidate, which contains a fix:

$ boot2docker init --iso-url="https://github.com/tianon/boot2docker/releases/download/v1.7.1-rc1/boot2docker.iso"

@aanand aanand closed this as completed Jul 3, 2015
@mboussaa
Copy link

mboussaa commented Jul 8, 2015

I am getting the same error. However, I am not using b2d

@aanand
Copy link

aanand commented Jul 8, 2015

@mboussaa It's a Docker bug, not a Boot2Docker bug.

@mboussaa
Copy link

mboussaa commented Jul 8, 2015

ok. In fact, it works now. I set the cpu share to 0. That is why I was getting this error.
Thank you anyway

@shabbychef
Copy link

I am having this issue under 1.7.1-rc3 on Ubuntu 14.04:

$ docker --version
Docker version 1.7.1-rc3, build c2e658d
$ docker info
Containers: 16
Images: 676
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 708
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-53-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 8
Total Memory: 31.41 GiB
Name: piane
ID: XRYW:UJTU:3ZZU:KFHG:GI5W:ZEEL:MRLM:C7JB:T4Z7:SR7J:RPX5:LHJQ
WARNING: No swap limit support
$ docker-compose up
Creating fooz_foodisk_1...
json: cannot unmarshal bool into Go value of type string

My MWE docker-compose file:

$ cat docker-compose.yml 
foodisk:
  image: ubuntu
  entrypoint: true
  volumes:
  - /var/opt/foo:/var/foo:rw
$ ls -al /var/opt/foo
total 8
drwxr-xr-x 2 root root 4096 Jul 13 10:08 .
drwxr-xr-x 4 root root 4096 Jul 13 10:08 ..

More verbosely:

$ docker-compose --verbose up
Compose version 1.2.0
Docker base_url: http+unix://var/run/docker.sock
Docker version: KernelVersion=3.13.0-53-generic, Os=linux, ApiVersion=1.19, Version=1.7.1-rc3, GitCommit=c2e658d, Arch=amd64, GoVersion=go1.4.2
docker containers <- (all=True)
docker containers -> (list with 16 items)
Creating fooz_foodisk_1...
docker containers <- (all=True)
docker containers -> (list with 16 items)
docker create_container <- (name=u'fooz_foodisk_1', image=u'ubuntu:latest', host_config={'Binds': ['/var/opt/foo:/var/foo:rw'], 'PortBindings': {}, 'NetworkMode': u'bridge', 'Links': [], 'VolumesFrom': []}, entrypoint=True, volumes={u'/var/foo': {}}, detach=False)
json: cannot unmarshal bool into Go value of type string

@shabbychef
Copy link

Maybe I am dumb. I changed true in my docker-compose.yml file to /bin/true, and now this runs.

$ cat docker-compose.yml 
foodisk:
  image: ubuntu
  entrypoint: /bin/true
  volumes:
  - /var/opt/foo:/var/foo:rw

$ docker-compose up
Recreating fooz_foodisk_1...
Attaching to 

The moral of the story, perhaps, is to fully qualify your entrypoint otherwise docker-compose may eagerly interpret it as a Boolean!

@aanand
Copy link

aanand commented Jul 14, 2015

The perils of YAML. We should check or auto-convert it as part of #129.

@bastiao
Copy link

bastiao commented Jul 21, 2015

I'm also have this bug. If you use 1.6.2 and it works.

@bastiao
Copy link

bastiao commented Jul 24, 2015

other version of compose does not seems to fix the issue with docker 1.7.1. Any ideas?

@aanand
Copy link

aanand commented Jul 24, 2015

@bastiao what does your docker-compose.yml look like?

@aanand
Copy link

aanand commented Jul 24, 2015

@bastiao Change command: true to command: "true".

@shabbychef
Copy link

@bastiao @aanand or command: /bin/true, since maybe in the future an automagic conversion process will take "true" to true and then bonk.

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

No branches or pull requests

5 participants