Hide Forgot
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:
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.