Misleading msg in barbican log when using a new tenant
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Barbican |
Fix Released
|
Low
|
Steve Heyman |
Bug Description
Running tests for a new tenant ID (ie one that Barbican has never seen) causes the following message in the barbican logs:
2014-07-22 21:15:15.551 25227 ERROR barbican.
2014-07-22 21:15:15.551 25227 TRACE barbican.
2014-07-22 21:15:15.551 25227 TRACE barbican.
2014-07-22 21:15:15.551 25227 TRACE barbican.
2014-07-22 21:15:15.551 25227 TRACE barbican.
2014-07-22 21:15:15.551 25227 TRACE barbican.
2014-07-22 21:15:15.551 25227 TRACE barbican.
2014-07-22 21:15:15.551 25227 TRACE barbican.
This is an expected behaviour - server is looking to see if the tenant is known...if not it will add it.
The problem is that someone (or a log scanning tool) could see this as a potential issue in the barbican server and cause unnecessary alarm.
The code that raises this has a flag (suppress_
Should move the code to log this so that it is NOT logged when the exception is expected (try saying that 10 times fast!)
See barbican.
Changed in barbican: | |
status: | New → Confirmed |
importance: | Undecided → Low |
milestone: | none → juno-3 |
Changed in barbican: | |
assignee: | nobody → Steve Heyman (sheyman) |
status: | Confirmed → In Progress |
Changed in barbican: | |
status: | Fix Committed → Fix Released |
Changed in barbican: | |
milestone: | juno-3 → 2014.2 |
Reviewed: https:/ /review. openstack. org/109037 /git.openstack. org/cgit/ openstack/ barbican/ commit/ ?id=ed5eab5f53e 26700ee9e78249f 5840440405703e
Committed: https:/
Submitter: Jenkins
Branch: master
commit ed5eab5f53e2670 0ee9e78249f5840 440405703e
Author: Steve Heyman <email address hidden>
Date: Wed Jul 23 11:40:32 2014 -0500
Don't log message for keystone ID query when supressing exceptions
Barbican repo method find_by_keystone_id will check the DB for a
tenant ID. It also takes a flag, supress_exception, so that a
"tenant not found" type of error won't result in an exception
being percolated to its caller.
When the query is done for a tenant that has never been used
it will raise a NoResultFound which gets caught and only
percolated if the supress_exception flag is false.
Previous to this change, we would log this NoResultFound which
in many cases is expected behaviour (hence the supress_exception
flag). This could be confusing for someone looking at barbican
logs (or an automated log crawler) since this exception is actually
expected behaviour.
This change moves the logging of the exception so that it only
happens if the supress_exception flag is false. This keeps these
expected exceptions out of the logs.
Change-Id: I864ab7db19efb2 230f43c9287103b 97fa7b16beb
Closes-Bug: 1347205