[Pulp-list] unable to remove rpms

Ashby, Jason (IMS) AshbyJ at imsweb.com
Mon Jun 9 16:20:59 UTC 2014


YES THAT WAS IT!   I have a more restricted “upload-admin” user that does the uploads, and I was trying to use the admin superuser to delete it.   Doing the remove command with the upload-admin user worked like a charm.  Thanks so much.

From: Martin Collins [mailto:martin.collins at framestore.com]
Sent: Friday, June 06, 2014 5:41 PM
To: Ashby, Jason (IMS)
Cc: Barnaby Court; pulp-list at redhat.com
Subject: Re: [Pulp-list] unable to remove rpms

Are you running pulp-admin as the same user who uploaded it? It isn't just from sync/user but also different users.

Easiest way I've looked is to (on the pulp master) when having this issue myself was:

# mongo
> use pulp_database
switched to db pulp_database
> db.units_rpm.find({filename:"3proxy-0.6.1-10.el6.x86_64.rpm"})
{ "_id" : "4775db21-9421-4915-a318-4e2e88b199c9"

Then use the _id to look up which repo/who uploaded it

db.repo_content_units.find({"unit_id": "4775db21-9421-4915-a318-4e2e88b199c9"}).forEach(printjson)

This will then show which repos the unit is associated with, what i tend to see in this instance is the user logged in with pulp-admin isn't the same as the one who uploaded it or it came from a sync (so it fails to dissociate)

Just curious if it's that which is causing it, in the end I've just patched our master to avoid it (2.3.1-1) so that when i unassociate it's a bit more "just go and do it" and don't check owner_type or owner_id and delete all reference (not sure if it has any negatives, but it works for me, ymmv)

Cheers,
Martin

As an FYI:

--- /usr/lib/python2.6/site-packages/pulp/server/managers/repo/unit_association.py.orig 2014-06-02 15:23:04.606161773 +0100
+++ /usr/lib/python2.6/site-packages/pulp/server/managers/repo/unit_association.py      2014-06-02 15:23:19.350228458 +0100
@@ -113,9 +113,7 @@
         # If the association already exists, no need to do anything else
         spec = {'repo_id' : repo_id,
                 'unit_id' : unit_id,
-                'unit_type_id' : unit_type_id,
-                'owner_type' : owner_type,
-                'owner_id' : owner_id,}
+                'unit_type_id' : unit_type_id}
         existing_association = RepoContentUnit.get_collection().find_one(spec)
         if existing_association is not None:
             return


On 6 June 2014 19:32, Ashby, Jason (IMS) <AshbyJ at imsweb.com<mailto:AshbyJ at imsweb.com>> wrote:
I tried deleting the link /var/lib/pulp/published/https/repos/Dev-FOO-Custom/php-foo-5.5.13-1.x86_64.rpm, but searching the repo with pulp-admin still shows it as being present.  I then republished the repo and the link returned (and is still present when searching).

Anyone have a few commands for deleting it manually from mongo and the filesystem?  It would save me a few heartaches.  Or help me debug further?  Thanks all.

-----Original Message-----
From: Barnaby Court [mailto:bcourt at redhat.com<mailto:bcourt at redhat.com>]
Sent: Friday, June 06, 2014 11:01 AM
To: Ashby, Jason (IMS)
Cc: pulp-list at redhat.com<mailto:pulp-list at redhat.com>
Subject: Re: [Pulp-list] unable to remove rpms

Hi, You should never have to touch the /var/lib/pulp/content/ directory for RPMs that you uploaded yourself.  Worst case you should have to remove from the publish directory: /var/lib/pulp/published/https/repos/Dev-FOO-Custom/php-foo-5.5.13-1.x86_64.rpm.  Manually deleting from the /var/lib/pulp/content can cause painful side effects.

To verify the contents of the repository you can query with "pulp-admin rpm repo content rpm --repo-id Dev-FOO-Custom --match 'filename=php-foo-5.5.13-1.x86_64.rpm'.

-Barnaby

----- Original Message -----
From: "Jason Ashby (IMS)" <AshbyJ at imsweb.com<mailto:AshbyJ at imsweb.com>>
To: "Barnaby Court" <bcourt at redhat.com<mailto:bcourt at redhat.com>>
Cc: pulp-list at redhat.com<mailto:pulp-list at redhat.com>
Sent: Thursday, June 5, 2014 5:20:43 PM
Subject: RE: [Pulp-list] unable to remove rpms

Hi Barnaby,
Thanks for the reply.  These are custom rpms that I uploaded with the uploads command:

    pulp-admin rpm repo uploads rpm --repo-id=Dev-FOO-Custom --file=/tmp/php-foo-5.5.13-1.x86_64.rpm

The rpms were packaged using fpm if that matters.

So the following would solve it?:

    pulp-admin rpm repo remove rpm --repo-id Dev-FOO-Custom --match 'filename=php-foo-5.5.13-1.x86_64.rpm'
    rm -rf /var/lib/pulp/content/rpm/php-foo/5.5.13
    rm -f /var/lib/pulp/published/https/repos/Dev-FOO-Custom/php-foo-5.5.13-1.x86_64.rpm

I feel like I had major issues last time I tried removing a package this way.  How can I confirm that the package info is removed from the pulp DB as well?  I think the pulp DB and filesystem being out of sync was the issue I hit before.

-----Original Message-----
From: Barnaby Court [mailto:bcourt at redhat.com<mailto:bcourt at redhat.com>]
Sent: Thursday, June 05, 2014 5:10 PM
To: Ashby, Jason (IMS)
Subject: Re: [Pulp-list] unable to remove rpms

Hi, Are these custom rpms that you have uploaded manually or rpms that were pulled in via a sync from a feed?  If they came from a feed there is a behavior in pulp 2.3.x where they could not be deleted by a user.  This has been fixed in Pulp 2.4.  There were also issues with the publishing of rpms in 2.3 where old rpms may not be removed from the publish directory even if they were removed from the repo.  This has also been fixed in 2.4.  If the rpms were uploaded manually they can be removed from the filesystem on the server directly after they were removed from the repo with the delete command.  Based on the output you included it looks like it is an RPM that came from a feed and that is what is causing the trouble.  Regards,

Barnaby

----- Original Message -----
From: "Jason Ashby (IMS)" <AshbyJ at imsweb.com<mailto:AshbyJ at imsweb.com>>
To: pulp-list at redhat.com<mailto:pulp-list at redhat.com>
Sent: Thursday, June 5, 2014 4:14:17 PM
Subject: [Pulp-list] unable to remove rpms



Hi,

I’m scratching my head on this one. I’m running pulp 2.3.1 on CentOS 6.5, and I’m trying to remove an rpm from a repository, but it’s just not happening.







me at pulpserver:~> pulp-admin rpm repo remove rpm --repo-id Dev-FOO-Custom --match 'filename=php-foo-5.5.13-1.x86_64.rpm'

This command may be exited via ctrl+c without affecting the request.



[-]

Waiting to begin...



[-]

Running...



Units:

php-foo-5.5.13-1-x86_64





me at pulpserver:~> pulp-admin repo tasks list --repo-id Dev-FOO-Custom

+----------------------------------------------------------------------+

Tasks

+----------------------------------------------------------------------+



Operations: unassociate

Resources: Dev-FOO-Custom (repository)

State: Successful

Start Time: 2014-06-05T19:56:10Z

Finish Time: 2014-06-05T19:56:10Z

Result:

Type Id: rpm

Unit Key:

Arch: x86_64

Checksum: c2ab8901adb1db8ad5d0798d1c65544151fe1133e1da918d830df95247b662

21

Checksumtype: sha256

Epoch: 0

Name: php-foo

Release: 1

Version: 5.5.13

Task Id: 03aa6208-2efd-4355-9eeb-ac87fc6473e2





Looks successful, now let’s republish:



me at pulpserver:~> pulp-admin rpm repo publish run --repo-id Dev-FOO-Custom

+----------------------------------------------------------------------+

Publishing Repository [Dev-FOO-Custom]

+----------------------------------------------------------------------+



This command may be exited by pressing ctrl+c without affecting the actual

operation on the server.



Publishing packages...

[= ] 3%

Packages: 4/106 items

Publishing distributions...

[==================================================] 100%

Distributions: 0/0 items

[==================================================] 100%

Packages: 106/106 items

... completed



Generating metadata

[-]

... completed



Publishing repository over HTTPS

[-]

... completed







But it’s still present in the repository



me at pulpserver:~> pulp-admin rpm repo content rpm --repo-id Dev-FOO-Custom --match 'filename=php-foo-5.5.13-1.x86_64.rpm'

Arch: x86_64

Buildhost: fig

Checksum: c2ab8901adb1db8ad5d0798d1c65544151fe1133e1da918d830df95247b66221

Checksumtype: sha256

Description: no description given

Epoch: 0

Filename: php-foo-5.5.13-1.x86_64.rpm

License: unknown

Name: php-foo

Provides: php-foo = 5.5.13-1-0, php-foo(x86-64) = 5.5.13-1-0

Release: 1

Requires:

Vendor: root at fig

Version: 5.5.13



and “yum list php-foo” on any host shows that specific package and version is available for install. I see no errors or clues in the logs in /var/log/pulp, ~/.pulp, or /var/log/gofer. I do see these coming up frequently in /etc/httpd/logs/error_log, but not sure if it’s helpful:



[Thu Jun 05 15:58:55 2014] [error] Generating sqlite DBs

[Thu Jun 05 15:58:55 2014] [error] Starting other db creation: Thu Jun 5 15:58:55 2014

[Thu Jun 05 15:58:55 2014] [error] Ending other db creation: Thu Jun 5 15:58:55 2014

[Thu Jun 05 15:58:56 2014] [error] Starting filelists db creation: Thu Jun 5 15:58:56 2014

[Thu Jun 05 15:58:57 2014] [error] Ending filelists db creation: Thu Jun 5 15:58:57 2014

[Thu Jun 05 15:58:57 2014] [error] Starting primary db creation: Thu Jun 5 15:58:57 2014

[Thu Jun 05 15:58:57 2014] [error] Ending primary db creation: Thu Jun 5 15:58:57 2014

[Thu Jun 05 15:58:57 2014] [error] Sqlite DBs complete



I tried rebooting the pulp server, but no luck. I get the same result with trying to delete other rpms in this repository. I have not tried removing any from other repos. I do have a secondary pulp node that I sync content to, in case that is relevant.



Any help would be greatly appreciated!







Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error.

_______________________________________________
Pulp-list mailing list
Pulp-list at redhat.com<mailto:Pulp-list at redhat.com>
https://www.redhat.com/mailman/listinfo/pulp-list

________________________________

Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error.

________________________________

Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error.

_______________________________________________
Pulp-list mailing list
Pulp-list at redhat.com<mailto:Pulp-list at redhat.com>
https://www.redhat.com/mailman/listinfo/pulp-list


________________________________

Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20140609/5b039049/attachment.htm>


More information about the Pulp-list mailing list