You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2025 Jan 7 02:20:27.950607 r-anaconda-51 INFO database.sh[4827]: libyang[0]: Value "" does not satisfy the constraint "(((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt)),)*((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt))" (range, length, or pattern). (path: /sonic-static-route:sonic-static-route/STATIC_ROUTE/STATIC_ROUTE_LIST[vrf_name='default'][prefix='50.0.0.0/24']/nexthop-vrf)
2025 Jan 7 02:20:27.951583 r-anaconda-51 ERR sonic_yang: Data Loading Failed:Value "" does not satisfy the constraint "(((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt)),)*((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt))" (range, length, or pattern).
2025 Jan 7 02:20:27.951682 r-anaconda-51 ERR config_validator.py: Yang validation failed: Data Loading Failed#012Value "" does not satisfy the constraint "(((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt)),)*((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt))" (range, length, or pattern).
2025 Jan 7 02:20:27.951759 r-anaconda-51 INFO database.sh[4827]: sonic_yang(3):Data Loading Failed:Value "" does not satisfy the constraint "(((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt)),)*((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt))" (range, length, or pattern).
2025 Jan 7 02:20:27.951805 r-anaconda-51 INFO database.sh[4827]: Traceback (most recent call last):
2025 Jan 7 02:20:27.951842 r-anaconda-51 INFO database.sh[4827]: File "/usr/local/lib/python3.11/dist-packages/sonic_yang_ext.py", line 1176, in loadData
2025 Jan 7 02:20:27.954680 r-anaconda-51 INFO database.sh[4827]: self.root = self.ctx.parse_data_mem(dumps(self.xlateJson), \
2025 Jan 7 02:20:27.954754 r-anaconda-51 INFO database.sh[4827]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025 Jan 7 02:20:27.954781 r-anaconda-51 INFO database.sh[4827]: File "/usr/lib/python3/dist-packages/yang.py", line 2574, in parse_data_mem
2025 Jan 7 02:20:27.956987 r-anaconda-51 INFO database.sh[4827]: return _yang.Context_parse_data_mem(self, data, format, options)
2025 Jan 7 02:20:27.957072 r-anaconda-51 INFO database.sh[4827]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025 Jan 7 02:20:27.957100 r-anaconda-51 INFO database.sh[4827]: RuntimeError: Value "" does not satisfy the constraint "(((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt)),)*((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt))" (range, length, or pattern).
2025 Jan 7 02:20:27.957122 r-anaconda-51 INFO database.sh[4827]: During handling of the above exception, another exception occurred:
2025 Jan 7 02:20:27.957142 r-anaconda-51 INFO database.sh[4827]: Traceback (most recent call last):
2025 Jan 7 02:20:27.957162 r-anaconda-51 INFO database.sh[4827]: File "/usr/local/bin/config_validator.py", line 44, in <module>
2025 Jan 7 02:20:27.957188 r-anaconda-51 INFO database.sh[4827]: main()
2025 Jan 7 02:20:27.957218 r-anaconda-51 INFO database.sh[4827]: File "/usr/local/bin/config_validator.py", line 33, in main
2025 Jan 7 02:20:27.957289 r-anaconda-51 INFO database.sh[4827]: yang_parser.loadData(configdbJson=config)
2025 Jan 7 02:20:27.957319 r-anaconda-51 INFO database.sh[4827]: File "/usr/local/lib/python3.11/dist-packages/sonic_yang_ext.py", line 1183, in loadData
2025 Jan 7 02:20:27.957542 r-anaconda-51 INFO database.sh[4827]: raise SonicYangException("Data Loading Failed\n{}".format(str(e)))
2025 Jan 7 02:20:27.957587 r-anaconda-51 INFO database.sh[4827]: sonic_yang_ext.SonicYangException: Data Loading Failed
2025 Jan 7 02:20:27.957611 r-anaconda-51 INFO database.sh[4827]: Value "" does not satisfy the constraint "(((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt)),)*((Vrf[a-zA-Z0-9_-]+)|(default)|(mgmt))" (range, length, or pattern).
Steps to reproduce the issue:
config static route through CLI
config save
config reload
Describe the results you received:
Config reload fails in yang validation
Describe the results you expected:
config reload should not fail.
Output of show version:
(paste your output here)
Output of show techsupport:
(paste your output here or download and attach the file here )
Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered:
Description
When configuring static route through CLI, if nexthop-vrf is not configured, an empty string is set as value
https://github.com/sonic-net/sonic-utilities/blob/7100f73b107b5a7806488311e224e6be29c6b412/config/main.py#L7032
However the yang validation mandates nexthop-vrf to be a valid vrf string as per the pattern.
sonic-buildimage/src/sonic-yang-models/yang-models/sonic-static-route.yang
Line 114 in 4317df5
Hence when we config static route through CLI, save and perform config reload, it results in yang validation failure
Steps to reproduce the issue:
Describe the results you received:
Config reload fails in yang validation
Describe the results you expected:
config reload should not fail.
Output of
show version
:Output of
show techsupport
:Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: