Bug 1335481

Summary: RedHat repositories returns 500 Internal Server if no Org is set
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: WebUIAssignee: satellite6-bugs <satellite6-bugs>
WebUI sub component: Katello QA Contact: Katello QA List <katello-qa-list>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: ahumbe, bbuckingham, bkearney, cwelton, egolov, erik-fedora, xdmoon
Version: 6.2.0Keywords: Regression, Triaged
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:36:34 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:
Bug Depends On:    
Bug Blocks: 1115190, 1122832    
Attachments:
Description Flags
Red Hat Repos - Any Context none

Description Peter Vreman 2016-05-12 10:04:02 UTC
Description of problem:
Having the Organiztion on 'Any Context' and then clicking on Content - RedHat Repositories will give a 500 Intenral error page instead of asking to select an Organization


2016-05-12 09:59:01 [app] [I] Processing by Katello::ProvidersController#redhat_provider as HTML
2016-05-12 09:59:01 [app] [E] User does not belong to an organization. (Katello::Errors::SecurityViolation)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.24/app/controllers/katello/application_controller.rb:254:in `require_org'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:424:in `block in make_lambda'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:160:in `call'
2016-05-12 09:59:01 [app] [I] Completed 500 Internal Server Error in 44ms
2016-05-12 09:59:01 [app] [F]
 | ActionView::MissingTemplate (Missing template katello/common/403 with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :rabl]}. Searched in:
 |   * "/usr/share/foreman/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.10/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-6.1.0/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/redhat_access-1.0.5/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-0.5.3.4/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.24/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/bastion-3.2.0.2/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.4/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.3/app/views"
 |   * "/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.6/app/views"
 | ):
 |   katello (3.0.0.24) app/controllers/katello/application_controller.rb:290:in `block (2 levels) in render_403'


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Set organization and location to Any Context
2. Goto RedHat Repositories
3.

Actual results:
500 Intenral Error

Expected results:
Page to ask for organization and then continue to RedHat repositories page

Additional info:

Comment 1 Erik van Pienbroek 2016-05-12 11:15:58 UTC
The same error also occurs when trying to open the Sync Status page without having an organization selected

Comment 2 Brad Buckingham 2016-05-24 19:30:47 UTC
Created attachment 1161195 [details]
Red Hat Repos - Any Context

Comment 3 Brad Buckingham 2016-05-24 19:32:14 UTC
With an internal Satellite 6.2 testing build, the user is presented with the option to 'Select an Organization'.  See attached screenshot.  Based on this, will move this bug to ON_QA for verification.

Comment 4 Brad Buckingham 2016-05-24 19:42:23 UTC
*** Bug 1335850 has been marked as a duplicate of this bug. ***

Comment 6 Bryan Kearney 2016-05-26 20:07:06 UTC
Verified:
Version verified: satellite-6.2.0-13.0.el7sat.noarch (snap 13.1)
Steps to verify:

* Set the org to any_org, and the location to any_location
* Selected Content -> Red Hat Repositories

Was presented with an org selection.

Comment 8 Brad Buckingham 2016-06-07 09:45:01 UTC
*** Bug 1333736 has been marked as a duplicate of this bug. ***

Comment 9 Bryan Kearney 2016-07-27 11:36:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501