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

[master] sonic-db-cli was not able to connect to CHASSIS DB when namespace is provided. #18733

Closed
ysmanman opened this issue Apr 19, 2024 · 7 comments
Assignees
Labels
Chassis 🤖 Modular chassis support P0 Priority of the issue Triaged this issue has been triaged

Comments

@ysmanman
Copy link
Contributor

Description

sonic-db-cli was not able to connect to CHASSIS DB in host namespace when namespace is provided:

admin@cmp217-5:/var/log$ sudo sonic-db-cli -n asic0 CHASSIS_APP_DB keys "*"
Invalid database name input : 'CHASSIS_APP_DB'
Unable to connect to redis (unix-socket): Cannot assign requested address
admin@cmp217-5:/var/log$ 

It worked fine within asic namespace (without providing namespace):

admin@cmp217-5:/var/log$ docker exec -it swss0 bash
root@cmp217-5:/# sonic-db-cli CHASSIS_APP_DB keys "*"
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet256
SYSTEM_INTERFACE|cmp217-5|asic0|Ethernet80
SYSTEM_INTERFACE|cmp217-5|asic0|Ethernet32
SYSTEM_INTERFACE|cmp217-5|asic0|Ethernet-IB0
SYSTEM_LAG_ID_START
SYSTEM_INTERFACE|cmp217-5|asic0|Ethernet24
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet216
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet224
SYSTEM_LAG_ID_END
SYSTEM_NEIGH|cmp217-5|asic1|Ethernet-IB1|10.0.254.3
SYSTEM_NEIGH|cmp217-5|asic0|Ethernet-IB0|10.0.254.1
SYSTEM_INTERFACE|cmp217-5|asic0|Ethernet88
SYSTEM_INTERFACE|cmp217-5|asic0|Ethernet40
SYSTEM_NEIGH|cmp217-5|asic1|Ethernet-IB1|fc00:3000::3
SYSTEM_NEIGH|cmp217-5|asic0|Ethernet-IB0|fc00:3000::1
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet176
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet-IB1
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet184
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet-Rec1
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet248
SYSTEM_INTERFACE|cmp217-5|asic1|Ethernet144
SYSTEM_INTERFACE|cmp217-5|asic0|Ethernet-Rec0
root@cmp217-5:/# 

Steps to reproduce the issue:

Describe the results you received:

Describe the results you expected:

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

@ysmanman
Copy link
Contributor Author

This seems a regression introduced by sonic-net/sonic-swss-common#797. Before this PR, sonic-db-cli use tcp socket to connect to CHASSIS DBs by default. But with this PR, now it always uses unix socket when namespace is provided.

@ysmanman
Copy link
Contributor Author

Add @kenneth-arista @arista-nwolfe @arlakshm for viz.

@mlok-nokia
Copy link
Contributor

Afte PR797, behaviours has been changed.

  1. Question and confusion: If command "sonic-db-cli -n asic0 STATE_DB PING " means from localhost to ping asic0 STATE_DB, what does it mean by "sonic-db-cli -n asic0 CHASSIS_STATE_DB PING"? Are we ping asic0 CHASSIS_STATE_DB from local host? There is NO CHASSIS_STATE_DB in asic0 namespace. Should PING failure be expected?

  2. If we want to allow to PING/access CHASSIS_STATE_DB regardless of "sonic-db-cli" with any asic instance ID specified in the specified in command line, then this issue needs to be addressed.

I have fixed one case with PR sonic-net/sonic-swss-common#866 : "sonic-db-cli -n asic0 PING" which is in the database.sh. In our private branch, we temporarily address this issue by modifying the swss.sh to use sonic-db-cli without asic instance when it wants to access CHASSIS DB.

@bingwang-ms bingwang-ms added the Chassis 🤖 Modular chassis support label Apr 24, 2024
@bingwang-ms
Copy link
Contributor

The issue will be discussed in chassis meeting.

@bingwang-ms bingwang-ms added the Triaged this issue has been triaged label Apr 24, 2024
@rlhui rlhui added the P0 Priority of the issue label May 1, 2024
@kenneth-arista
Copy link
Contributor

Some related history: #7002

@rlhui rlhui assigned mlok-nokia and unassigned rlhui May 1, 2024
@kenneth-arista
Copy link
Contributor

Additional related history: #17962

@wenyiz2021
Copy link
Contributor

sonic-net/sonic-swss-common#883 also merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chassis 🤖 Modular chassis support P0 Priority of the issue Triaged this issue has been triaged
Projects
Status: Done
Development

No branches or pull requests

6 participants