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

Add role field to the ztp PORT config #57

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

vivekrnv
Copy link
Contributor

Factory installation of SONiC on a Smartswitch with ZTP enabled is causing xcvrd to crash

Jul  5 07:51:38.074836 smartswitch1 ERR pmon#xcvrd: Exception occured at SfpStateUpdateTask thread due to AttributeError("'NoneType' object has no attribute 'get_presence'")
Jul  5 07:51:38.077516 smartswitch1 ERR pmon#xcvrd: Traceback (most recent call last):
Jul  5 07:51:38.077516 smartswitch1 ERR pmon#xcvrd:   File "/usr/local/lib/python3.11/dist-packages/xcvrd/xcvrd.py", line 2195, in run
Jul  5 07:51:38.077516 smartswitch1 ERR pmon#xcvrd:     self.task_worker(self.task_stopping_event, self.sfp_error_event)
Jul  5 07:51:38.077516 smartswitch1 ERR pmon#xcvrd:   File "/usr/local/lib/python3.11/dist-packages/xcvrd/xcvrd.py", line 2005, in task_worker
Jul  5 07:51:38.077516 smartswitch1 ERR pmon#xcvrd:     self.init()
Jul  5 07:51:38.077556 smartswitch1 ERR pmon#xcvrd:   File "/usr/local/lib/python3.11/dist-packages/xcvrd/xcvrd.py", line 1923, in init
Jul  5 07:51:38.077586 smartswitch1 ERR pmon#xcvrd:     self.retry_eeprom_set = self._post_port_sfp_info_and_dom_thr_to_db_once(port_mapping_data, self.xcvr_table_helper, self.main_thread_stop_event)
Jul  5 07:51:38.077586 smartswitch1 ERR pmon#xcvrd:                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul  5 07:51:38.077586 smartswitch1 ERR pmon#xcvrd:   File "/usr/local/lib/python3.11/dist-packages/xcvrd/xcvrd.py", line 1878, in _post_port_sfp_info_and_dom_thr_to_db_once
Jul  5 07:51:38.077636 smartswitch1 ERR pmon#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  5 07:51:38.077735 smartswitch1 ERR pmon#xcvrd:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul  5 07:51:38.077735 smartswitch1 ERR pmon#xcvrd:   File "/usr/local/lib/python3.11/dist-packages/xcvrd/xcvrd.py", line 435, in post_port_sfp_info_to_db
Jul  5 07:51:38.077735 smartswitch1 ERR pmon#xcvrd:     if not _wrapper_get_presence(physical_port):
Jul  5 07:51:38.077735 smartswitch1 ERR pmon#xcvrd:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul  5 07:51:38.077770 smartswitch1 ERR pmon#xcvrd:   File "/usr/local/lib/python3.11/dist-packages/xcvrd/xcvrd.py", line 245, in _wrapper_get_presence
Jul  5 07:51:38.077786 smartswitch1 ERR pmon#xcvrd:     return platform_chassis.get_sfp(physical_port).get_presence()
Jul  5 07:51:38.077786 smartswitch1 ERR pmon#xcvrd:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul  5 07:51:38.077831 smartswitch1 ERR pmon#xcvrd: AttributeError: 'NoneType' object has no attribute 'get_presence'
Jul  5 07:51:38.077881 smartswitch1 ERR pmon#xcvrd: Xcvrd: exception found at child thread SfpStateUpdateTask due to AttributeError("'NoneType' object has no attribute 'get_presence'")
Jul  5 07:51:38.077881 smartswitch1 ERR pmon#xcvrd: Exiting main loop as child thread raised exception!
Jul  5 07:51:39.144465 smartswitch1 INFO pmon#supervisord 2024-07-05 07:51:39,143 WARN exited: xcvrd (terminated by SIGKILL; not expected)

This is because role is a mandatory attribute for the internal ports of a smartswitch.

Even though we override the config later, xcvrd crash should be avoided

@vivekrnv
Copy link
Contributor Author

@rajendra-dendukuri Please review.

@vivekrnv
Copy link
Contributor Author

Request for 202405

@rajendra-dendukuri rajendra-dendukuri merged commit b4cdd8c into sonic-net:master Jul 18, 2024
4 checks passed
@vivekrnv vivekrnv deleted the add_role_cfg branch July 18, 2024 04:22
@vivekrnv
Copy link
Contributor Author

@rajendra-dendukuri Can we backport this to 202405?

@dgsudharsan
Copy link
Contributor

@bingwang-ms Can you please help to cherry-pick for 202405?

@dgsudharsan
Copy link
Contributor

@bingwang-ms Reminder to add this fix for 202405

@dgsudharsan
Copy link
Contributor

@bingwang-ms Looks like you added Approved rather than request label. I don't see the fix in 202405. Can you please check?

@dprital
Copy link

dprital commented Sep 16, 2024

@bingwang-ms This PR was not merged yet to 202405. Can you please handle ?

@bingwang-ms
Copy link

Seems the automation was not working for this repo. I re-added the label for cherry-pick

@mssonicbld
Copy link

Cherry-pick PR to 202405: #61

bingwang-ms added a commit that referenced this pull request Nov 1, 2024
[action] [PR:57] Add role field to the ztp PORT config (#57)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants