Skip to content

sudo intfstat -j has traceback on latest master image #14089

@ZhaohuiS

Description

@ZhaohuiS

Description

sudo intfstat -j has traceback on latest master image, but without sudo, it can be parsed correctly.

dmin@str-msn2700-01:~$ sudo intfstat -j
Traceback (most recent call last):
  File "/usr/local/bin/intfstat", line 364, in <module>
    main()
  File "/usr/local/bin/intfstat", line 333, in main
    cnstat_cached_dict = json.load(open(cnstat_fqn_file, 'r'))
  File "/usr/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 10 (char 9)
admin@str-msn2700-01:~$ intfstat -j
{
    "PortChannel101": {
        "RX_BPS": "105.87 B/s",
        "RX_ERR": "6",
        "RX_OK": "1027",
        "RX_PPS": "1.46/s",
        "TX_BPS": "0.00 B/s",
        "TX_ERR": "0",
        "TX_OK": "0",
        "TX_PPS": "0.00/s"
    },
    "PortChannel102": {
        "RX_BPS": "88.76 B/s",
        "RX_ERR": "1010",
        "RX_OK": "868",
        "RX_PPS": "1.13/s",
        "TX_BPS": "0.00 B/s",
        "TX_ERR": "0",
        "TX_OK": "0",
        "TX_PPS": "0.00/s"
    },
    "PortChannel103": {
        "RX_BPS": "108.31 B/s",
        "RX_ERR": "8",
        "RX_OK": "991",
        "RX_PPS": "1.49/s",
        "TX_BPS": "0.00 B/s",
        "TX_ERR": "0",
        "TX_OK": "0",
        "TX_PPS": "0.00/s"
    },
    "PortChannel104": {
        "RX_BPS": "105.87 B/s",
        "RX_ERR": "10",
        "RX_OK": "992",
        "RX_PPS": "1.46/s",
        "TX_BPS": "0.00 B/s",
        "TX_ERR": "0",
        "TX_OK": "0",
        "TX_PPS": "0.00/s"
    },
    "Vlan1000": {
        "RX_BPS": "0.00 B/s",
        "RX_ERR": "24",
        "RX_OK": "96",
        "RX_PPS": "0.00/s",
        "TX_BPS": "0.00 B/s",
        "TX_ERR": "0",
        "TX_OK": "0",
        "TX_PPS": "0.00/s"
    }
}

Steps to reproduce the issue:

  1. Load master image
  2. run test_drop_counters.py which is in sonic-mgmt repo.

Describe the results you received:

Describe the results you expected:

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

Metadata

Metadata

Assignees

Labels

MSFTTriagedthis issue has been triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions