| Summary: | Stack traces logged to production.log for user-level validation errors | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Jeff Weiss <jweiss> | ||||
| Component: | Content Management | Assignee: | Petr Chalupa <pchalupa> | ||||
| Status: | CLOSED UPSTREAM | QA Contact: | Katello QA List <katello-qa-list> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.0.0 | CC: | dajohnso, inecas, lzap, mmccune, pchalupa, tsanders | ||||
| Target Milestone: | Unspecified | Keywords: | Triaged | ||||
| Target Release: | Unused | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2013-09-19 18:12:47 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
This is more Rails3 "feature" than ours. From all of the reported traces they all go to: /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/validations.rb:49:in `save!' When you use method with exclamation mark, you want Rails3 to report the error. Ivan is there a configuration for Rails3 that would not post backtraces? The logging of back-trace is in fact handled by Katello itself. For example for Organization creation through UI that is this code:
# ...
rescue Exception => error
# ...
Rails.logger.error error.backtrace.join("\n")
So the solution would be to update our UI controllers so that it doesn't log trace for validation errors, something like:
# ...
rescue Exception => error
# ...
Rails.logger.error error.backtrace.join("\n") unless error.is_a? ActiveRecord::RecordInvalid
Notice that API logs stack trace for this kind of error with debug level, which is acceptable/desirable, so that it doesn't pollute the production log, but it still might be helpful in development phase.
Imho there should only be: # ... rescue ActiveRecord::RecordInvalid # ... usually render some error to a user, log nothing end Other errors not expected by developer are rescued and logged by rescue_from(StandardError) in application controller. addressed in: https://github.com/Katello/katello/pull/176 fixed in aec316257d8fe36e1e01462fa889bfb5ad0556ab These bugs have been resolved in upstream projects for a period of months so I'm mass-closing them as CLOSED:UPSTREAM. If this is a mistake feel free to re-open. |
Created attachment 574072 [details] katello log Description of problem: The only stacktraces that should be logged are conditions that are unexpected to the developer. User-level errors like "I tried to create two products with the same name" do not require a stacktrace. Logs are completely polluted with them. See attachment. The only "real" error in there requiring a stacktrace is the JDBC batch update error near the end. Version-Release number of selected component (if applicable): CloudForms System Engine Version: 0.1.307-1.el6 How reproducible: always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: