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

[generic_config_updater] validating TACPLUS with empty “gobal” fails, while non-empty “global” does not fail #2004

Closed
wen587 opened this issue Jan 12, 2022 · 3 comments

Comments

@wen587
Copy link
Contributor

wen587 commented Jan 12, 2022

Description

Empty dict_key['global'] was not parsed in TACPLUS table.

Steps to reproduce the issue

Background of tacacs table. In t0 topo, tacacs has default value while configDB doesn't contain those table.
After sudo config tacacs value, its table will appear in configDB.
Then the table will contains empty value after set back to default.

  1. Check configDB table of TACACS
admin@vlab-01:~/$ show run all | grep -w TACPLUS
admin@vlab-01:~/$ show tacacs
TACPLUS global auth_type pap (default)
TACPLUS global timeout 5 (default)
TACPLUS global passkey <EMPTY_STRING> (default)
  1. sudo config tacacs and revert to default. TACPLUS table appear in configDB.
admin@vlab-01:~$ sudo config tacacs timeout 3
admin@vlab-01:~$ show run all | grep -w TACPLUS -A3
    "TACPLUS": {
        "global": {
            "timeout": "3"
        }
admin@vlab-01:~$ sudo config tacacs default timeout
admin@vlab-01:~$ show run all | grep -w TACPLUS -A3
    "TACPLUS": {
        "global": {}
    },
    "TACPLUS_SERVER": {

  1. apply-patch empty json. Action fail.

Describe the results you received

admin@vlab-01:~$ sudo config apply-patch -i /FEATURE -i /QUEUE -i /SCHEDULER empty.json
Patch Applier: Patch application starting.
Patch Applier: Patch: []
Patch Applier: Getting current config db.
Patch Applier: Simulating the target full config after applying the patch.
Patch Applier: Validating target config does not have empty tables, since they do not show up in ConfigDb.
Patch Applier: Sorting patch updates.
Note: Below table(s) have no YANG models:
BGP_PEER_RANGE, CONSOLE_SWITCH, DEVICE_NEIGHBOR_METADATA, DHCP_SERVER, KDUMP, RESTAPI, SNMP, SNMP_COMMUNITY, TELEMETRY,
sonic_yang(3):All Keys are not parsed in TACPLUS
dict_keys(['global'])
sonic_yang(3):exceptionList:[]
sonic_yang(3):Data Loading Failed:All Keys are not parsed in TACPLUS
dict_keys(['global'])
Failed to apply patch
Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH
Try "config apply-patch -h" for help.

Error: Given patch is not valid because it will result in an invalid config

Describe the results you expected

apply-patch should not be impact

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

admin@vlab-01:~$ show ver

SONiC Software Version: SONiC.master.58770-6402a0226
Distribution: Debian 11.1
Kernel: 5.10.0-8-2-amd64
Build commit: 6402a0226
Build date: Mon Dec 13 09:02:14 UTC 2021
Built by: AzDevOps@sonic-build-workers-000Z9S

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: 07:27:57 up  1:45,  2 users,  load average: 0.11, 0.17, 0.16

@ghooo
Copy link
Contributor

ghooo commented Jan 12, 2022

This seem like a YANG model issue. TACPLUS yang model needs to be updated. Right?

@wen587
Copy link
Contributor Author

wen587 commented Jan 12, 2022

This seem like a YANG model issue. TACPLUS yang model needs to be updated. Right?

I am not sure. apply-patch can work when it contains value. Please see my code snippet.

admin@vlab-01:~/tacacs$ sudo config tacacs timeout 3
admin@vlab-01:~/tacacs$ show run all | grep -w TACPLUS -A3
    "TACPLUS": {
        "global": {
            "timeout": "3"
        }
admin@vlab-01:~/tacacs$ sudo config apply-patch -i /FEATURE -i /QUEUE -i /SCHEDULER tacacs_rm.json
Patch Applier: Patch application starting.
Patch Applier: Patch: [{"op": "remove", "path": "/TACPLUS"}]
Patch Applier: Getting current config db.
Patch Applier: Simulating the target full config after applying the patch.
Patch Applier: Validating target config does not have empty tables, since they do not show up in ConfigDb.
Patch Applier: Sorting patch updates.
...
sonic_yang(3):All Keys are not parsed in TACPLUS
dict_keys(['global'])
sonic_yang(3):exceptionList:[]
sonic_yang(3):Data Loading Failed:All Keys are not parsed in TACPLUS
dict_keys(['global'])
...
Patch Applier: The patch was sorted into 1 change:
Patch Applier:   * [{"op": "remove", "path": "/TACPLUS"}]
Patch Applier: Applying 1 change in order:
Patch Applier:   * [{"op": "remove", "path": "/TACPLUS"}]
Patch Applier: Verifying patch updates are reflected on ConfigDB.
Patch Applier: Patch application completed.
Patch applied successfully.

Is it possible that 'global' cannot be empty?

@wen587 wen587 changed the title [generic_config_updater] dict_key 'global' was not parsed in TACPLUS [generic_config_updater] validating TACPLUS with empty “gobal” fails, while non-empty “global” does not fail Jan 12, 2022
@ghooo
Copy link
Contributor

ghooo commented Jan 12, 2022

Issue is in sonic_yang_mgmt or sonic_yang_models for which we have created sonic-net/sonic-buildimage#9746

@ghooo ghooo closed this as completed Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants