-
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
handle json load exception in bgpmon #17856
Merged
StormLiangMS
merged 2 commits into
sonic-net:master
from
lipxu:20240119_public_handle_json_exception_in_bgpmon
Jan 29, 2024
Merged
handle json load exception in bgpmon #17856
StormLiangMS
merged 2 commits into
sonic-net:master
from
lipxu:20240119_public_handle_json_exception_in_bgpmon
Jan 29, 2024
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: xuliping <xuliping@microsoft.com>
Signed-off-by: xuliping <xuliping@microsoft.com>
StormLiangMS
approved these changes
Jan 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mssonicbld
pushed a commit
to mssonicbld/sonic-buildimage
that referenced
this pull request
Feb 2, 2024
Why I did it ICM reported due to "BGPMon Process exited" which was caused by json load exception. Work item tracking Microsoft ADO (number only): 25916773 How I did it Add an exception handle during json load. How to verify it Verified locally, add debug log to modify the output string of cmd to make it not with json formation, then check the syslog.
Cherry-pick PR to 202311: #18005 |
mssonicbld
pushed a commit
that referenced
this pull request
Feb 3, 2024
Why I did it ICM reported due to "BGPMon Process exited" which was caused by json load exception. Work item tracking Microsoft ADO (number only): 25916773 How I did it Add an exception handle during json load. How to verify it Verified locally, add debug log to modify the output string of cmd to make it not with json formation, then check the syslog.
yxieca
added
Included in 202311 Branch
and removed
Approved for 202311 Branch
Created PR to 202311 Branch
labels
Feb 16, 2024
mssonicbld
pushed a commit
to mssonicbld/sonic-buildimage
that referenced
this pull request
Feb 24, 2024
Why I did it ICM reported due to "BGPMon Process exited" which was caused by json load exception. Work item tracking Microsoft ADO (number only): 25916773 How I did it Add an exception handle during json load. How to verify it Verified locally, add debug log to modify the output string of cmd to make it not with json formation, then check the syslog.
Cherry-pick PR to 202305: #18173 |
mssonicbld
pushed a commit
that referenced
this pull request
Feb 26, 2024
Why I did it ICM reported due to "BGPMon Process exited" which was caused by json load exception. Work item tracking Microsoft ADO (number only): 25916773 How I did it Add an exception handle during json load. How to verify it Verified locally, add debug log to modify the output string of cmd to make it not with json formation, then check the syslog.
mssonicbld
added
Included in 202305 Branch
and removed
Created PR to 202305 Branch
labels
Feb 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why I did it
ICM reported due to "BGPMon Process exited" which was caused by json load exception.
Work item tracking
25916773
How I did it
Add an exception handle during json load.
How to verify it
Verified locally, add debug log to modify the output string of cmd to make it not with json formation, then check the syslog.
Jan 19 03:09:56.275058 str3-7060-acs-1 INFO tmp.py: bgpmon service started
Jan 19 03:09:56.571696 str3-7060-acs-1 WARNING tmp.py: WARNING JSONDecodeError: Expecting ':' delimiter: line 109 column 12 (char 2203) when execute: ['vtysh', '-c', 'show bgp summary json'] Retry attempt: 1
Jan 19 03:09:57.891086 str3-7060-acs-1 WARNING tmp.py: WARNING JSONDecodeError: Expecting ':' delimiter: line 109 column 12 (char 2203) when execute: ['vtysh', '-c', 'show bgp summary json'] Retry attempt: 2
Jan 19 03:09:59.229662 str3-7060-acs-1 WARNING tmp.py: WARNING JSONDecodeError: Expecting ':' delimiter: line 109 column 12 (char 2203) when execute: ['vtysh', '-c', 'show bgp summary json'] Retry attempt: 3
Jan 19 03:10:00.231532 str3-7060-acs-1 ERR tmp.py: ERROR Maximum retry attempts reached. Failed to execute: ['vtysh', '-c', 'show bgp summary json'] Output: {#12"ipv4Unicast":{#12 "routerId":"10.1.0.32{#12"ipv4Unicast":{#12 "routerId":"10.1.0.32",#12 "as":65100,#12 "vrfId":0,#12 "vrfName":"default",#12 "tableVersion":6,#12 "ribCount":3,#12 "ribMemory":576,#12 "peerCount":4,#12 "peerMemory":2967904,#12 "peerGroupCount":4,#12 "peerGroupMemory":256,#12 "peers":{#12 "10.0.0.57":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA01T1",#12 "idType":"ipv4"#12 },#12 "10.0.0.59":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA02T1",#12 "idType":"ipv4"#12 },#12 "10.0.0.61":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA03T1",#12 "idType":"ipv4"#12 },#12 "10.0.0.63":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA04T1",#12 "idType":"ipv4"#12 }#12 },#12 "failedPeers":4,#12 "displayedPeers":4,#12 "totalPeers":4,#12 "dynamicPeers":0,#12 "bestPath":{#12 "multiPathRelax":"true"#12 }#12}#12,#12"ipv6Unicast":{#12 "routerId":"10.1.0.32",#12 "as":65100,#12 "vrfId":0,#12 "vrfName"error"default",#12 "tableVersion":6,#12 "ribCount":3,#12 "ribMemory":576,#12 "peerCount":4,#12 "peerMemory":2967904,#12 "peerGroupCount":4,#12 "peerGroupMemory":256,#12 "peers":{#12 "fc00::72":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA01T1",#12 "idType":"ipv6"#12 },#12 "fc00::76":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA02T1",#12 "idType":"ipv6"#12 },#12 "fc00::7a":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA03T1",#12 "idType":"ipv6"#12 },#12 "fc00::7e":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA04T1",#12 "idType":"ipv6"#12 }#12 },#12 "failedPeers":4,#12 "displayedPeers":4,#12 "totalPeers":4,#12 "dynamicPeers":0,#12 "bestPath":{#12 "multiPathRelax":"true"#12 }#12}#12}",#12 "as":65100,#12 "vrfId":0,#12 "vrfName":"default",#12 "tableVersion":6,#12 "ribCount":3,#12 "ribMemory":576,#12 "peerCount":4,#12 "peerMemory":2967904,#12 "peerGroupCount":4,#12 "peerGroupMemory":256,#12 "peers":{#12 "10.0.0.57":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA01T1",#12 "idType":"ipv4"#12 },#12 "10.0.0.59":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA02T1",#12 "idType":"ipv4"#12 },#12 "10.0.0.61":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA03T1",#12 "idType":"ipv4"#12 },#12 "10.0.0.63":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA04T1",#12 "idType":"ipv4"#12 }#12 },#12 "failedPeers":4,#12 "displayedPeers":4,#12 "totalPeers":4,#12 "dynamicPeers":0,#12 "bestPath":{#12 "multiPathRelax":"true"#12 }#12}#12,#12"ipv6Unicast":{#12 "routerId":"10.1.0.32",#12 "as":65100,#12 "vrfId":0,#12 "vrfName"error"default",#12 "tableVersion":6,#12 "ribCount":3,#12 "ribMemory":576,#12 "peerCount":4,#12 "peerMemory":2967904,#12 "peerGroupCount":4,#12 "peerGroupMemory":256,#12 "peers":{#12 "fc00::72":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA01T1",#12 "idType":"ipv6"#12 },#12 "fc00::76":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA02T1",#12 "idType":"ipv6"#12 },#12 "fc00::7a":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA03T1",#12 "idType":"ipv6"#12 },#12 "fc00::7e":{#12 "remoteAs":64600,#12 "localAs":65100,#12 "version":4,#12 "msgRcvd":0,#12 "msgSent":0,#12 "tableVersion":0,#12 "outq":0,#12 "inq":0,#12 "peerUptime":"never",#12 "peerUptimeMsec":0,#12 "pfxRcd":0,#12 "pfxSnt":0,#12 "state":"Active",#12 "peerState":"OK",#12 "connectionsEstablished":0,#12 "connectionsDropped":0,#12 "desc":"ARISTA04T1",#12 "idType":"ipv6"#12 }#12 },#12 "failedPeers":4,#12 "displayedPeers":4,#12 "totalPeers":4,#12 "dynamicPeers":0,#12 "bestPath":{#12 "multiPathRelax":"true"#12 }#12}#12}
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)