swarm-dashboard icon indicating copy to clipboard operation
swarm-dashboard copied to clipboard

Expecting VirtualIPs but got Spec

Open trajano opened this issue 7 years ago • 6 comments
trafficstars

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 avatar Jul 24 '18 05:07 trajano

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 avatar Jul 24 '18 06:07 trajano

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

trajano avatar Jul 24 '18 06:07 trajano

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

anton-johansson avatar Oct 22 '18 08:10 anton-johansson

the same issue :(

+1 for @trajano

pablolibo avatar Jan 16 '19 14:01 pablolibo

the same issue too

pablolibo avatar Apr 26 '19 14:04 pablolibo

+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?

shinybrar avatar Oct 31 '19 20:10 shinybrar