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

[database]: Traceback during flush of unused database #14531

Closed
nazariig opened this issue Apr 5, 2023 · 3 comments
Closed

[database]: Traceback during flush of unused database #14531

nazariig opened this issue Apr 5, 2023 · 3 comments
Assignees

Comments

@nazariig
Copy link
Collaborator

nazariig commented Apr 5, 2023

Description

Looks like that database container is missing python3-redis package.

Traceback:

Mar 29 15:39:09.721859 sonic INFO database#supervisord: flushdb Traceback (most recent call last):
Mar 29 15:39:09.721859 sonic INFO database#supervisord: flushdb   File "/usr/local/bin/flush_unused_database", line 3, in <module>
Mar 29 15:39:09.722525 sonic INFO database#supervisord: flushdb     import redis
Mar 29 15:39:09.722525 sonic INFO database#supervisord: flushdb ModuleNotFoundError: No module named 'redis'
Mar 29 15:39:09.731512 sonic INFO database#supervisord 2023-03-29 15:39:09,730 INFO exited: flushdb (exit status 1; not expected)

Steps to reproduce the issue:

  1. docker exec -ti database bash
  2. /usr/local/bin/flush_unused_database

Describe the results you received:

Script fails with traceback

Describe the results you expected:

No traceback is expected

Output of show version:

  • N/A

Output of show techsupport:

  • N/A

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

  • N/A
@nazariig nazariig changed the title [202211][database]: Traceback during flush of unused database [database]: Traceback during flush of unused database Apr 12, 2023
@vmittal-msft vmittal-msft added Triaged this issue has been triaged MSFT labels Apr 12, 2023
@qiluo-msft qiluo-msft assigned qiluo-msft and liuh-80 and unassigned qiluo-msft Apr 12, 2023
@liuh-80
Copy link
Contributor

liuh-80 commented Apr 13, 2023

Create a fix PR: #14632
Also new UT to cover this script: sonic-net/sonic-mgmt#8032

qiluo-msft pushed a commit that referenced this issue Apr 20, 2023
Install python-redis package to docker containers

#### Why I did it
This this bug: #14531
The 'flush_unused_database' is part of docker-database, and docker-database does not install python-redis package by itself. it's using redis installed by sonic-py-swsssdk.
So after remove sonic-py-swsssdk from container, this script break.

To this this bug and avoid similer bug happen again, install python-redis to docker containers which removed sonic-py-swsssdk .

#### How I did it
Install python-redis to containers.

#### How to verify it
Pass all UT.
Create new UT to cover this scenario: sonic-net/sonic-mgmt#8032

#### Description for the changelog
Improve sudo cat command for RO user.
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this issue Apr 20, 2023
Install python-redis package to docker containers

#### Why I did it
This this bug: sonic-net#14531
The 'flush_unused_database' is part of docker-database, and docker-database does not install python-redis package by itself. it's using redis installed by sonic-py-swsssdk.
So after remove sonic-py-swsssdk from container, this script break.

To this this bug and avoid similer bug happen again, install python-redis to docker containers which removed sonic-py-swsssdk .

#### How I did it
Install python-redis to containers.

#### How to verify it
Pass all UT.
Create new UT to cover this scenario: sonic-net/sonic-mgmt#8032

#### Description for the changelog
Improve sudo cat command for RO user.
mssonicbld pushed a commit that referenced this issue Apr 23, 2023
Install python-redis package to docker containers

#### Why I did it
This this bug: #14531
The 'flush_unused_database' is part of docker-database, and docker-database does not install python-redis package by itself. it's using redis installed by sonic-py-swsssdk.
So after remove sonic-py-swsssdk from container, this script break.

To this this bug and avoid similer bug happen again, install python-redis to docker containers which removed sonic-py-swsssdk .

#### How I did it
Install python-redis to containers.

#### How to verify it
Pass all UT.
Create new UT to cover this scenario: sonic-net/sonic-mgmt#8032

#### Description for the changelog
Improve sudo cat command for RO user.
@liuh-80
Copy link
Contributor

liuh-80 commented Apr 26, 2023

@nazariig , PR and UT PR merged, please confirm I can close this issue.

@nazariig
Copy link
Collaborator Author

@liuh-80 closed. Thanks for the fix!

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

4 participants