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-models] VLAN yang model is not up-to-date #9120

Closed
ghooo opened this issue Oct 29, 2021 · 3 comments · Fixed by #8946
Closed

[yang-models] VLAN yang model is not up-to-date #9120

ghooo opened this issue Oct 29, 2021 · 3 comments · Fixed by #8946
Assignees
Labels
YANG YANG model related changes

Comments

@ghooo
Copy link
Contributor

ghooo commented Oct 29, 2021

Description

After building a KVM and removing the file /usr/local/yang-models/sonic-bgp-neighbor.yang, and validating config using yang-mgmt and we get an error:

sonic_yang(3):All Keys are not parsed in VLAN
dict_keys(['Vlan1000'])
sonic_yang(3):exceptionList:["'dhcpv6_servers'"]
sonic_yang(3):Data Loading Failed:All Keys are not parsed in VLAN
dict_keys(['Vlan1000'])

Steps to reproduce the issue:

  1. Build up a KVM env
  2. run: sudo rm /usr/local/yang-models/sonic-bgp-neighbor.yang
  3. Run the following code snippet in python3
import subprocess
import sonic_yang
import json
def get_config_db_json():
    cmd = "show runningconfiguration all"
    result = subprocess.Popen(cmd, shell=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    text, err = result.communicate()
    return json.loads(text)
configDbJson = get_config_db_json()
sy = sonic_yang.SonicYang("/usr/local/yang-models")
sy.loadYangModel()
sy.loadData(configDbJson )

Describe the results you received:

admin@vlab-01:~$ python3 test.py 
Note: Below table(s) have no YANG models:
BGP_NEIGHBOR, BGP_PEER_RANGE, BUFFER_PG, BUFFER_POOL, BUFFER_PROFILE, BUFFER_QUEUE, CABLE_LENGTH, CONSOLE_SWITCH, DEVICE_METADATA, DEVICE_NEIGHBOR_METADATA, DHCP_RELAY, DHCP_SERVER, DSCP_TO_TC_MAP, FEATURE, KDUMP, MAP_PFC_PRIORITY_TO_QUEUE, PORT_QOS_MAP, QUEUE, RESTAPI, SCHEDULER, SNMP, SNMP_COMMUNITY, SYSLOG_SERVER, TC_TO_PRIORITY_GROUP_MAP, TC_TO_QUEUE_MAP, TELEMETRY, WRED_PROFILE, 
sonic_yang(3):All Keys are not parsed in VLAN
dict_keys(['Vlan1000'])
sonic_yang(3):exceptionList:["'dhcpv6_servers'"]
sonic_yang(3):Data Loading Failed:All Keys are not parsed in VLAN
dict_keys(['Vlan1000'])
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sonic_yang_ext.py", line 716, in loadData
    self._xlateConfigDB(xlateFile=xlateFile)
  File "/usr/local/lib/python3.7/dist-packages/sonic_yang_ext.py", line 432, in _xlateConfigDB
    self._xlateConfigDBtoYang(jIn, yangJ)
  File "/usr/local/lib/python3.7/dist-packages/sonic_yang_ext.py", line 420, in _xlateConfigDBtoYang
    jIn[table], table)
  File "/usr/local/lib/python3.7/dist-packages/sonic_yang_ext.py", line 400, in _xlateContainer
    configC.keys())))
Exception: All Keys are not parsed in VLAN
dict_keys(['Vlan1000'])

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 12, in <module>
    sy.loadData(configDbJson )
  File "/usr/local/lib/python3.7/dist-packages/sonic_yang_ext.py", line 726, in loadData
    raise SonicYangException("Data Loading Failed\n{}".format(str(e)))
sonic_yang_ext.SonicYangException: Data Loading Failed
All Keys are not parsed in VLAN
dict_keys(['Vlan1000'])```

Describe the results you expected:

Successfully loading configDb into sonic_yang

Output of show version:

admin@vlab-01:~$ show version

SONiC Software Version: SONiC.master.37690-1a2e85248
Distribution: Debian 10.10
Kernel: 4.19.0-12-2-amd64
Build commit: 1a2e85248
Build date: Fri Sep 17 14:17:43 UTC 2021
Built by: AzDevOps@sonic-build-workers-000PC0

Platform: x86_64-kvm_x86_64-r0
HwSKU: Force10-S6000
ASIC: vs
ASIC Count: 1
Serial Number: N/A
Model Number: N/A
Hardware Revision: N/A
Uptime: 20:13:46 up 13 days, 23:47,  1 user,  load average: 1.11, 0.61, 0.41

Docker images:
REPOSITORY                    TAG                      IMAGE ID            SIZE
docker-platform-monitor       latest                   521ca112ce1b        630MB
docker-platform-monitor       master.37690-1a2e85248   521ca112ce1b        630MB
docker-sonic-mgmt-framework   latest                   007c6afa0bef        570MB
docker-sonic-mgmt-framework   master.37690-1a2e85248   007c6afa0bef        570MB
docker-snmp                   latest                   d919e712bdd7        455MB
docker-snmp                   master.37690-1a2e85248   d919e712bdd7        455MB
docker-sonic-telemetry        latest                   88af4994a44d        502MB
docker-sonic-telemetry        master.37690-1a2e85248   88af4994a44d        502MB
docker-dhcp-relay             latest                   a22ce5135236        420MB
docker-lldp                   latest                   942d89861049        453MB
docker-lldp                   master.37690-1a2e85248   942d89861049        453MB
docker-fpm-frr                latest                   6f30a087f8f0        443MB
docker-fpm-frr                master.37690-1a2e85248   6f30a087f8f0        443MB
docker-database               latest                   d7fc3d3a7350        413MB
docker-database               master.37690-1a2e85248   d7fc3d3a7350        413MB
docker-macsec                 latest                   2bcd6845512d        428MB
docker-macsec                 master.37690-1a2e85248   2bcd6845512d        428MB
docker-gbsyncd-vs             latest                   e54caa969796        421MB
docker-gbsyncd-vs             master.37690-1a2e85248   e54caa969796        421MB
docker-sflow                  latest                   05f50df84c33        426MB
docker-sflow                  master.37690-1a2e85248   05f50df84c33        426MB
docker-syncd-vs               latest                   6d9154f74abd        421MB
docker-syncd-vs               master.37690-1a2e85248   6d9154f74abd        421MB
docker-orchagent              latest                   726cd536a28c        443MB
docker-orchagent              master.37690-1a2e85248   726cd536a28c        443MB
docker-nat                    latest                   0501248b66d1        428MB
docker-nat                    master.37690-1a2e85248   0501248b66d1        428MB
docker-router-advertiser      latest                   8023aa0c2925        413MB
docker-router-advertiser      master.37690-1a2e85248   8023aa0c2925        413MB
docker-teamd                  latest                   c863719dc61a        425MB
docker-teamd                  master.37690-1a2e85248   c863719dc61a        425MB```
@ghooo ghooo added the YANG YANG model related changes label Oct 29, 2021
@ghooo
Copy link
Contributor Author

ghooo commented Oct 29, 2021

@praveen-li

@zhangyanzhao
Copy link
Collaborator

@AkhileshSamineni please help to handle this issue when working on 8946. Thanks.

@qiluo-msft
Copy link
Collaborator

@ghooo Please verify this issue is closed by linked pull request.

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

Successfully merging a pull request may close this issue.

3 participants