sonic-platform-common icon indicating copy to clipboard operation
sonic-platform-common copied to clipboard

[xcvr] xcvrd would dead when cable_type is None

Open chiourung opened this issue 3 years ago • 3 comments

Description

swsscommon.FieldValuePairs can't accept None and cause xcvrd dead.

Signed-off-by: chiourung_huang [email protected]

Motivation and Context

How Has This Been Tested?

Additional Information (Optional)

chiourung avatar Jul 06 '22 05:07 chiourung

@chiourung could add more details to what is this crash? Can you attach backtrace of the crash?

prgeor avatar Jul 12 '22 21:07 prgeor

@chiourung could add more details to what is this crash? Can you attach backtrace of the crash?

For xcvrd, it would enter line 401

        except NotImplementedError:
            helper_logger.log_error("This functionality is currently not implemented for this platform")
            sys.exit(NOT_IMPLEMENTED_ERROR)

There is no backtrace.

After modify xcvrd.py, the backtrace is:

Jul 13 11:44:53.725061 sonic INFO pmon#/supervisord: xcvrd Traceback (most recent call last):
Jul 13 11:44:53.725061 sonic INFO pmon#/supervisord: xcvrd   File "/usr/local/bin/xcvrd", line 8, in <module>
Jul 13 11:44:53.725061 sonic INFO pmon#/supervisord: xcvrd     sys.exit(main())
Jul 13 11:44:53.725061 sonic INFO pmon#/supervisord: xcvrd   File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 2369, in main
Jul 13 11:44:53.725108 sonic INFO pmon#/supervisord: xcvrd     xcvrd.run()
Jul 13 11:44:53.725150 sonic INFO pmon#/supervisord: xcvrd   File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 2284, in run
Jul 13 11:44:53.725150 sonic INFO pmon#/supervisord: xcvrd     port_mapping_data, retry_eeprom_set = self.init()
Jul 13 11:44:53.725211 sonic INFO pmon#/supervisord: xcvrd   File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 2244, in init
Jul 13 11:44:53.725211 sonic INFO pmon#/supervisord: xcvrd     retry_eeprom_set = post_port_sfp_dom_info_to_db(is_warm_start, port_mapping_data, self.stop_event)
Jul 13 11:44:53.725253 sonic INFO pmon#/supervisord: xcvrd   File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 687, in post_port_sfp_dom_info_to_db
Jul 13 11:44:53.725253 sonic INFO pmon#/supervisord: xcvrd     rc = post_port_sfp_info_to_db(logical_port_name, port_mapping, xcvr_table_helper.get_intf_tbl(asic_index), transceiver_dict, stop_event)
Jul 13 11:44:53.725296 sonic INFO pmon#/supervisord: xcvrd   File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 486, in post_port_sfp_info_to_db
Jul 13 11:44:53.725313 sonic INFO pmon#/supervisord: xcvrd     if 'dom_capability' in port_info_dict else 'N/A')
Jul 13 11:44:53.725378 sonic INFO pmon#/supervisord: xcvrd   File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 282, in __init__
Jul 13 11:44:53.725378 sonic INFO pmon#/supervisord: xcvrd     this = _swsscommon.new_FieldValuePairs(*args)
Jul 13 11:44:53.725413 sonic INFO pmon#/supervisord: xcvrd NotImplementedError: Wrong number or type of arguments for overloaded function 'new_FieldValuePairs'.
Jul 13 11:44:53.725429 sonic INFO pmon#/supervisord: xcvrd   Possible C/C++ prototypes are:
Jul 13 11:44:53.725462 sonic INFO pmon#/supervisord: xcvrd     std::vector< std::pair< std::string,std::string > >::vector()
Jul 13 11:44:53.725462 sonic INFO pmon#/supervisord: xcvrd     std::vector< std::pair< std::string,std::string > >::vector(std::vector< std::pair< std::string,std::string > > const &)
Jul 13 11:44:53.725490 sonic INFO pmon#/supervisord: xcvrd     std::vector< std::pair< std::string,std::string > >::vector(std::vector< std::pair< std::string,std::string > >::size_type)
Jul 13 11:44:53.725534 sonic INFO pmon#/supervisord: xcvrd     std::vector< std::pair< std::string,std::string > >::vector(std::vector< std::pair< std::string,std::string > >::size_type,std::vector< std::pair< std::string,std::string > >::value_type const &)

chiourung avatar Jul 13 '22 03:07 chiourung

/easycla

chiourung avatar Aug 10 '22 02:08 chiourung