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 1981401 - [pulp3] CV with filter by id with empty rules fails with undefined method `start_date' for nil:NilClass
Summary: [pulp3] CV with filter by id with empty rules fails with undefined method `st...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.10.0
Assignee: James Jeffers
QA Contact: Lai
URL:
Whiteboard:
: 1978588 (view as bug list)
Depends On:
Blocks: 1957813
TreeView+ depends on / blocked
 
Reported: 2021-07-12 13:44 UTC by Peter Vreman
Modified: 2021-11-16 14:12 UTC (History)
3 users (show)

Fixed In Version: tfm-rubygem-katello-4.1.1.8-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:12:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33213 0 None None None 2021-08-04 19:18:19 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:12:42 UTC

Description Peter Vreman 2021-07-12 13:44:21 UTC
Description of problem:
~~~
2021-07-12T13:40:03 [I|bac|] Task {label: Actions::Katello::ContentView::Publish, id: d1191436-11dc-4359-b59c-3e56cfabd46c, execution_plan_id: 7f4e15a8-bcbb-48a5-be9a-8d27932b9086} state changed: running
2021-07-12T13:40:03 [E|bac|] undefined method `start_date' for nil:NilClass (NoMethodError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/models/katello/content_view_erratum_filter.rb:96:in `errata_from'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/models/katello/content_view_erratum_filter.rb:36:in `content_unit_pulp_ids'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:268:in `block (2 levels) in add_filter_content'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:267:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:267:in `block in add_filter_content'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:265:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:265:in `add_filter_content'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:327:in `block in copy_content_from_mapping'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:319:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/services/katello/pulp3/repository/yum.rb:319:in `copy_content_from_mapping'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/lib/actions/pulp3/repository/multi_copy_content.rb:23:in `invoke_external_task'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/action/polling.rb:84:in `initiate_external_action'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/action/polling.rb:19:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/action/cancellable.rb:14:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.29/app/lib/actions/pulp3/abstract_async_task.rb:10:in `run'
~~~

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


How reproducible:


Steps to Reproduce:
1. Create CV with a RedHat repo
2. Add CV Errata Filter by ID
3. Leave the ID list (and date and time also) empty
4. Publish CV

Actual results:
Failure

Expected results:
Success

Additional info:
Another bug is that the UI show in the next step and when editing later in the 'Add' Tab the Date/Time section which is incorrect because that shall be only for the 'Erratum by Date and Type'

Comment 1 Peter Vreman 2021-07-12 14:08:47 UTC
Patch is simple, in generate_clauses() the case of empty rules is handled, but this was forgotten in content_unit_pulp_ids():

~~~
--- models/katello/content_view_erratum_filter.rb.210702-1      2021-06-03 15:05:14.000000000 +0000
+++ models/katello/content_view_erratum_filter.rb       2021-07-12 14:06:48.596501188 +0000
@@ -27,6 +27,8 @@
     end

     def content_unit_pulp_ids(repo)
+      return [] if erratum_rules.blank?
+
       if filter_by_id?
         errata_ids = erratum_rules.map(&:errata_id)
         errata_pulp_ids = errata_package_pulp_ids_from_errata_ids(repo, errata_ids)
~~~

Comment 2 Brad Buckingham 2021-07-16 19:01:31 UTC
*** Bug 1978588 has been marked as a duplicate of this bug. ***

Comment 3 James Jeffers 2021-08-04 17:38:32 UTC
Created redmine issue https://projects.theforeman.org/issues/33213 from this bug

Comment 4 Brad Buckingham 2021-08-05 17:56:27 UTC
Upstream PR merged.

Comment 7 Lai 2021-08-17 19:35:25 UTC
Steps to test

1. Create CV with a RedHat repo
2. Add CV Errata Filter by ID
3. Leave the ID list (and date and time also) empty
4. Publish CV with the empty filter

Expected
Should be able to publish successfully

Actual
published successfully

Verified on 6.10 snap 13 with tfm-rubygem-katello-4.1.1.8-1.el7sat.noarch

Comment 10 errata-xmlrpc 2021-11-16 14:12:32 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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702


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