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

Cannot unmarshal number into Go value of type string #679

Open
containerman17 opened this issue Apr 3, 2020 · 1 comment
Open

Cannot unmarshal number into Go value of type string #679

containerman17 opened this issue Apr 3, 2020 · 1 comment

Comments

@containerman17
Copy link

containerman17 commented Apr 3, 2020

  • What version of docker are you running?
    19.03.6
  • What version of registrator are you running?
    :latest
  • Did you build a custom version of registrator? If so, what is that image?
    gliderlabs/registrator:latest
  • What is the exact command you are running registrator with?
- name: docker_container gliderlabs/registrator:latest
  docker_container:
    name: registrator
    image: gliderlabs/registrator:latest
    state: started
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock"
    network_mode: host
    command: -resync 360 consul://localhost:8500
  • What is the exact command you are running your container with?
docker run \
 --log-driver json-file --log-opt max-size=100m \
        --name "instance100" \
        --restart always \
        -p 5900:5900 -p 1883 -p 8080\
        --mount source="app-instance-vol-$1",target=/home/username \
        --link "app-db":mysql \
        -e NODE_DB_NAME="h100"\
        -e NODE_SERVER_ID="'100'"\
        -e NODE_TOKEN="i3ude3"\
        -e NODE_PROXY_SRV="192.168.0.1:3800"\
        -e SERVICE_NAME="instance100" \
        --shm-size=1g \
        --cpus=0.6 \
        --memory=6000m \
        --network="my-net" \
        --network-alias="instance100" \
        --device-write-bps /dev/sda:60mb\
        --device-read-bps /dev/sda:60mb\
        -d app-instance;
  • A log capture of all the docker events before, during, and after the issue.
2020/04/03 11:29:45 Syncing services on 7 containers
2020/04/03 11:29:45 unable to inspect container: ce8970809026 json: cannot unmarshal number into Go value of type string
2020/04/03 11:29:45 unable to inspect container: 59aedb3e2a67 json: cannot unmarshal number into Go value of type string
  • If relevant, Dockerfile for application that is having issues.

Description of the problem:
Looks like registrator is not able to parse the answer from docker.

log.Println("unable to inspect container:", containerId[:12], err)

registrator uses library "github.com/fsouza/go-dockerclient".
So I've tried to reproduce: https://gist.github.com/solohin/5ec204c0b402b89120cb689e233a7db9
But this code works ok., check reponse.txt

How reproducible:

Steps to Reproduce:

Actual Results:
Just "unable to inspect container" in logs

Expected Results:
Containers registered in Consul

Additional info:

@containerman17
Copy link
Author

The problem disappears when I remove this:

--device-write-bps /dev/sda:60mb\
--device-read-bps /dev/sda:60mb\

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

1 participant