Skip to content

[show techsupport] fix bash errors in generate_dump script#1844

Merged
yxieca merged 1 commit intosonic-net:masterfrom
yxieca:dump
Sep 28, 2021
Merged

[show techsupport] fix bash errors in generate_dump script#1844
yxieca merged 1 commit intosonic-net:masterfrom
yxieca:dump

Conversation

@yxieca
Copy link
Copy Markdown
Contributor

@yxieca yxieca commented Sep 28, 2021

What I did

Fix: sonic-net/sonic-buildimage#8850

Issue was introduced by #1723, #1833, and #1843 (pending merge)

The error_handler is a great idea but the bash script needs to be error free first.

How I did it

Fix bash script errors.

How to verify it

run show techsupport test..

Signed-off-by: Ying Xie ying.xie@microsoft.com

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@yxieca
Copy link
Copy Markdown
Contributor Author

yxieca commented Sep 28, 2021

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

echo "${timeout_cmd} $cmd $redirect '$filepath'"
else
eval "${timeout_cmd} $cmd" "$redirect" "$filepath"
if [ $? -ne 0 ]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code looks good to me. Wondering where does it fail.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see, it can fail when there's timeout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't look deep into it. One possibility is that command timed out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you were asking what the issue with this old structure. if line 198 returns non-zero code, then it would trigger the error handling and bypass the handling at 199.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it!

Copy link
Copy Markdown
Contributor

@smaheshm smaheshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@yxieca yxieca merged commit 280dd29 into sonic-net:master Sep 28, 2021
@yxieca yxieca deleted the dump branch September 28, 2021 23:00
@qiluo-msft
Copy link
Copy Markdown
Contributor

        eval "${timeout_cmd} bash -c \"${cmds}\""

Does this line have the same issue?


Refers to: scripts/generate_dump:189 in 1bb4365. [](commit_id = 1bb4365, deletion_comment = False)

@yxieca
Copy link
Copy Markdown
Contributor Author

yxieca commented Sep 29, 2021

        eval "${timeout_cmd} bash -c \"${cmds}\""

Does this line have the same issue?

Refers to: scripts/generate_dump:189 in 1bb4365. [](commit_id = 1bb4365, deletion_comment = False)

This one didn't cause trouble in my test.

@yxieca
Copy link
Copy Markdown
Contributor Author

yxieca commented Sep 29, 2021

@qiluo-msft you are right, there are more issues in the script that didn't get caught by test but code structure also needs to be updated. This PR by itself fixes the test issue. I'll add another PR to address more code structural issues.

qiluo-msft pushed a commit that referenced this pull request Sep 29, 2021
What I did
Fix: sonic-net/sonic-buildimage#8850

Issue was introduced by #1723, #1833, and #1843 (pending merge)

The error_handler is a great idea but the bash script needs to be error free first.

How I did it
Fix bash script errors.

How to verify it
run show techsupport test..

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
vivekrnv pushed a commit to vivekrnv/sonic-utilities that referenced this pull request Oct 16, 2021
…#1844)

What I did
Fix: sonic-net/sonic-buildimage#8850

Issue was introduced by sonic-net#1723, sonic-net#1833, and sonic-net#1843 (pending merge)

The error_handler is a great idea but the bash script needs to be error free first.

How I did it
Fix bash script errors.

How to verify it
run show techsupport test..

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
praveen-li pushed a commit to praveen-li/sonic-utilities that referenced this pull request Feb 8, 2022
…#1844)

What I did
Fix: sonic-net/sonic-buildimage#8850

Issue was introduced by sonic-net#1723, sonic-net#1833, and sonic-net#1843 (pending merge)

The error_handler is a great idea but the bash script needs to be error free first.

How I did it
Fix bash script errors.

How to verify it
run show techsupport test..

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 18, 2022
* 41dfaad 2021-08-02 | Bridge mac setting, fix statedb time format (sonic-net#1844) (HEAD, origin/202012) [Prince Sunny]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 18, 2022
0b5f90b (HEAD -> 202012, origin/202012) [show techsupport] fix bash errors in generate_dump script (sonic-net#1844)
388c50c [202012][warmboot] Add new preboot health check: verify db integrity (sonic-net#1839)
d73dc98 [config] support for configuring muxcable to standby mode of operation (sonic-net#1837)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
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.

show techsupport fail when /usr/core folder not existing

3 participants