Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 916977

Summary: No error displayed when trying to remove a package that has been synced
Product: [Retired] Pulp Reporter: Laurent Bigonville <bigon>
Component: user-experienceAssignee: pulp-bugs
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: low Docs Contact:
Priority: low    
Version: 2.2 BetaCC: bcourt, florian.sachs, kris.buytaert, mhrivnak, nobody, rbarlow, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-09 06:54:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Laurent Bigonville 2013-03-01 10:37:51 UTC
Hi,

Description of problem:
I have created a repository and synced the package from an other upstream repository. I then set the feed parameter empty (pulp-admin rpm repo update --repo-id myrepo --feed ''). I then tried to delete some of the packages, but nothing was happening, "p-a tasks list" was returning that the state of the task was successful. I've later been told on IRC that packages that have been synced cannot be deleted and that this was expected.

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

How reproducible:
I tried several time to remove several different packages.

Steps to Reproduce:
1. pulp-admin rpm repo create --repo-id myrepo --feed http://some/url
2. pulp-admin rpm repo sync run --repo-id myrepo
3. pulp-admin rpm repo update --repo-id myrepo --feed ''
4. pulp-admin rpm repo remove rpm --repo-id myrepo --match 'name=foo*'
  
Actual results:
The task state is successful

Expected results:
Some error explaining that synced package cannot be deleted.

Additional info:
I didn't find a way to see which package were coming from an upstream repository (and thus "protected") and the packages that have been manually added, maybe such information should be displayed in "pulp-admin rpm repo content rpm"?

Comment 1 Jay Dobies 2013-04-01 18:06:01 UTC
The output for the remove command has been significantly changed to poll against the task instead of just spitting you out a task ID and display what packages match. It will be in the 2.2.0 release. I'm moving this bug's state to correspond to where that fix is in our process.

Comment 2 Jeff Ortel 2013-06-06 16:19:49 UTC
build: 2.2.0-0.2.beta.

Some of these were likely included in an earlier build but found them this time with a better BZ query.

Comment 3 Preethi Thomas 2013-06-20 17:14:36 UTC
*** Bug 976056 has been marked as a duplicate of this bug. ***

Comment 4 Preethi Thomas 2013-06-20 17:16:59 UTC
[root@ibm-x3550m3-13 ~]#  pulp-admin rpm repo remove rpm --repo-id rhel6-2 --match 'name=firefox'
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...

[\]
Running...

Units:
  firefox-10.0.1-1.el6_2-i686
  firefox-10.0.1-1.el6_2-x86_64
  firefox-10.0.3-1.el6_2-i686
  firefox-10.0.3-1.el6_2-x86_64
  firefox-10.0.4-1.el6_2-i686
  firefox-10.0.4-1.el6_2-x86_64
  firefox-10.0.5-1.el6_2-i686
  firefox-10.0.5-1.el6_2-x86_64
  firefox-3.6.12-1.el6_0-x86_64
  firefox-3.6.13-2.el6_0-x86_64
  firefox-3.6.14-4.el6_0-x86_64
  firefox-3.6.15-2.el6_0-x86_64
  firefox-3.6.17-1.el6_0-i686
  firefox-3.6.17-1.el6_0-x86_64
  firefox-3.6.18-1.el6_1-i686
  firefox-3.6.18-1.el6_1-x86_64
  firefox-3.6.20-2.el6_1-i686
  firefox-3.6.20-2.el6_1-x86_64
  firefox-3.6.22-1.el6_1-i686
  firefox-3.6.22-1.el6_1-x86_64
  firefox-3.6.23-2.el6_1-i686
  firefox-3.6.23-2.el6_1-x86_64
  firefox-3.6.24-3.el6_1-i686
  firefox-3.6.24-3.el6_1-x86_64
  firefox-3.6.26-1.el6_2-i686
  firefox-3.6.26-1.el6_2-x86_64
  firefox-3.6.9-2.el6-x86_64

[root@ibm-x3550m3-13 ~]# 

[root@ibm-x3550m3-13 ~]#  pulp-admin rpm repo content rpm --repo-id rhel6-2 --match 'name=firefox' --fields filename
Filename:     firefox-10.0.1-1.el6_2.i686.rpm

