sonic-net / sonic-utilities

Command line utilities for the SONiC project
Other
157 stars 664 forks source link

Auto_techsupport.py is failing in multi-asic platforms #2559

Open rajendrat opened 1 year ago

rajendrat commented 1 year ago

Description

auto_techsupport.py is failing for multi-asic platforms, enhancement needed to look platform specific config_db.

Steps to reproduce the issue

Try to do config auto-techsupport root@sfd-vt2-lc0:~# config auto-techsupport global max-core-limit 5 sonic_yang(6):Note: Below table(s) have no YANG models: CONSOLE_SWITCH, DEVICE_NEIGHBOR_METADATA, DHCP_SERVER, RESTAPI, SNMP, SNMP_COMMUNITY libyang[0]: Missing required element "lanes" in "PORT_LIST". (path: /sonic-port:sonic-port/PORT/PORT_LIST[name='Eth0/0/0/0']) sonic_yang(3):Data Loading Failed:Missing required element "lanes" in "PORT_LIST". Data Loading Failed Missing required element "lanes" in "PORT_LIST". Error: Failed to validate configuration: ConfigMgmt Class creation failed Aborted! root@sfd-vt2-lc0:~#

the auto_techsupport.py looking at /etc/sonic/config_db.c , not the multi asic specific config_db and didn't find lanes part of the default config db.

Describe the results you expected

Fix is to look at the config db based on the platform/namespace, that would address this issue. The autotechsupport scripts are failing because of this.

rajendrat commented 1 year ago

@abdosi

mlok-nokia commented 1 year ago

@judyjoseph @abdosi @rlhui The config_db.json (host instance) on multi-asic linecard contains "PORT" config with partial port info although there is NO front panel port on host instance on the multi-asic platform. This is generated by the CLI "config load_minigraph". The question is ---- Should port info be in the host config db on the multiasic platform? If so, we need to put the lane info to the "PORT" in host instance, or change the yang model file not to define the lane filed as mandatory. Either way will address this issue. Below is the partial port info with port alias as port name in config_db.json which is generated by "config load_mingraph"

admin@ixre-egl-board27:~$ sonic-db-dump -n CONFIG_DB -y -k "PORT|*"
{
  "PORT|Ethernet1/1": {
    "expireat": 1685555822.245561,
    "ttl": -0.001,
    "type": "hash",
    "value": {
      "admin_status": "up",
      "description": "ASIC0:Eth0",
      "fec": "rs",
      "mtu": "9100",
      "pfc_asym": "off",
      "speed": "100000",
      "tpid": "0x8100"
    }
  },
  "PORT|Ethernet10/1": {
    "expireat": 1685555822.2456274,
    "ttl": -0.001,
    "type": "hash",
    "value": {
      "admin_status": "up",
      "description": "ASIC0:Eth72",
      "fec": "rs",
      "mtu": "9100",
      "pfc_asym": "off",
      "speed": "100000",
      "tpid": "0x8100"
    }
  },
  "PORT|Ethernet11/1": {
    "expireat": 1685555822.245607,
    "ttl": -0.001,
    "type": "hash",
    "value": {
      "admin_status": "up",
      "description": "ASIC0:Eth80",
      "fec": "rs",
      "mtu": "9100",
      "pfc_asym": "off",
      "speed": "100000",
      "tpid": "0x8100"
    }
  },
kenneth-arista commented 1 year ago

I believe this is related to https://github.com/sonic-net/sonic-swss/pull/2618.

Tagging @vmittal-msft and @arlakshm for awareness

rlhui commented 1 year ago

currently auto techsupport feature is not enabled in deployments

abdosi commented 1 month ago

should be fixed via https://github.com/sonic-net/sonic-buildimage/pull/19968. Cherry-pick is pending for 202405 image .

please retry after cherry-pick is done.