-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[reboot-cause] Fixed determine-reboot-cause.service failure. #8210
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Rajkumar Pennadam Ramamoorthy <rpennadamram@marvell.com>
retest please |
@sujinmkang , can you take a look? |
this looks like a general change (non platform related), need to understand if this is really necessary or not. |
sujinmkang
approved these changes
Jul 26, 2021
sujinmkang
approved these changes
Jul 26, 2021
@sujinmkang , is this a bug? do we need to back port? is there unit test for this? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@lguohan I will check whether the logic is broken or not again. We have unit test for this code but this was missed as one corner case. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
sujinmkang
approved these changes
Aug 10, 2021
qiluo-msft
pushed a commit
that referenced
this pull request
Aug 12, 2021
Signed-off-by: Rajkumar Pennadam Ramamoorthy rpennadamram@marvell.com Why I did it Install sonic image from ONIE. Once system is up, execute "config reload" command. Root cause is that "determine-reboot-cause.service" was in failed state. root@sonic:/host/reboot-cause# systemctl list-units --failed UNIT LOAD ACTIVE SUB DESCRIPTION ● determine-reboot-cause.service loaded failed failed Reboot cause determination service How I did it Fixed the issue by setting default reason to "REBOOT_CAUSE_UNKNOWN" instead of "None". How to verify it Check " determine-reboot-cause.service' loaded successfully post image installation from ONIE. Verify "reboot-cause.txt" file is created and config reload succeeds.
judyjoseph
pushed a commit
that referenced
this pull request
Aug 25, 2021
Signed-off-by: Rajkumar Pennadam Ramamoorthy rpennadamram@marvell.com Why I did it Install sonic image from ONIE. Once system is up, execute "config reload" command. Root cause is that "determine-reboot-cause.service" was in failed state. root@sonic:/host/reboot-cause# systemctl list-units --failed UNIT LOAD ACTIVE SUB DESCRIPTION ● determine-reboot-cause.service loaded failed failed Reboot cause determination service How I did it Fixed the issue by setting default reason to "REBOOT_CAUSE_UNKNOWN" instead of "None". How to verify it Check " determine-reboot-cause.service' loaded successfully post image installation from ONIE. Verify "reboot-cause.txt" file is created and config reload succeeds.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Rajkumar Pennadam Ramamoorthy rpennadamram@marvell.com
Why I did it
Install sonic image from ONIE. Once system is up, execute "config reload" command.
Root cause is that "determine-reboot-cause.service" was in failed state.
root@sonic:/host/reboot-cause# systemctl list-units --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● determine-reboot-cause.service loaded failed failed Reboot cause determination service
"determine-reboot-cause" script fails with below error.
Jun 17 10:52:13 sonic chassis: Platform api returns reboot cause Non-Hardware, None
Jun 17 10:52:13 sonic chassis: Platform api returns reboot cause Non-Hardware, None
Jun 17 10:52:13 sonic chassis: Platform api indicates reboot cause Non-Hardware
Jun 17 10:52:13 sonic chassis: Reboot cause file /host/reboot-cause/reboot-cause.txt not found
Jun 17 10:52:13 sonic chassis: Platform api indicates reboot cause Non-Hardware
Jun 17 10:52:13 sonic chassis: Reboot cause file /host/reboot-cause/reboot-cause.txt not found
Jun 17 10:52:13 sonic determine-reboot-cause[564]: Traceback (most recent call last):
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/local/bin/determine-reboot-cause", line 228, in
Jun 17 10:52:13 sonic determine-reboot-cause[564]: main()
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/local/bin/determine-reboot-cause", line 201, in main
Jun 17 10:52:13 sonic determine-reboot-cause[564]: reboot_cause_dict = get_reboot_cause_dict(previous_reboot_cause, additional_reboot_info, reboot_cause_gen_time)
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/local/bin/determine-reboot-cause", line 146, in get_reboot_cause_dict
Jun 17 10:52:13 sonic determine-reboot-cause[564]: if re.search(r'User issued', previous_reboot_cause):
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/lib/python3.7/re.py", line 183, in search
Jun 17 10:52:13 sonic determine-reboot-cause[564]: return _compile(pattern, flags).search(string)
Jun 17 10:52:13 sonic determine-reboot-cause[564]: TypeError: expected string or bytes-like object
Jun 17 10:52:13 sonic determine-reboot-cause[564]: Traceback (most recent call last):
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/local/bin/determine-reboot-cause", line 228, in
Jun 17 10:52:13 sonic determine-reboot-cause[564]: main()
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/local/bin/determine-reboot-cause", line 201, in main
Jun 17 10:52:13 sonic determine-reboot-cause[564]: reboot_cause_dict = get_reboot_cause_dict(previous_reboot_cause, additional_reboot_info, reboot_cause_gen_time)
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/local/bin/determine-reboot-cause", line 146, in get_reboot_cause_dict
Jun 17 10:52:13 sonic determine-reboot-cause[564]: if re.search(r'User issued', previous_reboot_cause):
Jun 17 10:52:13 sonic determine-reboot-cause[564]: File "/usr/lib/python3.7/re.py", line 183, in search
Jun 17 10:52:13 sonic determine-reboot-cause[564]: return _compile(pattern, flags).search(string)
Jun 17 10:52:13 sonic determine-reboot-cause[564]: TypeError: expected string or bytes-like object
Jun 17 10:52:13 sonic systemd[1]: determine-reboot-cause.service: Main process exited, code=exited, status=1/FAILURE
Jun 17 10:52:13 sonic systemd[1]: determine-reboot-cause.service: Failed with result 'exit-code'.
Jun 17 10:52:13 sonic systemd[1]: determine-reboot-cause.service: Main process exited, code=exited, status=1/FAILURE
Jun 17 10:52:13 sonic systemd[1]: determine-reboot-cause.service: Failed with result 'exit-code'.
How I did it
Fixed the issue by setting default reason to "REBOOT_CAUSE_UNKNOWN" instead of "None".
How to verify it
Check " determine-reboot-cause.service' loaded successfully post image installation from ONIE.
Verify "reboot-cause.txt" file is created and config reload succeeds.
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)