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

yang(sonic-interface): name of value "Ethernet0.666" points to a non-existing leaf #21631

Open
tomvil opened this issue Feb 5, 2025 · 4 comments
Assignees
Labels
Triaged this issue has been triaged YANG YANG model related changes

Comments

@tomvil
Copy link

tomvil commented Feb 5, 2025

After enabling use-link-local-only on subinterface config override-config-table starts to generate yang error:

libyang[0]: Leafref "/sonic-port:sonic-port/sonic-port:PORT/sonic-port:PORT_LIST/sonic-port:name" of value "Ethernet0.666" points to a non-existing leaf. (path: /sonic-interface:sonic-interface/INTERFACE/INTERFACE_LIST[name='Ethernet0.666']/name)

How to reproduce:

  1. Add subinterface Ethernet0.666
  2. config interface ipv6 enable use-link-local-only Ethernet0.666
  3. config override-config-table /etc/sonic/random_config.json
  4. See the error the was mentioned above.
SONiC Software Version: SONiC.202405.0-dirty-20240916.120509
SONiC OS Version: 12
Distribution: Debian 12.7
Kernel: 6.1.0-11-2-amd64
Build commit: ee93bc7bd
Build date: Mon Sep 16 09:11:13 UTC 2024
Built by: netop@netop
@bingwang-ms bingwang-ms added Triaged this issue has been triaged YANG YANG model related changes labels Feb 12, 2025
@wen587
Copy link
Contributor

wen587 commented Feb 17, 2025

Hi @tomvil , did you try use config to check what the config should be?
I tried locally with config like below:

sudo config subinterface add Ethernet4.10
sudo config interface ip add Ethernet4.10 172.16.2.1/24

After that, the config looks like below:

{
...
    "VLAN_SUB_INTERFACE": {
        "Ethernet4.10": {
            "admin_status": "up"
        },
        "Ethernet4.10|172.16.2.1/24": {}
    },
...
}

It will not cause INTERFACE leafref issue since Ethernet4.10 is not located in INTERFACE table.

@tomvil
Copy link
Author

tomvil commented Feb 17, 2025

hey @wen587 , the command that is causing subinterface creation in INTERFACE section is config interface ipv6 enable use-link-local-only Ethernet0.666. We want to use bgp unnumbered with subinterface and it's working fine after enabling use-link-local-only, but we start to see this error.

# show runningconfiguration all | jq .INTERFACE
{
  "Ethernet0.666": {
    "ipv6_use_link_local_only": "enable"
  }
}

@wen587
Copy link
Contributor

wen587 commented Feb 17, 2025

So the config would be:

{
    "INTERFACE": {
        "Ethernet0.666": {
            "ipv6_use_link_local_only": "enable"
        }
    },
    "VLAN_SUB_INTERFACE": {
        "Ethernet0.666": {
            "admin_status": "up"
        }
    },
}

YANG model failed to recognize this Ethernet0.666 in INTERFACE table.
It could be the yang support missing in this case when add this use-link-local-only in #14757

@tomvil
Copy link
Author

tomvil commented Feb 17, 2025

@wen587 I think it would be the best to keep the "ipv6_use_link_local_only": "enable" config in VLAN_SUB_INTERFACE for subinterfaces.

For VLAN interface it's done like:

    "VLAN_INTERFACE": {
        "Vlan1000": {
            "ipv6_use_link_local_only": "enable"
        }
    }

I think it should be the same for VLAN_SUB_INTERFACE as well, something like:

{
    "VLAN_SUB_INTERFACE": {
        "Ethernet0.666": {
            "admin_status": "up",
            "ipv6_use_link_local_only": "enable"
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged this issue has been triaged YANG YANG model related changes
Projects
None yet
Development

No branches or pull requests

4 participants