Skip to content

Envoy NACKs on a valid IPv6 address #29902

Open
@suniltheta

Description

Description:

We ran into this issue that seems definitely unusual. I have considered if this is caused due to underlying host not supporting IPv6 or working in AWS bridge mode but not able to reproducible locally.

A NACK thrown in Envoy version v1.27.

failureReason:Error adding/updating listener(s) egress: malformed IP address: 2600:f0f0:0:0:0:0:0:1

As per NACK Envoy couldn't validate that this is a proper IPv6 address which was provided in filter chain match like

         "filter_chain_match": {
          "prefix_ranges": [
           {
            "address_prefix": "127.255.0.1",
            "prefix_len": 32
           },
           {
            "address_prefix": "2600:f0f0:0:0:0:0:0:1",
            "prefix_len": 128
           }
          ],

I believe the IPv6 address validation is done in

const Api::SysCallIntResult rc = Api::OsSysCallsSingleton::get().getaddrinfo(

Repro steps:
Not able to reproduce as this was noted on customer's environment.

Config:
Same as the one mentioned above.

{
     "name": "egress",
     "active_state": {
      "version_info": "1",
      "listener": {
       "@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
       "name": "egress",
       "address": {
        "socket_address": {
         "address": "127.0.0.1",
         "port_value": 59632
        }
       },
       "filter_chains": [
        {
         "filter_chain_match": {
          "prefix_ranges": [
           {
            "address_prefix": "127.255.0.1",
            "prefix_len": 32
           },
           {
            "address_prefix": "2600:f0f0:0:0:0:0:0:1",
            "prefix_len": 128
           }
          ],
          "destination_port": 8156
         },
         "filters": [
         ....

Logs:

Logs on Control Plane

26 09 2023 20:20:50,731 [WARN] envoy.common.EnvoyNackHandler: Received NACK(failureReason:Error adding/updating listener(s) egress: malformed IP address: 2600:f0f0:0:0:0:0:0:1) for resource(type:MetaType(identity=envoy.listener), version:, nonce:488d0f4a-425a-467c-99ac-1ddd0a0e9543, names:[]) from Envoy(version:v1.27.0.0)

Activity

added
investigatePotential bug that needs verification
and removed
triageIssue requires triage
on Oct 2, 2023
zuercher

zuercher commented on Oct 2, 2023

@zuercher
Member

I think we need more information to determine whether this anything that we'd want to address. Do you know what OS, version, etc was in use?

suniltheta

suniltheta commented on Oct 3, 2023

@suniltheta
ContributorAuthor

OS: AL2023 (based on Fedora Linux distribution), kernel 6.1.52-71.125.amzn2023.x86_64

It was using AWS ECS networking in Bridge mode - I am not sure if this network mode would influence filter_chain_match IPs.

zuercher

zuercher commented on Oct 4, 2023

@zuercher
Member

Looking at the code it seems this must be getaddrinfo returning an error. That's about as far as I can get with the time I have.

suniltheta

suniltheta commented on Oct 4, 2023

@suniltheta
ContributorAuthor

Thanks for taking a look.

If this getaddrinfo functionality is provided by glibc, want to understand when Envoy does Api::OsSysCallsSingleton::get().getaddrinfo( call, would it be handled with some library already include with Envoy static binary or would Envoy make call to underlying OS and the glibc functionality has to be supported in the OS itself?

In the above custom Envoy image that is used the binary & the image is built on AmazonLinux2 (CentOS flavor). But the container is run on AmazonLinux2023 host which is Fedora based. So I am wonder if there is some incompatibility that would cause this problem (rarely).

zuercher

zuercher commented on Oct 6, 2023

@zuercher
Member

From my experience, glibc is the one library that Envoy links dynamically. If the OS version is older than the compile version it'll fail to start.

ondrejmo

ondrejmo commented on Dec 18, 2024

@ondrejmo

I have a similar issue with Cilium 1.16.5, where the cilium-envoy-... pods crash claiming ::1 is a malformed ip. All affected systems have IPv6 support disabled via a grub flag.

cilium/cilium@c4b1379

sayboras

sayboras commented on Dec 19, 2024

@sayboras
Contributor

👋

For the information, Cilium 1.16.5 is using envoy 1.30.8/Distribution/RELEASE/BoringSSL.

23 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Envoy NACKs on a valid IPv6 address · Issue #29902 · envoyproxy/envoy