Bug 1104991

Summary: 400 Bad request on clicking links under "Host Collections"--> "Collection Actions"
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: WebUIAssignee: Eric Helms <ehelms>
Status: CLOSED CURRENTRELEASE QA Contact: Sachin Ghai <sghai>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bbuckingham, bkearney, jmontleo, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/6221
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:05:55 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:
Attachments:
Description Flags
Clicking on "Errata Installation" from "Host Collections"--> "Collection Actions" leads to content-host page in Loading.... state
none
Clicking on "Errata Installation" from "Host Collections"--> "Collection Actions" raises execption in production.log
none
firebug throws 400 bad request error
none
Clicking on "Host Collection Membership" from "Host Collections"--> "Collection Actions" raises execption in production.log
none
no error on clicking "Errata Installation" under firebug
none
no error on clicking "Host Collection Membership" none

Description Sachin Ghai 2014-06-05 07:36:13 UTC
Created attachment 902421 [details]
Clicking on "Errata Installation" from "Host Collections"--> "Collection Actions" leads to content-host page in Loading.... state

Description of problem:
I was verifying bz #1096183. And found that clicking on following two links under "Host Collections"--> "Collection Actions" raises 400 Bad request error in production.log and page remains in loading state.

And error is also misleading as it says:

Processing by Katello::Api::V2::SystemsController#index as JSON
  Parameters: {"organization_id"=>"1", "page"=>"1", "search"=>"host_collection:'tests'", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
Katello::HttpErrors::BadRequest: No systems have been specified.


I've already added one content-host in host-collection.

Version-Release number of selected component (if applicable):
Verified with sat6 beta snap8 (Satellite-6.0.3-RHEL-6-20140604.0)

How reproducible:
always

Steps to Reproduce:
1. Create a host-collection
2. Add a content-host to created host-collection in step1
3. Now Go to "Host Collections"--> "Collection Actions" tab and select following links:

- Errata Installation
- Host Collection Membership 
4. Check production.log

Actual results:
Links opened up "content host" page but it remains in loading state, and a long execption thrown in production.log with 400 bad request.

Expected results:
Page shouldn't be in loading state and no exception should be in production.log

Additional info:
Please see attachments.

Comment 1 Sachin Ghai 2014-06-05 07:37:43 UTC
Created attachment 902433 [details]
Clicking on "Errata Installation" from "Host Collections"--> "Collection Actions" raises execption in production.log

Comment 2 Sachin Ghai 2014-06-05 07:39:35 UTC
From logs it seems two exception raises :

1.  400 Bad Request: 

Processing by Katello::Api::V2::SystemsBulkActionsController#applicable_errata as JSON
  Parameters: {"included"=>{"ids"=>[], "resources"=>[], "search"=>nil}, "excluded"=>{"ids"=>[]}, "organization_id"=>"1", "page"=>1, "search"=>"host_collection:'tests'", "api_version"=>"v2", "systems_bulk_action"=>{"included"=>{"ids"=>[], "resources"=>[], "search"=>nil}, "excluded"=>{"ids"=>[]}, "organization_id"=>"1", "page"=>1, "search"=>"host_collection:'tests'"}}
Katello::HttpErrors::BadRequest: No systems have been specified.
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/controllers/katello/api/v2/systems_bulk_actions_controller.rb:204:in `find_systems'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/controllers/katello/api/v2/systems_bulk_actions_controller.rb:175:in `find_readable_systems'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:553:in `block (3 levels) in _run__2775906763277148869__process_action__1677933224389130224__callbacks'


2.  404 Not found:
Processing by Katello::Api::V2::SystemsBulkActionsController#applicable_errata as JSON
  Parameters: {"page"=>1, "search"=>"host_collection:'tests'", "api_version"=>"v2", "systems_bulk_action"=>{"page"=>1, "search"=>"host_collection:'tests'"}}
Katello::HttpErrors::NotFound: One of parameters [ organization_id ] required but not specified.
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/controllers/katello/api/v2/api_controller.rb:121:in `find_organization'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:542:in `block (3 levels) in _run__2775906763277148869__process_action__1677933224389130224__callbacks'

Comment 3 RHEL Program Management 2014-06-05 07:43:51 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 5 Sachin Ghai 2014-06-05 07:46:58 UTC
Created attachment 902436 [details]
firebug throws 400 bad request error

Comment 6 Sachin Ghai 2014-06-05 07:58:19 UTC
Clicking on "Host Collection Membership" link  from "Host Collections"--> "Collection Actions" throws following exceptions:

Processing by Katello::Api::V2::SystemsController#show as JSON
  Parameters: {"fields"=>"full", "api_version"=>"v2", "id"=>"bulk-actions"}
exception when talking to a remote client: Katello::Resources::Candlepin::Consumer: 404 Resource Not Found {"displayMessage":"Consumer with id bulk-actions could not be found.","requestUuid":"4da7c89f-c17d-481e-b9e7-7eae58ea5d6f"} (GET /candlepin/consumers/bulk-actions) RestClient::ResourceNotFound: Katello::Resources::Candlepin::Consumer: 404 Resource Not Found {"displayMessage":"Consumer with id bulk-actions could not be found.","requestUuid":"4da7c89f-c17d-481e-b9e7-7eae58ea5d6f"} (GET /candlepin/consumers/bulk-actions)
Body: {"displayMessage":"Consumer with id bulk-actions could not be found.","requestUuid":"4da7c89f-c17d-481e-b9e7-7eae58ea5d6f"}
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/opt/rh/ruby193/root/usr/share/gems/gems/rbovirt-0.0.26/lib/restclient_ext/request.rb:50:in `block in transmit'



RestClient::ResourceNotFound: Katello::Resources::Candlepin::Consumer: 404 Resource Not Found {"displayMessage":"Consumer with id bulk-actions could not be found.","requestUuid":"4da7c89f-c17d-481e-b9e7-7eae58ea5d6f"} (GET /candlepin/consumers/bulk-actions)
Body: {"displayMessage":"Consumer with id bulk-actions could not be found.","requestUuid":"4da7c89f-c17d-481e-b9e7-7eae58ea5d6f"}

Comment 7 Sachin Ghai 2014-06-05 08:00:08 UTC
Created attachment 902439 [details]
Clicking on "Host Collection Membership" from "Host Collections"--> "Collection Actions" raises execption in production.log

Comment 8 Eric Helms 2014-06-13 20:53:57 UTC
Created redmine issue http://projects.theforeman.org/issues/6221 from this bug

Comment 9 Bryan Kearney 2014-06-16 20:04:54 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/6221 has been closed

Comment 12 Sachin Ghai 2014-06-19 09:26:10 UTC
Verified with sat6 Beta snap10(Satellite-6.0.3-RHEL-6-20140618.0)

On clicking following links via "Host Collections"--> "Collection Actions" tab
- Errata Installation
- Host Collection Membership 

I didn't see any issue in production.log.

Comment 13 Sachin Ghai 2014-06-19 09:32:18 UTC
Created attachment 910310 [details]
no error on clicking "Errata Installation" under firebug

Comment 14 Sachin Ghai 2014-06-19 09:33:25 UTC
Created attachment 910311 [details]
no error on clicking "Host Collection Membership"

Comment 15 Bryan Kearney 2014-07-02 14:05:55 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.