FileNotFoundError: [Errno 2] No such file or directory: '/etc/nova/policy.json' when policy file removed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Low
|
Akhil Gudise |
Bug Description
Reported in the #openstack-nova channel today, that if a policy.json file is added without restarting the nova-api service, things work fine, but if the file is removed without restarting the service, the following error is raised:
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack [req-46b41bde-
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack Traceback (most recent call last):
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return req.get_
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack application, catch_exc_
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack app_iter = application(
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return resp(environ, start_response)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack resp = self.call_func(req, *args, **kw)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack response = req.get_
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack application, catch_exc_
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack app_iter = application(
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack resp = self.call_func(req, *args, **kw)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack service_
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return wrapped(*args, **kwargs)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return wrapped(*args, **kwargs)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return wrapped(*args, **kwargs)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack [Previous line repeated 2 more times]
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return cls(**kwargs)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack self.is_admin = policy.
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return _ENFORCER.
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack *args, **kwargs)
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack self.load_rules()
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack overwrite=
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack self._file_cache, path, force_reload=
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack mtime = os.path.
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack File "/usr/lib/
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack return os.stat(
2019-12-12 03:08:52.634 72789 ERROR nova.api.openstack FileNotFoundError: [Errno 2] No such file or directory: '/etc/nova/
Happening due to some file caching done by oslo.policy. Looks like we need to handle that somehow in nova.
Changed in nova: | |
status: | New → Confirmed |
Changed in nova: | |
assignee: | nobody → Akhil Gudise (akhil-g) |
Changed in nova: | |
importance: | Undecided → Low |
Reproduce steps:
1. Add a policy.json override while nova-api is running and verify the override works by calling the relevant REST API policy. json'" error
2. Remove the policy.json file and try the same REST API request again and get the "[Errno 2] No such file or directory: '/etc/nova/
Expected Result:
No error when calling the REST API
Actual Result:
[Errno 2] No such file or directory: '/etc/nova/ policy. json'