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

sonic-cfggen throws error during bootup #10807

Closed
santhosh-kt opened this issue May 11, 2022 · 3 comments
Closed

sonic-cfggen throws error during bootup #10807

santhosh-kt opened this issue May 11, 2022 · 3 comments

Comments

@santhosh-kt
Copy link
Contributor

santhosh-kt commented May 11, 2022

Description

  • DellEMC use sonic-cfggen to get the hwsku(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) for device path directory during platform initialization script.
  • But during boot-time(only), sonic-cfggen throws following error.
May 04 10:06:44 sonic z9332f_platform.sh[763]: Traceback (most recent call last):
May 04 10:06:44 sonic z9332f_platform.sh[763]:   File "/usr/local/bin/sonic-cfggen", line 451, in <module>
May 04 10:06:44 sonic z9332f_platform.sh[763]:     main()
May 04 10:06:44 sonic z9332f_platform.sh[763]:   File "/usr/local/bin/sonic-cfggen", line 304, in main
May 04 10:06:44 sonic z9332f_platform.sh[763]:     SonicDBConfig.load_sonic_db_config()
May 04 10:06:44 sonic z9332f_platform.sh[763]:   File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 1252, in load_sonic_db_config
May 04 10:06:44 sonic z9332f_platform.sh[763]:     SonicDBConfig.initialize(sonic_db_file_path)
May 04 10:06:44 sonic z9332f_platform.sh[763]:   File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 1247, in initialize
May 04 10:06:44 sonic z9332f_platform.sh[763]:     return _swsscommon.SonicDBConfig_initialize(*args, **kwargs)
May 04 10:06:44 sonic z9332f_platform.sh[763]: RuntimeError: Sonic database config file doesn't exist at /var/run/redis/sonic-db/database_config.json
  • Hence, sonic_platform package installation has failed due to missing package wheel location with device path directory.
May 04 10:06:45 sonic z9332f_platform.sh[764]: WARNING: Requirement '/usr/share/sonic/device//sonic_platform-1.0-py3-none-any.whl' looks like a filename, but the file does not exist
May 04 10:06:45 sonic z9332f_platform.sh[764]: ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/share/sonic/device/sonic_platform-1.0-py3-none-any.whl'
  • Deinit and reinit the platform initialization script installs python package.
  • But "config reload" didnot resolve the issue.

Steps to reproduce the issue:

  1. Load latest master.
  2. Run "sfputil" command and observe "No sonic_platform module error".

Describe the results you received:

Run "sfputil" command and observe "No sonic_platform module error".

root@str2-z9332f-05:~# sfputil show eeprom -d -p Ethernet0
Traceback (most recent call last):
  File "/usr/local/bin/sfputil", line 5, in <module>
    from sfputil.main import cli
  File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 17, in <module>
    import sonic_platform
ModuleNotFoundError: No module named 'sonic_platform'
root@str2-z9332f-05:~#

Describe the results you expected:

Output of show version:

root@str2-z9332f-05:~# show ver

SONiC Software Version: SONiC.master.95116-80f5d36a5
Distribution: Debian 11.3
Kernel: 5.10.0-8-2-amd64
Build commit: 80f5d36a5
Build date: Sun May  1 21:59:25 UTC 2022
Built by: AzDevOps@sonic-build-workers-001H3Q

Platform: x86_64-dellemc_z9332f_d1508-r0
HwSKU: DellEMC-Z9332f-M-O16C64
ASIC: broadcom
ASIC Count: 1
Serial Number: 2FRXCW2
Model Number: 04CN21
Hardware Revision: A01
Uptime: 20:12:23 up 38 min,  2 users,  load average: 0.84, 0.99, 1.09
Date: Tue 03 May 2022 20:12:23

Docker images:
REPOSITORY                    TAG                      IMAGE ID       SIZE
docker-syncd-brcm             latest                   e10d799b4129   785MB
docker-syncd-brcm             master.95116-80f5d36a5   e10d799b4129   785MB
docker-gbsyncd-credo          latest                   eb1429a7d912   425MB
docker-gbsyncd-credo          master.95116-80f5d36a5   eb1429a7d912   425MB
docker-macsec                 latest                   04dc373bc8c7   435MB
docker-macsec                 master.95116-80f5d36a5   04dc373bc8c7   435MB
docker-dhcp-relay             latest                   5b05d99f29ef   427MB
docker-sonic-telemetry        latest                   ed9ba2750b65   507MB
docker-sonic-telemetry        master.95116-80f5d36a5   ed9ba2750b65   507MB
docker-router-advertiser      latest                   5be5289635a4   417MB
docker-router-advertiser      master.95116-80f5d36a5   5be5289635a4   417MB
docker-mux                    latest                   9ae2d2e2073a   466MB
docker-mux                    master.95116-80f5d36a5   9ae2d2e2073a   466MB
docker-database               latest                   4cb172ab2055   417MB
docker-database               master.95116-80f5d36a5   4cb172ab2055   417MB
docker-orchagent              latest                   b6bda057fac5   439MB
docker-orchagent              master.95116-80f5d36a5   b6bda057fac5   439MB
docker-sflow                  latest                   bba0eb2b1116   421MB
docker-sflow                  master.95116-80f5d36a5   bba0eb2b1116   421MB
docker-fpm-frr                latest                   0816b7b7a31e   439MB
docker-fpm-frr                master.95116-80f5d36a5   0816b7b7a31e   439MB
docker-nat                    latest                   340c74228f45   423MB
docker-nat                    master.95116-80f5d36a5   340c74228f45   423MB
docker-teamd                  latest                   5f06591981a9   420MB
docker-teamd                  master.95116-80f5d36a5   5f06591981a9   420MB
docker-sonic-mgmt-framework   latest                   517bc70efff7   550MB
docker-sonic-mgmt-framework   master.95116-80f5d36a5   517bc70efff7   550MB
docker-snmp                   latest                   d7e35ce1daf1   449MB
docker-snmp                   master.95116-80f5d36a5   d7e35ce1daf1   449MB
docker-platform-monitor       latest                   6f19baa7195d   519MB
docker-platform-monitor       master.95116-80f5d36a5   6f19baa7195d   519MB
docker-lldp                   latest                   28f3d8c33139   446MB
docker-lldp                   master.95116-80f5d36a5   28f3d8c33139   446MB

root@str2-z9332f-05:~#

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

@santhosh-kt
Copy link
Contributor Author

This change happen due to the following PR #10581 and the above issue is not seen without this change.

@zhangyanzhao
Copy link
Collaborator

PR 10581 was reverted, please retry.

@lguohan
Copy link
Collaborator

lguohan commented May 11, 2022

revert pr #10756

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

3 participants