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

202205: caclmgrd traceback KeyError: 'dst_ports' #12179

Closed
anamehra opened this issue Sep 24, 2022 · 4 comments · Fixed by sonic-net/sonic-host-services#21
Closed

202205: caclmgrd traceback KeyError: 'dst_ports' #12179

anamehra opened this issue Sep 24, 2022 · 4 comments · Fixed by sonic-net/sonic-host-services#21

Comments

@anamehra
Copy link
Contributor

Description

caclmgrd process throws traceback

Sep 23 23:25:48.993340 sfd-t2-lc0 INFO caclmgrd[247606]: File "/usr/local/bin/caclmgrd", line 973, in
Sep 23 23:25:48.993535 sfd-t2-lc0 INFO caclmgrd[247606]: main()
Sep 23 23:25:48.993577 sfd-t2-lc0 INFO caclmgrd[247606]: File "/usr/local/bin/caclmgrd", line 969, in main
Sep 23 23:25:48.993724 sfd-t2-lc0 INFO caclmgrd[247606]: caclmgr.run()
Sep 23 23:25:48.993764 sfd-t2-lc0 INFO caclmgrd[247606]: File "/usr/local/bin/caclmgrd", line 854, in run
Sep 23 23:25:48.993887 sfd-t2-lc0 INFO caclmgrd[247606]: self.update_control_plane_acls(namespace)
Sep 23 23:25:48.993933 sfd-t2-lc0 INFO caclmgrd[247606]: File "/usr/local/bin/caclmgrd", line 736, in update_control_plane_acls
Sep 23 23:25:48.994062 sfd-t2-lc0 INFO caclmgrd[247606]: self.update_control_plane_nat_acls(namespace, service_to_source_ip_map)
Sep 23 23:25:48.994100 sfd-t2-lc0 INFO caclmgrd[247606]: File "/usr/local/bin/caclmgrd", line 746, in update_control_plane_nat_acls
Sep 23 23:25:48.994255 sfd-t2-lc0 INFO caclmgrd[247606]: iptables_cmds = self.generate_fwd_traffic_from_namespace_to_host_commands(namespace, service_to_source_ip_map)
Sep 23 23:25:48.994296 sfd-t2-lc0 INFO caclmgrd[247606]: File "/usr/local/bin/caclmgrd", line 354, in generate_fwd_traffic_from_namespace_to_host_commands
Sep 23 23:25:48.994388 sfd-t2-lc0 INFO caclmgrd[247606]: for dst_port in self.ACL_SERVICES[acl_service]["dst_ports"]:
Sep 23 23:25:48.994434 sfd-t2-lc0 INFO caclmgrd[247606]: KeyError: 'dst_ports'

Looks like comming from
"EXTERNAL_CLIENT": {
"ip_protocols": ["tcp"],
"multi_asic_ns_to_host_fwd":True
},

This block is missing
"dst_ports": ["8081"],

but there is no check-in line 354 to ignore missing dst_ports

Steps to reproduce the issue:

  1. Loaded 202205 based image on Chassis Line Card
  2. During boot, observed the traceback and it caused acl test failure

Describe the results you received:

calcmgr traceback as mentioned above

Describe the results you expected:

No traceback and no acl errors

Output of show version:

202205 sha1  77b469d7c87f04d6298d598936fe7d46dc7890b6

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):

@anamehra
Copy link
Contributor Author

@abdosi , @SuvarnaMeenakshi , @ZhaohuiS , FYI-

@ZhaohuiS
Copy link
Contributor

@anamehra I will take a look.

@abdosi
Copy link
Contributor

abdosi commented Sep 25, 2022

@ZhaohuiS I have pr already with fix. Will create it by tomorrow. Please help in review that

@ZhaohuiS
Copy link
Contributor

ACL_SERVICES

@abdosi Sure, thank you for your quick fix. I haven't considered multi-asic scenario.

abdosi added a commit to sonic-net/sonic-host-services that referenced this issue Sep 28, 2022
What I did:
Fixes: sonic-net/sonic-buildimage#12179

Why I did:
Fix the issue where if dest port is not specified in ACL rule than for multi-asic where we create NAT rule to forward traffic from Namespace to host fail with exception.

How I verify:-
Added UT for the scenario.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants