Skip to content

swsscommon Error in docker database supervisord init - flush_unused_database failed #12050

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

Closed
anamehra opened this issue Sep 12, 2022 · 8 comments
Assignees
Labels
Chassis 🤖 Modular chassis support MSFT Triaged this issue has been triaged

Comments

@anamehra
Copy link
Contributor

anamehra commented Sep 12, 2022

Description

Observing following error during database docker start with latest master based image:
Sep 11 23:28:24.601520 sfd-t2-sup INFO database#supervisord: flushdb File "/usr/local/bin/flush_unused_database", line 14, in
Sep 11 23:28:24.601665 sfd-t2-sup INFO database#supervisord: flushdb instlists = swsscommon.SonicDBConfig.getInstanceList()
Sep 11 23:28:24.601665 sfd-t2-sup INFO database#supervisord: flushdb NameError: name 'swsscommon' is not defined
Sep 11 23:28:24.613745 sfd-t2-sup INFO database#supervisord 2022-09-11 23:28:24,613 INFO exited: flushdb (exit status 1; not expected)

Looks like introduced by #11600

Steps to reproduce the issue:

Describe the results you received:

Describe the results you expected:

Output of show version:

Hit this issue on msft/202205 sha 2723c11
https://github.com/azure/sonic-buildimage-msft/commit/2723c1181a69aa14a92ea995e0a866c5f9b941b1
#### 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):

<!--
     Also attach debug file produced by `sudo generate_dump`
-->
@anamehra
Copy link
Contributor Author

Hi @abdosi , FYI-

@zhangyanzhao
Copy link
Collaborator

@anamehra can you please help to add the repro steps and paste the output?

@zhangyanzhao zhangyanzhao added Triaged this issue has been triaged MSFT labels Sep 14, 2022
@rlhui rlhui added the Chassis 🤖 Modular chassis support label Sep 14, 2022
@anamehra
Copy link
Contributor Author

@anamehra can you please help to add the repro steps and paste the output?

@zhangyanzhao, this is 100% reproducible on the latest image I build. If one enter database docker, and try to run flush_unused_database, it throws error. import swsscommon is missing. But looks like its not just limited to that. I added the import statement and hit a different issue.

root@sonic:/home/cisco# docker exec -it database0 bash
root@sonic:/# ps aux | grep flush
root        6327  0.0  0.0   3180   656 pts/1    S+   15:32   0:00 grep flush
root@sonic:/# 

root@sonic:/# /usr/local/bin/flush_unused_database 
Traceback (most recent call last):
  File "/usr/local/bin/flush_unused_database", line 14, in <module>
    instlists = swsscommon.SonicDBConfig.getInstanceList()
NameError: name 'swsscommon' is not defined
root@sonic:/# 

Added import swsscommon:

root@sonic:/# /usr/local/bin/flush_unused_database 
Traceback (most recent call last):
  File "/usr/local/bin/flush_unused_database", line 15, in <module>
    instlists = swsscommon.SonicDBConfig.getInstanceList()
AttributeError: module 'swsscommon' has no attribute 'SonicDBConfig'
root@sonic:/#

@rlhui
Copy link
Contributor

rlhui commented Sep 14, 2022

@anamehra - is this issue seen in master or 202205 based, or both? Thanks. Reminder to put basic info when logging issues. (please see template).

@anamehra
Copy link
Contributor Author

@anamehra - is this issue seen in master or 202205 based, or both? Thanks. Reminder to put basic info when logging issues. (please see template).

Hi @rlhui , Hit this issue on msft/202205, have not tested master. May be fixed in master and needs double commit to 202205. Update the description with sha1.

@anamehra
Copy link
Contributor Author

Looks like related to this commit missing in 202205
#11215

@liuh-80
Copy link
Contributor

liuh-80 commented Sep 15, 2022

I will check and make a list for PRs need cherry-pick to 202205 to fix this issue:
sonic-net/sonic-swss-common#639
#11215

Another solution is to revert 'deprecate swsssdk' related change from 202205, because all work for this are finished after june.

I we want revert, here is PR list:
#11600

I will check which is more easy and update here.

@liuh-80
Copy link
Contributor

liuh-80 commented Sep 15, 2022

After check all related PR, I found the root cause of this issue is PR #11600 been cherry-pick to 202205 branch by mistake, the deprecate swsssdk feature not ready to be cherry pick to 202205.

I create this revert PR to revert change in #11600:
#12084

@anamehra anamehra closed this as completed Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chassis 🤖 Modular chassis support MSFT Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

5 participants