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

Expecting VirtualIPs but got Spec #19

Open
trajano opened this issue Jul 24, 2018 · 6 comments
Open

Expecting VirtualIPs but got Spec #19

trajano opened this issue Jul 24, 2018 · 6 comments
Labels

Comments

@trajano
Copy link

trajano commented Jul 24, 2018

The server seems to be yielding the following error message

Expecting an object with a field named `VirtualIPs` at _.services[12].Endpoint but instead got: {"Spec":{}}

image

@trajano
Copy link
Author

trajano commented Jul 24, 2018

I found that it is because of a specific stack. Here's my config file

version: '3.4'
services:
  forward:
    image: marcnuri/port-forward
    depends_on:
    - consul
    networks:
    - consul
    environment:
    - 'REMOTE_HOST=consul'
    - 'REMOTE_PORT=8500'
    - 'LOCAL_PORT=8500'
    ports:
    - 8500:8500
    deploy:
      replicas: 3
  consul:
    image: consul
    command: agent -server -retry-join=consul -bootstrap-expect=3 -client=0.0.0.0
    networks:
    - consul
    environment:
    - 'CONSUL_BIND_INTERFACE=eth0'
    deploy:
      replicas: 3
      endpoint_mode: dnsrr
networks:
  consul: 
    driver: overlay
    attachable: false
    ipam:
      driver: default
      config:
      - subnet: 172.16.238.0/24

When executed the consul service has _.EndPoint == { Spec {} }

@trajano
Copy link
Author

trajano commented Jul 24, 2018

It appears to "work" if I take out endpoint_mode: dnsrr but that would fail consul

@anton-johansson
Copy link

I also have this problem. I need dnsrr in one of my containers.

Not sure why the Docker API does not give us information about virtual IPs when we use dnsrr though :S

@charypar charypar added the bug label Nov 25, 2018
@pablolibo
Copy link

the same issue :(

+1 for @trajano

@pablolibo
Copy link

the same issue too

@shinybrar
Copy link

+1 @trajano This is still happening.

The error actually happens because of missing arguments in a docker service configuration. You can replicate it by simply executingdocker service inspect SERVICE on a service without certain network configurations.

e.g. If you spawn a service with an overlay network, you get the following configuration output format under Spec --> TaskTemplate --> Endpoint

"Endpoint": {
            "Spec": {
                "Mode": "vip",
                "Ports": [
                    { ... }
                ]
            },
            "Ports": [
                { ... }
            ],
            "VirtualIPs": [
                { ... }
            ]
        }

However, if you have a service with no network configuration you get an output along the lines shown below:

 "Endpoint": {
            "Spec": {}
        }`

This causes the viewer to crash!

@charypar Any idea, if you will get around to fixing this, or can we assume that this project is no longer maintained?

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

No branches or pull requests

5 participants