rootwrap generates "TypeError: Object of type 'ValueError' is not JSON serializable" exception when binary is not found
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.rootwrap |
New
|
Undecided
|
Unassigned |
Bug Description
Running rootwrap with commands not found on the system (new dependency and package not added yet for example), we get "TypeError: Object of type 'ValueError' is not JSON serializable" exceptions instead of a more specific exception.
Sample backtrace:
Unserializable message: Traceback (most recent call last):
File "/usr/lib64/
send(msg)
File "/usr/lib/
s = self.dumps(obj)
File "/usr/lib/
return json.dumps(obj, cls=RpcJSONEnco
File "/usr/lib64/
**kw)
File "/usr/lib64/
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib64/
return _iterencode(o, 0)
File "/usr/lib/
return super(RpcJSONEn
File "/usr/lib64/
o._
TypeError: Object of type 'ValueError' is not JSON serializable
Also, when using rootwrap daemon, this seems to cause daemon exit, this is a log observed in neutron (missing "arping" command in new containers):
2019-05-27 09:40:31.717 386982 INFO oslo_rootwrap.
2019-05-27 09:40:31.744 386982 DEBUG oslo_rootwrap.
2019-05-27 09:40:32.004 386982 INFO oslo_rootwrap.
Problem may be due to how CommandFilter in Oslo.rootwrap works. See in https:/
While this should not happen in production environments, it would be heplful in dev envs (and new OS versions/switch to containers/...) to have a clearer error
Sample downstream issues we hit in neutron when switching to RHEL8:
https:/
https:/
https:/