Filename:     firefox-10.0.1-1.el6_2.x86_64.rpm

Filename:     firefox-10.0.3-1.el6_2.i686.rpm

Filename:     firefox-10.0.3-1.el6_2.x86_64.rpm

Filename:     firefox-10.0.4-1.el6_2.i686.rpm

Filename:     firefox-10.0.4-1.el6_2.x86_64.rpm

Filename:     firefox-10.0.5-1.el6_2.i686.rpm

Filename:     firefox-10.0.5-1.el6_2.x86_64.rpm

Filename:     firefox-3.6.12-1.el6_0.x86_64.rpm

Filename:     firefox-3.6.13-2.el6_0.x86_64.rpm

Filename:     firefox-3.6.14-4.el6_0.x86_64.rpm

Filename:     firefox-3.6.15-2.el6_0.x86_64.rpm

Filename:     firefox-3.6.17-1.el6_0.i686.rpm

Filename:     firefox-3.6.17-1.el6_0.x86_64.rpm

Filename:     firefox-3.6.18-1.el6_1.i686.rpm

Filename:     firefox-3.6.18-1.el6_1.x86_64.rpm

Filename:     firefox-3.6.20-2.el6_1.i686.rpm

Filename:     firefox-3.6.20-2.el6_1.x86_64.rpm

Filename:     firefox-3.6.22-1.el6_1.i686.rpm

Filename:     firefox-3.6.22-1.el6_1.x86_64.rpm

Filename:     firefox-3.6.23-2.el6_1.i686.rpm

Filename:     firefox-3.6.23-2.el6_1.x86_64.rpm

Filename:     firefox-3.6.24-3.el6_1.i686.rpm

Filename:     firefox-3.6.24-3.el6_1.x86_64.rpm

Filename:     firefox-3.6.26-1.el6_2.i686.rpm

Filename:     firefox-3.6.26-1.el6_2.x86_64.rpm

Filename:     firefox-3.6.9-2.el6.x86_64.rpm


[root@ibm-x3550m3-13 ~]#

Comment 5 Preethi Thomas 2013-06-20 17:18:16 UTC
Fails-qa
[root@ibm-x3550m3-13 ~]# rpm -qa pulp-server
pulp-server-2.2.0-0.4.beta.fc18.noarch

This is still an issue. More comments in the duplicate bug as well.

Comment 6 Barnaby Court 2013-10-09 12:59:59 UTC
The issue here is being caused because the collection.remove(...) filters by the owner_type & owner_id that created the item.  The query that gets the list of items affected does not filter by these fields.

Comment 7 Michael Hrivnak 2014-02-13 21:33:21 UTC
*** Bug 1037969 has been marked as a duplicate of this bug. ***

Comment 8 Michael Hrivnak 2014-02-13 21:34:20 UTC
We changed this behavior in 2.4, so that it is now possible to remove content from a repository even if it was brought in by a sync.

Comment 9 Jeff Ortel 2014-04-03 13:35:33 UTC
build: 2.4.0-0.7.beta

Comment 10 Preethi Thomas 2014-04-11 10:01:33 UTC
verified

[root@hp-dl380pgen8-02-vm-1 ~]# rpm -qa pulp-server
pulp-server-2.4.0-0.8.beta.el6.noarch
[root@hp-dl380pgen8-02-vm-1 ~

[root@hp-dl380pgen8-02-vm-1 ~]# pulp-admin rpm repo remove category --repo-id zoo --str-eq='id=all'
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Units Removed:
  all

[root@hp-dl380pgen8-02-vm-1 ~]# pulp-admin rpm repo remove rpm --repo-id zoo --str-eq='name=trout'
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Units Removed:
  trout-0.12-1-noarch

[root@hp-dl380pgen8-02-vm-1 ~]# pulp-admin rpm repo remove errata --repo-id zoo --str-eq='id=RHEA-2012:0003'
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Units Removed:
  RHEA-2012:0003


[root@hp-dl380pgen8-02-vm-1 ~]# pulp-admin rpm repo remove group --repo-id zoo --str-eq='name=mammals'
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Units Removed:
  mammals

Comment 11 Randy Barlow 2014-08-09 06:54:17 UTC
This has been fixed in Pulp 2.4.0-1.