Skip to content

Bad SDS Host URL causes seg fault #903

Closed
@bndw

Description

@bndw

If an unresolvable URL is specified in the Cluster Manger SDS Hosts URL, a Segmentation fault will be raised without any helpful error text, even at a debug log level.

Below is an example Dockerfile and front-envoy.config for repro. Replacing tcp://does-not-exist.amazonaws.com:80 with a valid SDS host resolves the issue.

Dockerfile

FROM lyft/envoy:latest

COPY ./front-envoy.json /etc/front-envoy.json

CMD /usr/local/bin/envoy -c /etc/front-envoy.json -l debug

front-envoy.json

{
  "listeners": [
    {
      "address": "tcp://0.0.0.0:80",
      "filters": [
        {
          "type": "read",
          "name": "http_connection_manager",
          "config": {
            "codec_type": "auto",
            "stat_prefix": "ingress_http",
            "route_config": {
              "virtual_hosts": [
                {
                  "name": "backend",
                  "domains": ["*"],
                  "routes": [
                    {
                      "timeout_ms": 0,
                      "prefix": "/",
                      "cluster": "service_echo"
                    }
                  ]
                }
              ]
            },
            "filters": [
              { "type": "both", "name": "health_check",
                "config": {
                  "pass_through_mode": false, "endpoint": "/healthcheck"
                }
              },
              {
                "type": "decoder",
                "name": "router",
                "config": {}
              }
            ]
          }
        }
      ]
    }
  ],
  "admin": {
    "access_log_path": "/dev/null",
    "address": "tcp://0.0.0.0:8001"
  },
  "cluster_manager": {
    "sds": {
      "cluster": {
        "name": "sds",
        "connect_timeout_ms": 250,
        "type": "strict_dns",
        "lb_type": "round_robin",
        "hosts": [{"url": "tcp://does-not-exist.amazonaws.com:80"}]
      },
      "refresh_delay_ms": 3000
    },
    "clusters": [
      {
        "name": "service_echo",
        "connect_timeout_ms": 250,
        "type": "sds",
        "service_name": "echoer",
        "lb_type": "round_robin",
        "health_check":  {
          "type": "http",
          "timeout_ms": 2000,
          "interval_ms": 5000,
          "interval_jitter_ms": 5000,
          "unhealthy_threshold": 2,
          "healthy_threshold": 2,
          "path": "/",
          "service_name": "echoer"
        }
      }
    ]
  }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions