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

Catch acl table KeyError in caclmgrd to avoid caclmgrd not working #104

Closed
wants to merge 3 commits into from

Conversation

ZhaohuiS
Copy link
Contributor

@ZhaohuiS ZhaohuiS commented Mar 6, 2024

The KeyError issue could happen during using acl-loader to delete acl rules, after KeyError, the caclmgrd still show active:running, but it doesn't respond to any action from acl-loader.
For avoiding caclmgrd got stuck, catch the KeyError exception and let program continue.

<85>Jan 28 22:39:37 SJC20-0101-0203-17T1 sudo: sonic_user : TTY=pts/0 ; PWD=/home/sonic_user ; USER=root ; COMMAND=/usr/local/bin/acl-loader delete IPV6_SSH_ONLY
<30>Jan 28 22:39:37 SJC20-0101-0203-17T1 caclmgrd[4612]: ACL config not stable for namespace '': 1 changes detected in the past 0.5 seconds. Skipping update ...
<30>Jan 28 22:39:37 sonic caclmgrd[4612]: ACL config not stable for namespace '': 2 changes detected in the past 0.5 seconds. Skipping update ...
<85>Jan 28 22:39:37 sonic sudo: sonic_user : TTY=pts/0 ; PWD=/home/sonic_user ; USER=root ; COMMAND=/usr/local/bin/acl-loader delete SNMP_ACL
<30>Jan 28 22:39:38 sonic caclmgrd[4612]: ACL config for namespace '' has not changed for 0.5 seconds. Applying updates ...
<30>Jan 28 22:39:38 sonic caclmgrd[2020138]: Device "eth1-midplane" does not exist.
<30>Jan 28 22:39:38 sonic caclmgrd[4612]: Translating ACL rules for control plane ACL 'IPV6_SNMP_ACL' (service: 'SNMP')
<30>Jan 28 22:39:38 sonic caclmgrd[4612]: Translating ACL rules for control plane ACL 'SNMP_ACL' (service: 'SNMP')
<28>Jan 28 22:39:38 sonic caclmgrd[4612]: Unable to determine if ACL table 'IPV6_SSH_ONLY' contains IPv4 or IPv6 rules. Skipping table...
<28>Jan 28 22:39:38 sonic caclmgrd[4612]: Unable to determine if ACL table 'IPV6_SNMP_ACL' contains IPv4 or IPv6 rules. Skipping table...
<30>Jan 28 22:39:38 sonic caclmgrd[4612]: Translating ACL rules for control plane ACL 'IPV6_SSH_ONLY' (service: 'SSH')
<30>Jan 28 22:39:38 sonic caclmgrd[4612]: Translating ACL rules for control plane ACL 'SSH_ONLY' (service: 'SSH')
<30>Jan 28 22:39:38 sonic caclmgrd[4612]: Traceback (most recent call last):
<30>Jan 28 22:39:38 sonic caclmgrd[4612]:     caclmgr.run()
<30>Jan 28 22:39:38 sonic caclmgrd[4612]:   File "/usr/local/bin/caclmgrd", line 1022, in main
<30>Jan 28 22:39:38 sonic caclmgrd[4612]: KeyError: 'SNMP_ACL'
<30>Jan 28 22:39:38 sonic caclmgrd[4612]:   File "/usr/local/bin/caclmgrd", line 1026, in <module>
<30>Jan 28 22:39:38 sonic caclmgrd[4612]:     main()
<30>Jan 28 22:39:38 sonic caclmgrd[4612]:     if self.config_db_map[namespace].get_table(self.ACL_TABLE)[acl_table]["type"] == self.ACL_TABLE_TYPE_CTRLPLANE:
<30>Jan 28 22:39:38 sonic caclmgrd[4612]:   File "/usr/local/bin/caclmgrd", line 992, in run
<85>Jan 28 22:39:38 sonic sudo: sonic_user : TTY=pts/0 ; PWD=/home/sonic_user ; USER=root ; COMMAND=/usr/local/bin/acl-loader delete SSH_ONLY
<85>Jan 28 22:39:39 sonic sudo: sonic_user : TTY=pts/0 ; PWD=/home/sonic_user ; USER=root ; COMMAND=/usr/local/bin/acl-loader update full /etc/sonic/acl.json --table_name IPV6_SNMP_ACL
<12>Jan 28 22:40:02 sonic acl-loader: EVERFLOWSTATIC table does not exist
<85>Jan 28 22:40:03 sonic sudo: sonic_user : TTY=pts/0 ; PWD=/home/sonic_user ; USER=root ; COMMAND=/usr/local/bin/acl-loader update full /etc/sonic/acl.json --table_name SNMP_ACL
<12>Jan 28 22:40:25 sonic acl-loader: EVERFLOWSTATIC table does not exist
<85>Jan 28 22:40:27 sonic sudo: sonic_user : TTY=pts/0 ; PWD=/home/sonic_user ; USER=root ; COMMAND=/usr/local/bin/acl-loader update full /etc/sonic/acl.json --table_name IPV6_SSH_ONLY

Signed-off-by: Zhaohui Sun <[email protected]>
Signed-off-by: Zhaohui Sun <[email protected]>
@ZhaohuiS ZhaohuiS marked this pull request as draft April 2, 2024 05:39
@ZhaohuiS
Copy link
Contributor Author

ZhaohuiS commented Apr 2, 2024

The issue was fixed in #62

@ZhaohuiS ZhaohuiS closed this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant