Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1030537 - Don't allow users to add iso repos to content views
Summary: Don't allow users to add iso repos to content views
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: David Davis
QA Contact: sthirugn@redhat.com
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-14 16:15 UTC by Justin Sherrill
Modified: 2019-09-26 18:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-11 12:20:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 7138 0 None None None 2016-04-22 16:51:40 UTC

Description Justin Sherrill 2013-11-14 16:15:00 UTC
Description of problem:

If you attempt to publish a content view definition and have added an ISO repo, the publish will fail with an error:

NoMethodError: undefined method `[]' for nil:NilClass


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

mdp2/katello 1.4

How reproducible:
always

Steps to Reproduce: 
1.  Import a manifest 
2.  Enable one or more ISO repos
3.  Create a content view definition
4.  Add at least one ISO repo to the content view definition
5.  Publish the definition to a content view

Actual results:
Error

Expected results:
Publishes correctly

Additional info:

I'm not sure that we should actually support adding ISOs to a CV, if we should then it should work.


2013-10-23T12:47:50-0500: [Worker(delayed_job host:xio99clinuxmgt2.centric.com pid:22368)] ContentViewDefinition#generate_repos failed with NoMethodError: undefined method `[]' for nil:NilClass - 0 failed attempts
2013-10-23T12:47:50-0500: [Worker(delayed_job host:xio99clinuxmgt2.centric.com pid:22368)] PERMANENTLY removing ContentViewDefinition#generate_repos because of 1 consecutive failures.
undefined method `[]' for nil:NilClass
/usr/share/katello/app/models/glue/pulp/repo.rb:677:in `publish_distributor'
/usr/share/katello/app/models/glue/pulp/repo.rb:667:in `generate_metadata'
/usr/share/katello/app/models/repository.rb:242:in `block in trigger_contents_changed'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_proxy.rb:89:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_proxy.rb:89:in `flat_map'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
/usr/share/katello/app/models/repository.rb:242:in `trigger_contents_changed'
/usr/share/katello/app/models/content_view_version.rb:186:in `trigger_repository_changes'
/usr/share/katello/app/models/content_view_definition.rb:90:in `generate_repos'
/usr/share/katello/app/models/async_operation.rb:57:in `perform'
/opt/rh/ruby193/root/usr/share/gems/gems/delayed_job-3.0.2/lib/delayed/backend/base.rb:94:in `block in invoke_job'
/opt/rh/ruby193/root/usr/share/gems/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `block in initialize'
/opt/rh/ruby193/root/usr/share/gems/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `execute'
/opt/rh/ruby193/root/usr/share/gems/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:38:in `run_callbacks'

Comment 2 Brad Buckingham 2014-08-15 16:07:28 UTC
While investigating bug 1129424, had some discussion with Justin and Mike about handling of ISO repos.  For that bug, we have decided that it doesn't make sense to distribute ISO repos to the capsules/nodes.

We also discussed this bug and the decision is that it really doesn't make sense to be add ISO repos to a content view and then publish/promote them.

So to fix this bug, we should at a minimum:
- not include ISO repos in the list of available repos to be added to a content view
- not allow the user to add an ISO repo to a content view

Comment 3 David Davis 2014-08-18 13:19:46 UTC
Looks like we already limit the UI to yum repos so I just need to add a check to the model (for the CLI):

https://github.com/Katello/katello/blob/master/engines/bastion/app/assets/javascripts/bastion/content-views/details/content-view-available-repositories.controller.js#L40

Comment 4 Partha Aji 2014-08-18 16:03:52 UTC
Created redmine issue http://projects.theforeman.org/issues/7138 from this bug

Comment 5 Bryan Kearney 2014-08-18 22:01:51 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/7138 has been closed
-------------
David Davis
Applied in changeset commit:katello|e1212e9ae8343828d9045f026618c48f0d44b31a.

Comment 8 sthirugn@redhat.com 2014-08-21 15:37:59 UTC
Verified.

* UI - I dont see iso repos in the content-view - add repositories page
* CLI 0- Throws proper message when trying to add iso or puppet repos

repoid | reponame
155 | Red Hat Enterprise Linux 6 Server ISOs i386 6.5
142 | Red Hat Enterprise Linux 6 Server ISOs x86_64 6.5 
1   | Red Hat Enterprise Linux 6 Server Kickstart i386 6Server 
4   | Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server
152 | Red Hat Enterprise Linux 7 Server - Supplementary ISOs x86_64 7.0 
78  | testrepo1

hammer> content-view add-repository --id=20 --repository-id=155
Could not add repository:
  Validation failed: Cannot add file repositories to a content view.

hammer> content-view add-repository --id=20 --repository-id=142
Could not add repository:
  Validation failed: Cannot add file repositories to a content view.

hammer> content-view add-repository --id=20 --repository-id=1
The repository has been associated

hammer> content-view add-repository --id=20 --repository-id=4
The repository has been associated

hammer> content-view add-repository --id=20 --repository-id=152
Could not add repository:
  Validation failed: Cannot add file repositories to a content view.

hammer> content-view add-repository --id=20 --repository-id=78
Could not add repository:
  Validation failed: Cannot add puppet repositories to a content view.

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


Note You need to log in before you can comment on or make changes to this bug.