You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Hombashi-san, thanks for publishing tcconfig. It makes tc a lot more approachable. I have found a crash when parsing filters in tcshow:
$ sudo tcshow wlp3s0
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/simplesqlite/core.py", line 663, in insert_many
self.connection.executemany(query, records)
sqlite3.IntegrityError: NOT NULL constraint failed: filter.device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/tcshow", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/tcconfig/tcshow.py", line 212, in main
tc_params = extract_tc_params(options)
File "/usr/local/lib/python3.8/dist-packages/tcconfig/tcshow.py", line 188, in extract_tc_params
rule_parser.parse()
File "/usr/local/lib/python3.8/dist-packages/tcconfig/parser/shaping_rule.py", line 105, in parse
self.__parse_device(self.ifb_device)
File "/usr/local/lib/python3.8/dist-packages/tcconfig/parser/shaping_rule.py", line 115, in __parse_device
self.__parse_tc_filter(device)
File "/usr/local/lib/python3.8/dist-packages/tcconfig/parser/shaping_rule.py", line 293, in __parse_tc_filter
self.__filter_parser.parse(
File "/usr/local/lib/python3.8/dist-packages/tcconfig/parser/_filter.py", line 139, in parse
Filter.insert(self.__get_filter())
File "/usr/local/lib/python3.8/dist-packages/simplesqlite/model.py", line 226, in insert
cls.__connection.insert(cls.get_table_name(), record)
File "/usr/local/lib/python3.8/dist-packages/simplesqlite/core.py", line 594, in insert
self.insert_many(table_name, records=[record], attr_names=attr_names)
File "/usr/local/lib/python3.8/dist-packages/simplesqlite/core.py", line 667, in insert_many
raise OperationalError(
simplesqlite.error.OperationalError: /usr/local/lib/python3.8/dist-packages/simplesqlite/model.py(226) insert: failed to execute query:
query=INSERT INTO filter(device,"filter_id",flowid,protocol,priority,[src-network],[dst-network],[src-port],[dst-port],classid,handle) VALUES (?,?,?,?,?,?,?,?,?,?,?)
msg='NOT NULL constraint failed: filter.device'
db=:memory:
records=[[None, '800::801', '1bc4:3', 'ipv6', 6, '0.0.0.0/0', '0.0.0.0/0', None, None, None, None]]
To Reproduce
The simplest way to reproduce that I have found is by running the below two tcset commands in sequence, and then tcshow as third command. These two tcset commands are trying to set up a 100ms delay on both ipv4 and ipv6, so quite a normal usecase I think.
Describe the bug
Hi Hombashi-san, thanks for publishing tcconfig. It makes tc a lot more approachable. I have found a crash when parsing filters in tcshow:
To Reproduce
The simplest way to reproduce that I have found is by running the below two
tcset
commands in sequence, and then tcshow as third command. These two tcset commands are trying to set up a 100ms delay on both ipv4 and ipv6, so quite a normal usecase I think.(note: 2nd command gives an error message, but does not crash. Crash only happens when running tcshow.)
Environments
Docker version: I was not using tcconfig in combination with docker.
Installation method: pip
Additional context
Full --debug output:
Output of what I think it is failing to parse:
Output of what the sqlite3 database looks like at the time of the crash:
The text was updated successfully, but these errors were encountered: