Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1989591

Summary: invalid json output from tc filter
Product: Red Hat Enterprise Linux 8 Reporter: Nate Straz <nstraz>
Component: iprouteAssignee: Wen Liang <wenliang>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: aclaudi, jiji, network-qe, wenliang
Target Milestone: betaKeywords: Triaged
Target Release: 8.6Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iproute-5.15.0-3.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:23:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nate Straz 2021-08-03 14:05:52 UTC
Description of problem:

The json output from some tc filter commands is not parsable.

# DEV=ens3
# tc qdisc add dev $DEV root handle 1: htb
# tc filter add dev $DEV parent 1: u32 match mark 80586 0xffffffff action ok
# tc -j filter show dev $DEV
[{"parent":"1:","protocol":"all","pref":49152,"kind":"u32","chain":0},{"parent":"1:","protocol":"all","pref":49152,"kind":"u32","chain":0,"options":{fh 800: ht divisor 1 }},{"parent":"1:","protocol":"all","pref":49152,"kind":"u32","chain":0,"options":{fh 800::800 order 2048 key ht 800 bkt 0 terminal flowid ??? not_in_hw 
  mark 0x13aca 0xffffffff (success 0)"actions":[{"order":1,"kind":"gact","control_action":{"type":"pass"},"prob":{"random_type":"none","control_action":{"type":"pass"},"val":0},"index":1,"ref":1,"bind":1}]}}]

# tc -j filter show dev $DEV | json_pp
unexpected end of string while parsing JSON string, at character offset 150 (before "h 800: ht divisor 1 ...") at /usr/bin/json_pp line 40.

# python3
Python 3.6.8 (default, May  4 2021, 11:14:36) 
[GCC 8.4.1 20210423 (Red Hat 8.4.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess, json
>>> json.loads(subprocess.getoutput("tc -j filter show dev ens3"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python3.6/json/decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 150 (char 149)
>>>

Version-Release number of selected component (if applicable):
iproute-tc-5.12.0-1.el8.x86_64

How reproducible:
Easily

Steps to Reproduce:
1. See example above
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Andrea Claudi 2021-08-16 10:05:29 UTC
Moving to rhel-8.6, we are too close to the rhel-8.5 release+ deadline to have a chance to fix this in time for it.

Comment 6 Wen Liang 2022-02-04 14:50:39 UTC
The patch was merged in upstream, the link was https://patchwork.kernel.org/project/netdevbpf/cover/cover.1643225596.git.liangwen12year@gmail.com/

Comment 10 Mingyu Shi 2022-02-24 09:06:31 UTC
Verified with
iproute-5.15.0-3.el8
iproute-tc-5.15.0-3.el8

Comment 12 errata-xmlrpc 2022-05-10 15:23:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (iproute bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2049