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

[DB Migrator] DB Migration from 202012 to 202205 does not work #12643

Closed
dgsudharsan opened this issue Nov 8, 2022 · 0 comments · Fixed by sonic-net/sonic-utilities#2515
Closed
Assignees
Labels
MSFT Triaged this issue has been triaged

Comments

@dgsudharsan
Copy link
Collaborator

dgsudharsan commented Nov 8, 2022

Description

The latest 202012 has DB migrator version as 2_0_2. However there is no handler for this version in 202205

Nov 8 03:30:48 sonic config-setup[3464]: Running command: /usr/local/bin/db_migrator.py -o migrate
Nov 8 03:30:48 sonic config-setup[3464]: Running command: /usr/local/bin/db_migrator.py -o migrate
Nov 8 03:30:48 sonic mellanox_buffer_migrator: Caught exception: 'DBMigrator' object has no attribute 'version_2_0_2'
Nov 8 03:30:48 sonic mellanox_buffer_migrator: Caught exception: 'DBMigrator' object has no attribute 'version_2_0_2'
Nov 8 03:30:48 sonic config-setup[3988]: Traceback (most recent call last):
Nov 8 03:30:48 sonic config-setup[3988]: Traceback (most recent call last):
Nov 8 03:30:48 sonic config-setup[3988]: File "/usr/local/bin/db_migrator.py", line 816, in main
Nov 8 03:30:48 sonic config-setup[3988]: File "/usr/local/bin/db_migrator.py", line 816, in main
Nov 8 03:30:48 sonic config-setup[3988]: result = getattr(dbmgtr, operation)()
Nov 8 03:30:48 sonic config-setup[3988]: result = getattr(dbmgtr, operation)()
Nov 8 03:30:48 sonic config-setup[3988]: File "/usr/local/bin/db_migrator.py", line 768, in migrate
Nov 8 03:30:48 sonic config-setup[3988]: File "/usr/local/bin/db_migrator.py", line 768, in migrate
Nov 8 03:30:48 sonic config-setup[3988]: next_version = getattr(self, version)()
Nov 8 03:30:48 sonic config-setup[3988]: next_version = getattr(self, version)()
Nov 8 03:30:48 sonic config-setup[3988]: AttributeError: 'DBMigrator' object has no attribute 'version_2_0_2'
Nov 8 03:30:48 sonic config-setup[3988]: AttributeError: 'DBMigrator' object has no attribute 'version_2_0_2'
Nov 8 03:30:48 sonic config-setup[3464]: 'DBMigrator' object has no attribute 'version_2_0_2'
Nov 8 03:30:48 sonic config-setup[3464]: 'DBMigrator' object has no attribute 'version_2_0_2'
Nov 8 03:30:48 sonic config-setup[3464]: usage: db_migrator.py [-h] [-o operation migrate, set_version, get_version]
Nov 8 03:30:48 sonic config-setup[3464]: usage: db_migrator.py [-h] [-o operation migrate, set_version, get_version]
Nov 8 03:30:48 sonic config-setup[3464]: [-s unix socket] [-n asic namespace]
Nov 8 03:30:48 sonic config-setup[3464]: [-s unix socket] [-n asic namespace]

Steps to reproduce the issue:

  1. ONIE install 202012
  2. Upgrade to 202205
  3. Perform config reload (to see it fails due to db_migration failure)

Describe the results you received:

DB migration fails from 202012 to 202205

Describe the results you expected:

DB migration should succeed from 202012 to 202205

Output of show version:

SONiC Software Version: SONiC.202205.56-9d7c23b85_Internal
Distribution: Debian 11.5
Kernel: 5.10.0-12-2-amd64
Build commit: 9d7c23b85
Build date: Sun Nov  6 10:58:02 UTC 2022
Built by: sw-r2d2-bot@r-build-sonic02-006

Platform: x86_64-mlnx_msn3420-r0
HwSKU: ACS-MSN3420
ASIC: mellanox
ASIC Count: 1
Serial Number: MT2012X01822
Model Number: MSN3420-CB2FO
Hardware Revision: A1
Uptime: 08:32:18 up 53 min,  1 user,  load average: 0.25, 0.15, 0.37
Date: Tue 08 Nov 2022 08:32:18

