sonic-swss icon indicating copy to clipboard operation
sonic-swss copied to clipboard

DVS: syncd and swss are not up when fake platform using hwsku (DVS_ENV = ["HWSKU=XXXX"]) for non-Mellanox

Open rck-innovium opened this issue 1 year ago • 0 comments

Today, some Mellanox platform dependent DVS tests are run using DVS_ENV = ["HWSKU=Mellanox-SN2700"].

When I try to fake other platforms, /usr/bin/start.sh fails to start syncd and swss due to missing files or config.

  1. Error when faking DVS_ENV = ["HWSKU=Wistron_sw_to3200k_32x100"] The sonic-cfggen step in start.sh, when rendering swss_vars.j2, fails since DEVICE_METADATA is not present. The causes both syncd and swss to not start.
May 17 12:19:00.952527 e61735a60cee INFO #update_chassisdb_config: remove chassis_db from config file /var/run/redis/sonic-db/database_config.json.tmp
May 17 12:19:01.614916 e61735a60cee INFO #supervisord 2023-05-17 12:19:01,613 INFO spawned: 'syncd' with pid 316
May 17 12:19:02.089526 e61735a60cee INFO #supervisord: syncd Traceback (most recent call last):
May 17 12:19:02.089579 e61735a60cee INFO #supervisord: syncd   File "/usr/local/bin/sonic-cfggen", line 452, in <module>
May 17 12:19:02.090335 e61735a60cee INFO #supervisord: syncd     main()
May 17 12:19:02.090502 e61735a60cee INFO #supervisord: syncd   File "/usr/local/bin/sonic-cfggen", line 416, in main
May 17 12:19:02.090587 e61735a60cee INFO #supervisord: syncd     template_data = template.render(data)
May 17 12:19:02.090672 e61735a60cee INFO #supervisord: syncd   File "/usr/local/lib/python3.9/dist-packages/jinja2/environment.py", line 1301, in render
May 17 12:19:02.090806 e61735a60cee INFO #supervisord: syncd     self.environment.handle_exception()
May 17 12:19:02.090882 e61735a60cee INFO #supervisord: syncd   File "/usr/local/lib/python3.9/dist-packages/jinja2/environment.py", line 936, in handle_exception
May 17 12:19:02.091639 e61735a60cee INFO #supervisord: syncd     raise rewrite_traceback_stack(source=source)
May 17 12:19:02.091779 e61735a60cee INFO #supervisord: syncd   File "/usr/share/sonic/templates/swss_vars.j2", line 6, in top-level template code
May 17 12:19:02.091859 e61735a60cee INFO #supervisord: syncd     "asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}",
May 17 12:19:02.091935 e61735a60cee INFO #supervisord: syncd   File "/usr/local/lib/python3.9/dist-packages/jinja2/environment.py", line 485, in getattr
May 17 12:19:02.092014 e61735a60cee INFO #supervisord: syncd     return getattr(obj, attribute)
May 17 12:19:02.092086 e61735a60cee INFO #supervisord: syncd jinja2.exceptions.UndefinedError: 'DEVICE_METADATA' is undefined
May 17 12:19:02.148171 e61735a60cee INFO #supervisord 2023-05-17 12:19:02,147 INFO exited: syncd (exit status 1; not expected)

============
Similar error for Orchagent:

May 17 12:19:04.371955 e61735a60cee INFO #supervisord: orchagent   File "/usr/share/sonic/templates/swss_vars.j2", line 6, in top-level template code
May 17 12:19:04.372012 e61735a60cee INFO #supervisord: orchagent     "asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}",
May 17 12:19:04.372065 e61735a60cee INFO #supervisord: orchagent   File "/usr/local/lib/python3.9/dist-packages/jinja2/environment.py", line 485, in getattr
May 17 12:19:04.372117 e61735a60cee INFO #supervisord: orchagent     return getattr(obj, attribute)
May 17 12:19:04.372168 e61735a60cee INFO #supervisord: orchagent jinja2.exceptions.UndefinedError: 'DEVICE_METADATA' is undefined
May 17 12:19:04.429441 e61735a60cee INFO #supervisord 2023-05-17 12:19:04,428 INFO exited: orchagent (exit status 1; not expected


  1. Errors seen when DVS_ENV = ["HWSKU=db98cx8580_32cd"]
+ sonic-cfggen -k db98cx8580_32cd -p /usr/share/sonic/device/x86_64-kvm_x86_64-r0/platform.json -t /usr/share/sonic/hwsku/buffers.json.j2
Traceback (most recent call last):
  File "/usr/local/bin/sonic-cfggen", line 452, in <module>
    main()
  File "/usr/local/bin/sonic-cfggen", line 318, in main
    brkout_table = get_breakout_mode(hwsku, platform, args.port_config)
  File "/usr/local/lib/python3.9/dist-packages/portconfig.py", line 379, in get_breakout_mode
    raise Exception("'hwsku_json' file does not exist!!! This file is necessary to proceed forward.")
Exception: 'hwsku_json' file does not exist!!! This file is necessary to proceed forward.
+ sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2
+ sonic-cfggen -p /usr/share/sonic/device/x86_64-kvm_x86_64-r0/platform.json -k db98cx8580_32cd --print-data
Traceback (most recent call last):
  File "/usr/local/bin/sonic-cfggen", line 452, in <module>
    main()
  File "/usr/local/bin/sonic-cfggen", line 318, in main
    brkout_table = get_breakout_mode(hwsku, platform, args.port_config)
  File "/usr/local/lib/python3.9/dist-packages/portconfig.py", line 379, in get_breakout_mode
    raise Exception("'hwsku_json' file does not exist!!! This file is necessary to proceed forward.")
Exception: 'hwsku_json' file does not exist!!! This file is necessary to proceed forward.

rck-innovium avatar May 17 '23 19:05 rck-innovium