Bug 1102120

Summary: Content_view_filters listing produce "undefined method `filter_ids' for nil:NilClass" when called with bad/no arguments
Product: Red Hat Satellite Reporter: Matej Kollar <mkollar>
Component: APIAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: bbuckingham, cperry, jaudet, jmontleo, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/5985
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:27:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matej Kollar 2014-05-28 14:20:02 UTC
Description of problem: When listing :content_view_filters, but called with no/wrong
arguments, ISE(500) is generated instead of proper error message.

How reproducible: always/deterministic


Steps to Reproduce:
1. create content-view
2. create filter
3.
       bundle exec irb
       require 'apipie-bindings'
       api = ApipieBindings::API.new({:uri....
       api.resource(:content_view_filters).call(:index, {})

Actual results:

production.log:

    Processing by Apipie::ApipiesController#apipie_checksum as JSON
      Parameters: {"apipy"=>{}}
      Rendered /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.1.2/app/views/apipie/apipies/apipie_checksum.json.erb (0.2ms)
    Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
    Processing by Katello::Api::V2::ContentViewFiltersController#index as application/json;version=2
      Parameters: {"api_version"=>"v2", "content_view_filter"=>{}}
    Expire fragment views/tabs_and_title_records-1 (0.1ms)
    Authorized user admin(Admin User)
    NoMethodError: undefined method `filter_ids' for nil:NilClass
    /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/controllers/katello/api/v2/content_view_filters_controller.rb:28:in `index'
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:560:in `block (3 levels) in _run__937089204135300545__process_action__1511122125132080161__callbacks'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_9888'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_2792'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_9888'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:471:in `block (2 levels) in _run__937089204135300545__process_action__1511122125132080161__callbacks'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_9887'
    /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_9887'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:415:in `block in _run__937089204135300545__process_action__1511122125132080161__callbacks'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_9886'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_13'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_9886'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__937089204135300545__process_action__1511122125132080161__callbacks'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
    /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'

...

Expected results:

Message about required parameters or something like that...

Comment 1 RHEL Program Management 2014-05-28 14:25:18 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Milan Zázrivec 2014-05-29 15:02:10 UTC
Redmine issue: http://projects.theforeman.org/issues/5985

Comment 4 Bryan Kearney 2014-07-24 16:02:18 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/5985 has been closed
-------------
Partha Aji
Applied in changeset commit:katello|55b29a489abbf1f430e04aad33a04bd87a394a1f.

Comment 6 jaudet 2014-09-02 18:50:01 UTC
This bug is targeted by GitHub PR #1271. [1] The test passes, indicating that this bug has been verified. I will mark this bug as being verified after the test code has been reviewed by another team member.

[1] https://github.com/omaciel/robottelo/pull/1271

Comment 7 Bryan Kearney 2014-09-11 12:27:57 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.