Bug 1368026 - Delete hosts through bulk actions takes several hours
Summary: Delete hosts through bulk actions takes several hours
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.1.9
Hardware: Unspecified
OS: Unspecified
high
low vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-18 07:18 UTC by Michal Dekan
Modified: 2019-12-16 06:24 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-20 18:25:39 UTC
Target Upstream Version:


Attachments (Terms of Use)
patch created based on upstream bug http://projects.theforeman.org/issues/8316 (1.45 KB, patch)
2016-08-18 07:18 UTC, Michal Dekan
no flags Details | Diff

Description Michal Dekan 2016-08-18 07:18:21 UTC
Created attachment 1191808 [details]
patch created based on upstream bug http://projects.theforeman.org/issues/8316

Description of problem:


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

$ cat foreman_packages
COMMAND> rpm -qa '*foreman*' || dpkg -l *foreman* | sort

lv0000014.ms.bgnet.de-foreman-proxy-client-1.0-1.noarch
foreman-vmware-1.7.2.56-1.el7sat.noarch
foreman-postgresql-1.7.2.56-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.5-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.15-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el7sat.noarch
foreman-ovirt-1.7.2.56-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
foreman-debug-1.7.2.56-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.23-1.el7sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
lv0000014.ms.bgnet.de-foreman-client-1.0-1.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.10-1.el7sat.noarch
foreman-1.7.2.56-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.15.7-1.el7sat.noarch
foreman-proxy-1.7.2.8-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.14-1.el7sat.noarch
foreman-discovery-image-3.0.5-3.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch
foreman-libvirt-1.7.2.56-1.el7sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.24-1.el7sat.noarch
foreman-gce-1.7.2.56-1.el7sat.noarch
foreman-selinux-1.7.2.16-1.el7sat.noarch
foreman-compute-1.7.2.56-1.el7sat.noarch
xxxx-foreman-proxy-1.0-1.noarch


How reproducible:


Steps to Reproduce:
1. Install or update to Satellite 6.1.9
2. Go to Hosts -> all Hosts, select 7 - 20 hosts you want to delete
3. Select Action -> Delete Host

Actual results:

PGError: ERROR:  update or delete on table "hosts" violates foreign key constraint "reports_host_id_fk" on table "reports"
DETAIL:  Key (id)=(1244) is still referenced from table "reports".
: DELETE FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."id" = $1

And Actions::BulkAction task takes several hours to finish or its stuck.

Expected results:

Delete Hosts trough bulk action should finished successfully.

Additional info:

This is clone of upstream bug http://projects.theforeman.org/issues/8316
Customer confirmed that once the patch was applied its working.

# cd /usr/share/foreman/app/models/
# patch -p0 < managed.rb.patch

Comment 3 Brad Buckingham 2016-09-20 18:25:39 UTC
The upstream issue referenced in the bugzilla description is included in Satellite 6.2.


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