Docker images:
REPOSITORY                                         TAG                            IMAGE ID       SIZE
docker-orchagent                                   202205.56-9d7c23b85_Internal   ae366854e594   478MB
docker-orchagent                                   latest                         ae366854e594   478MB
docker-fpm-frr                                     202205.56-9d7c23b85_Internal   877eaadfcb60   489MB
docker-fpm-frr                                     latest                         877eaadfcb60   489MB
docker-teamd                                       202205.56-9d7c23b85_Internal   10b3205a723d   459MB
docker-teamd                                       latest                         10b3205a723d   459MB
docker-macsec                                      latest                         15c1a0957d3a   461MB
docker-syncd-mlnx                                  202205.56-9d7c23b85_Internal   994cc767b233   862MB
docker-syncd-mlnx                                  latest                         994cc767b233   862MB
docker-platform-monitor                            202205.56-9d7c23b85_Internal   02dc563449a7   867MB
docker-platform-monitor                            latest                         02dc563449a7   867MB
docker-dhcp-relay                                  latest                         df1210911be2   453MB
docker-snmp                                        202205.56-9d7c23b85_Internal   52bfe1fdabe8   488MB
docker-snmp                                        latest                         52bfe1fdabe8   488MB
docker-sonic-telemetry                             202205.56-9d7c23b85_Internal   7e65df200335   524MB
docker-sonic-telemetry                             latest                         7e65df200335   524MB
docker-lldp                                        202205.56-9d7c23b85_Internal   be05dd25bdd4   486MB
docker-lldp                                        latest                         be05dd25bdd4   486MB
docker-database                                    202205.56-9d7c23b85_Internal   75ac53bddd6a   443MB
docker-database                                    latest                         75ac53bddd6a   443MB
docker-mux                                         202205.56-9d7c23b85_Internal   7ac3daeee27e   492MB
docker-mux                                         latest                         7ac3daeee27e   492MB
docker-router-advertiser                           202205.56-9d7c23b85_Internal   ac52d866ddfc   443MB
docker-router-advertiser                           latest                         ac52d866ddfc   443MB
docker-nat                                         202205.56-9d7c23b85_Internal   a27a550a54fa   431MB
docker-nat                                         latest                         a27a550a54fa   431MB
docker-sflow                                       202205.56-9d7c23b85_Internal   5ccf1d66de23   429MB
docker-sflow                                       latest                         5ccf1d66de23   429MB
docker-sonic-mgmt-framework                        202205.56-9d7c23b85_Internal   19127c412439   558MB
docker-sonic-mgmt-framework                        latest                         19127c412439   558MB
urm.nvidia.com/sw-nbu-sws-sonic-docker/sonic-wjh   1.3.0-internal-25              06ae46e1ece1   643MB

Output of show techsupport:

sonic_dump_r-lionfish-07_20221108_083208.tar.gz

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

@vaibhavhd vaibhavhd self-assigned this Nov 8, 2022
@prgeor prgeor added Triaged this issue has been triaged MSFT labels Nov 9, 2022
vaibhavhd added a commit to sonic-net/sonic-utilities that referenced this issue Nov 23, 2022
Fixes sonic-net/sonic-buildimage#12643

Version on 202012 branch is missing in master and 202205 branch. This caused failures in upgrade from 202012 to newer branch images, where db_migrator experienced crash.
This commit fixes the issue, and ports the version handling for 202012 to newer branches.
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this issue Nov 23, 2022
Fixes sonic-net/sonic-buildimage#12643

Version on 202012 branch is missing in master and 202205 branch. This caused failures in upgrade from 202012 to newer branch images, where db_migrator experienced crash.
This commit fixes the issue, and ports the version handling for 202012 to newer branches.
yxieca pushed a commit to sonic-net/sonic-utilities that referenced this issue Nov 29, 2022
Fixes sonic-net/sonic-buildimage#12643

Version on 202012 branch is missing in master and 202205 branch. This caused failures in upgrade from 202012 to newer branch images, where db_migrator experienced crash.
This commit fixes the issue, and ports the version handling for 202012 to newer branches.
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this issue Dec 6, 2022
Fixes sonic-net/sonic-buildimage#12643

Version on 202012 branch is missing in master and 202205 branch. This caused failures in upgrade from 202012 to newer branch images, where db_migrator experienced crash.
This commit fixes the issue, and ports the version handling for 202012 to newer branches.
StormLiangMS pushed a commit to sonic-net/sonic-utilities that referenced this issue Dec 30, 2022
Fixes sonic-net/sonic-buildimage#12643

Version on 202012 branch is missing in master and 202205 branch. This caused failures in upgrade from 202012 to newer branch images, where db_migrator experienced crash.
This commit fixes the issue, and ports the version handling for 202012 to newer branches.
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this issue Aug 3, 2023
Fixes sonic-net/sonic-buildimage#12643

Version on 202012 branch is missing in master and 202205 branch. This caused failures in upgrade from 202012 to newer branch images, where db_migrator experienced crash.
This commit fixes the issue, and ports the version handling for 202012 to newer branches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MSFT Triaged this issue has been triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants