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 1239118 - Content View histories task can be deleted, causing ISE on versions list
Summary: Content View histories task can be deleted, causing ISE on versions list
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-03 15:01 UTC by Justin Sherrill
Modified: 2019-07-11 09:32 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 16:02:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Justin Sherrill 2015-07-03 15:01:10 UTC
currently the content view histories task can be deleted, but content_view_version#active_history expects there to be a task for every history item.  This causes and ISE when listing versions.

Comment 1 Justin Sherrill 2015-07-03 15:01:11 UTC
Created from redmine issue http://projects.theforeman.org/issues/10996

Comment 2 Justin Sherrill 2015-07-03 15:01:14 UTC
Upstream bug assigned to jsherril

Comment 3 Justin Sherrill 2015-07-03 15:04:40 UTC
To work around the issue:

# foreman-rake console

>  Katello::ContentViewHistory.where(:task_id => nil).destroy_all


The only downside is that the content view histories tab will be missing some information.  Thats the best we can do before the issue is fixed in the code.

Comment 5 Bryan Kearney 2015-07-08 00:04:43 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10996 has been closed
-------------
Justin Sherrill
Applied in changeset commit:katello|eee31ac5debab9dc0ef1252156420577d5f93d31.

Comment 6 Corey Welton 2015-07-08 17:18:06 UTC
Please included test scenario.

Comment 7 Justin Sherrill 2015-07-09 02:56:25 UTC
I believe this will require you to go into the rails console:

1.  Create and publish a content view
2.  Run the following:

# foreman-rake console
> Katello::ContentView.find_by_name("my_view_name").first.history.first.task.destroy


and then visit the  Content > Content View > my_view_name  

page to list the versions.  The list should display with no errors.

Comment 11 JQK 2015-07-16 08:12:18 UTC
Well still the same case from the same cu, the steps on Comment 7 does not work on Cu 's side.

And I have got the whole database backup from cu. Will this help?

Comment 12 Justin Sherrill 2015-07-16 12:46:35 UTC
Hi, Yes.  

After working with another customer to resolve their issue, i realized the initial workaround was not sufficient for all cases.  This one seemed to resolve it:


# foreman-rake console

> Katello::ContentViewHistory.all.each do |history|
   history.destroy if history.task.nil?
end

Comment 13 Tazim Kolhar 2015-07-17 08:20:37 UTC
Hi,

   I tried the below verification steps on sat6 snap13
   1.  Create and publish a content view
   2.  Run the following:

   # foreman-rake console
   >   Katello::ContentView.find_by_name("my_view_name").first.history.first.task.destroy
  
   The above step is not working ?
   are we suppose to execute the above command on sat6 ?

 Can you please confirm ?

  Thanks in advance

Thanks and Regards,
Tazim

Comment 14 Justin Sherrill 2015-07-20 12:31:34 UTC
Aplogies, 

One small mistake in that command:

It should be:


Katello::ContentView.find_by_name("my_view_name").history.first.task.destroy

Comment 15 Tazim Kolhar 2015-07-21 07:34:33 UTC
VERIFIED:
# rpm -qa | grep foreman
foreman-compute-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.17-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.9-1.el6_6sat.noarch
foreman-debug-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.18-1.el6_6sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch
foreman-postgresql-1.7.2.32-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el6_6sat.noarch
foreman-gce-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el6_6sat.noarch
foreman-selinux-1.7.2.13-1.el6_6sat.noarch
foreman-libvirt-1.7.2.32-1.el6_6sat.noarch
foreman-ovirt-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman-tasks-0.6.15.4-1.el6_6sat.noarch
foreman-proxy-1.7.2.5-1.el6_6sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-vmware-1.7.2.32-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.1-1.el6_6sat.noarch

steps:
 I tried the below verification steps on sat6 snap13
   1.  Create and publish a content view
   2.  Run the following:
#  foreman-rake console Katello::ContentView.find_by_name("con_viewA").history.first.task.destroy

Comment 17 Tazim Kolhar 2015-07-21 13:42:14 UTC
VERIFIED :
VERIFIED:
# rpm -qa | grep foreman
foreman-compute-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.17-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.9-1.el6_6sat.noarch
foreman-debug-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.18-1.el6_6sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch
foreman-postgresql-1.7.2.32-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el6_6sat.noarch
foreman-gce-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el6_6sat.noarch
foreman-selinux-1.7.2.13-1.el6_6sat.noarch
foreman-libvirt-1.7.2.32-1.el6_6sat.noarch
foreman-ovirt-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman-tasks-0.6.15.4-1.el6_6sat.noarch
foreman-proxy-1.7.2.5-1.el6_6sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-vmware-1.7.2.32-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el6_6sat.noarch
intel-s3e3432-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-1.7.2.32-1.el6_6sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.1-1.el6_6sat.noarch



 I tried the below verification steps on sat6 snap13
   1.  Create and publish a content view
   2.  Run the following:
#  foreman-rake console Katello::ContentView.find_by_name("con_viewA").history.first.task.destroy
and then visit the  Content > Content View > con_viewA  

page to list the versions.  The list should display with no errors.

Comment 18 Bryan Kearney 2015-08-12 16:02:39 UTC
This bug was fixed in Satellite 6.1.1 which was delivered on 12 August, 2015.


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