Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[202012][db-migrator] Fix hwsku match for 6100 and add errors when hw…
…sku is None (#2896) Cherry pick of #2821 MSFT ADO: 17972494 Fix errors in db migration when hwsku is not detected. This PR is adds a better-error-handling fix for the issue that is fixed by: sonic-net/sonic-buildimage#14933 May 2 20:35:04 sonic database.sh[649]: Creating new database container May 2 20:35:04 sonic database.sh[663]: 99e8edba01ed0c7581f0d61dd2fa78374fa4f23e636a957004dd03a6f68eea86 May 2 20:35:04 sonic root: Starting database service... May 2 20:35:06 sonic database.sh[690]: database May 2 20:35:10 sonic database.sh[926]: True May 2 20:35:10 sonic database.sh[928]: File "/usr/local/bin/db_migrator.py", line 714, in common_migration_ops May 2 20:35:10 sonic database.sh[928]: File "/usr/local/bin/db_migrator.py", line 741, in migrate May 2 20:35:10 sonic database.sh[928]: File "/usr/local/bin/db_migrator.py", line 782, in main May 2 20:35:10 sonic database.sh[928]: Traceback (most recent call last): May 2 20:35:10 sonic database.sh[928]: TypeError: argument of type 'NoneType' is not iterable May 2 20:35:10 sonic database.sh[928]: argument of type 'NoneType' is not iterable May 2 20:35:10 sonic database.sh[928]: optional arguments: May 2 20:35:10 sonic database.sh[928]: usage: db_migrator.py [-h] [-o operation migrate, set_version, get_version] May 2 20:35:10 sonic db_migrator: :- operator(): DB '{APPL_DB}' is empty with pattern 'COPP_TABLE:*'! May 2 20:35:10 sonic db_migrator: :- operator(): DB '{APPL_DB}' is empty with pattern 'INTF_TABLE:*'! May 2 20:35:10 sonic db_migrator: :- operator(): Key 'BUFFER_MAX_PARAM_TABLE|global' field 'mmu_size' unavailable in database 'STATE_DB' May 2 20:35:10 sonic db_migrator: :- operator(): Key 'WARM_RESTART_ENABLE_TABLE|system' field 'enable' unavailable in database 'STATE_DB' May 2 20:35:10 sonic db_migrator: Caught exception: argument of type 'NoneType' is not iterable May 2 20:35:11 sonic config-setup[935]: Copying SONiC configuration minigraph.xml ... May 2 20:35:11 sonic config-setup[935]: Reloading minigraph... May 2 20:35:11 sonic config-setup[935]: Use minigraph.xml from old system... May 2 20:35:11 sonic root: Started database service... How I did it Convert hwsku's type to str before checking substring. Add error logs when hwsku and asic type information is not obtained. How to verify it Tested on a physical device
- Loading branch information