Bug 996172 - Failed to publish a view after defining a filter with incorrect pkg format (format other than E:V-R)
Failed to publish a view after defining a filter with incorrect pkg format (f...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Views (Show other bugs)
Nightly
Unspecified Unspecified
high Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-12 10:54 EDT by Sachin Ghai
Modified: 2016-08-04 14:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-04 14:06:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachin Ghai 2013-08-12 10:54:47 EDT
Description of problem:
When we define a filter without following the specified format (E:V-R), the filter created successfully but while publishing, UI raised an error.

--
Failed to publish content view 'publish' from definition 'con-def-0812-195450-306'.
undefined method `keys' for [{:term=>{:version=>"01-0.01-1"}}, {:term=>{:release=>"01-1"}}]:Array (NoMethodError) 
--


Version-Release number of selected component (if applicable):
katello-1.4.3-1.git.162.c75fe6b.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. Create a content-view
2. Select any created repo
3. Create a package filter
4. do not follow defined package format
5. Publish the CV

Actual results:
--
Failed to publish content view 'publish' from definition 'con-def-0812-195450-306'.
undefined method `keys' for [{:term=>{:version=>"01-0.01-1"}}, {:term=>{:release=>"01-1"}}]:Array (NoMethodError) 
--

Expected results:
At first place, UI should not allow user to create filter when package format is not appropriate.

If its allowed then the error message raised while publishing the CV should be rephrased.


Additional info:
/usr/share/katello/app/models/glue/elastic_search/package.rb:154:in `block in search'
/usr/share/katello/app/models/glue/elastic_search/package.rb:153:in `each'
/usr/share/katello/app/models/glue/elastic_search/package.rb:153:in `search'
/usr/share/katello/app/models/package_rule.rb:55:in `generate_version_clause'
/usr/share/katello/app/models/package_rule.rb:36:in `block in generate_clauses'
/usr/share/katello/app/models/package_rule.rb:26:in `each'
/usr/share/katello/app/models/package_rule.rb:26:in `each_with_object'
/usr/share/katello/app/models/package_rule.rb:26:in `generate_clauses'
/usr/share/katello/app/models/content_view_definition.rb:296:in `block in generate_clauses'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in `collect'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in `collect'
/usr/share/katello/app/models/content_view_definition.rb:295:in `generate_clauses'
/usr/share/katello/app/models/content_view_definition.rb:257:in `unassociation_clauses'
/usr/share/katello/app/models/content_view_definition.rb:146:in `block (2 levels) in unassociate_contents'
/usr/share/katello/app/models/content_view_definition.rb:145:in `each'
/usr/share/katello/app/models/content_view_definition.rb:145:in `block in unassociate_contents'
/usr/share/katello/app/models/content_view_definition.rb:144:in `each'
/usr/share/katello/app/models/content_view_definition.rb:144:in `unassociate_contents'
Comment 1 Sachin Ghai 2013-08-13 05:40:32 EDT
Investigated further and found that the issue is with the type 'only-version'.

When you filter a package of specific version with type 'Only-Version' then UI raised the undefined method error.

Step to reproduce it:

- sync a repo: http://inecas.fedorapeople.org/fakerepos/zoo/
- Create a package filter (include/exclude) for package camel
- select 'only-Version' having value '0.1-1'
Comment 2 RHEL Product and Program Management 2013-09-17 00:19:40 EDT
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 2013-10-10 06:41:06 EDT
Easily reproducible with snap4 compose4. 

steps to reproduce
1. create a CV and select the repo
2. create filter and associate repo
3. Create a package filter (include/exclude) for any pkg (e.g. camel)
4. select 'only-Version' having value '0.1'
5. publish the cv
Comment 6 Brad Buckingham 2016-08-04 14:06:50 EDT
The code has changed drastically since the issue was initially reported.  Tested this scenario on Satellite 6.2 GA and I was to publish the content view successfully without error. In my test, I used a package exclusion filter and the package was correctly excluded from the published CV.

The following is the status of the publish task:

Id: fc4f117a-b930-40b7-8f8b-422f5b6aec04
Label: Actions::Katello::ContentView::Publish
Name: Publish
Owner: admin
Execution type: Delayed
Start at: 2016-08-04 14:02:42 -0400
Start before: -
Started at: 2016-08-04 14:02:42 -0400
Ended at: 2016-08-04 14:03:12 -0400
State: stopped
Result: success
Params: content view 'zoo'; organization 'Default Organization'

Based on this result, closing this bugzilla.

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