<div dir="ltr">Are you running pulp-admin as the same user who uploaded it? It isn't just from sync/user but also different users.<div><br></div><div>Easiest way I've looked is to (on the pulp master) when having this issue myself was:</div>
<div><br></div><div># mongo</div><div><div>> use pulp_database</div><div>switched to db pulp_database</div></div><div><div>> db.units_rpm.find({filename:"3proxy-0.6.1-10.el6.x86_64.rpm"})</div><div>{ "_id" : "4775db21-9421-4915-a318-4e2e88b199c9"</div>
</div><div><br></div><div>Then use the _id to look up which repo/who uploaded it</div><div><br></div><div><div>db.repo_content_units.find({"unit_id": "4775db21-9421-4915-a318-4e2e88b199c9"}).forEach(printjson)</div>
</div><div><br></div><div>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)</div>
<div><br></div><div>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)</div>
<div><br></div><div><div>Cheers,</div><div>Martin</div></div><div><br></div><div>As an FYI:</div><div><br></div><div><div>--- /usr/lib/python2.6/site-packages/pulp/server/managers/repo/unit_association.py.orig 2014-06-02 15:23:04.606161773 +0100</div>
<div>+++ /usr/lib/python2.6/site-packages/pulp/server/managers/repo/unit_association.py      2014-06-02 15:23:19.350228458 +0100</div><div>@@ -113,9 +113,7 @@</div><div>         # If the association already exists, no need to do anything else</div>
<div>         spec = {'repo_id' : repo_id,</div><div>                 'unit_id' : unit_id,</div><div>-                'unit_type_id' : unit_type_id,</div><div>-                'owner_type' : owner_type,</div>
<div>-                'owner_id' : owner_id,}</div><div>+                'unit_type_id' : unit_type_id}</div><div>         existing_association = RepoContentUnit.get_collection().find_one(spec)</div><div>         if existing_association is not None:</div>
<div>             return</div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 June 2014 19:32, Ashby, Jason (IMS) <span dir="ltr"><<a href="mailto:AshbyJ@imsweb.com" target="_blank">AshbyJ@imsweb.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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).<br>

<br>
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.<br>
<div class="im HOEnZb"><br>
-----Original Message-----<br>
From: Barnaby Court [mailto:<a href="mailto:bcourt@redhat.com">bcourt@redhat.com</a>]<br>
</div><div class="HOEnZb"><div class="h5">Sent: Friday, June 06, 2014 11:01 AM<br>
To: Ashby, Jason (IMS)<br>
Cc: <a href="mailto:pulp-list@redhat.com">pulp-list@redhat.com</a><br>
Subject: Re: [Pulp-list] unable to remove rpms<br>
<br>
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.<br>

<br>
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'.<br>
<br>
-Barnaby<br>
<br>
----- Original Message -----<br>
From: "Jason Ashby (IMS)" <<a href="mailto:AshbyJ@imsweb.com">AshbyJ@imsweb.com</a>><br>
To: "Barnaby Court" <<a href="mailto:bcourt@redhat.com">bcourt@redhat.com</a>><br>
Cc: <a href="mailto:pulp-list@redhat.com">pulp-list@redhat.com</a><br>
Sent: Thursday, June 5, 2014 5:20:43 PM<br>
Subject: RE: [Pulp-list] unable to remove rpms<br>
<br>
Hi Barnaby,<br>
Thanks for the reply.  These are custom rpms that I uploaded with the uploads command:<br>
<br>
    pulp-admin rpm repo uploads rpm --repo-id=Dev-FOO-Custom --file=/tmp/php-foo-5.5.13-1.x86_64.rpm<br>
<br>
The rpms were packaged using fpm if that matters.<br>
<br>
So the following would solve it?:<br>
<br>
    pulp-admin rpm repo remove rpm --repo-id Dev-FOO-Custom --match 'filename=php-foo-5.5.13-1.x86_64.rpm'<br>
    rm -rf /var/lib/pulp/content/rpm/php-foo/5.5.13<br>
    rm -f /var/lib/pulp/published/https/repos/Dev-FOO-Custom/php-foo-5.5.13-1.x86_64.rpm<br>
<br>
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.<br>

<br>
-----Original Message-----<br>
From: Barnaby Court [mailto:<a href="mailto:bcourt@redhat.com">bcourt@redhat.com</a>]<br>
Sent: Thursday, June 05, 2014 5:10 PM<br>
To: Ashby, Jason (IMS)<br>
Subject: Re: [Pulp-list] unable to remove rpms<br>
<br>
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,<br>

<br>
Barnaby<br>
<br>
----- Original Message -----<br>
From: "Jason Ashby (IMS)" <<a href="mailto:AshbyJ@imsweb.com">AshbyJ@imsweb.com</a>><br>
To: <a href="mailto:pulp-list@redhat.com">pulp-list@redhat.com</a><br>
Sent: Thursday, June 5, 2014 4:14:17 PM<br>
Subject: [Pulp-list] unable to remove rpms<br>
<br>
<br>
<br>
Hi,<br>
<br>
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.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
me@pulpserver:~> pulp-admin rpm repo remove rpm --repo-id Dev-FOO-Custom --match 'filename=php-foo-5.5.13-1.x86_64.rpm'<br>
<br>
This command may be exited via ctrl+c without affecting the request.<br>
<br>
<br>
<br>
[-]<br>
<br>
Waiting to begin...<br>
<br>
<br>
<br>
[-]<br>
<br>
Running...<br>
<br>
<br>
<br>
Units:<br>
<br>
php-foo-5.5.13-1-x86_64<br>
<br>
<br>
<br>
<br>
<br>
me@pulpserver:~> pulp-admin repo tasks list --repo-id Dev-FOO-Custom<br>
<br>
+----------------------------------------------------------------------+<br>
<br>
Tasks<br>
<br>
+----------------------------------------------------------------------+<br>
<br>
<br>
<br>
Operations: unassociate<br>
<br>
Resources: Dev-FOO-Custom (repository)<br>
<br>
State: Successful<br>
<br>
Start Time: 2014-06-05T19:56:10Z<br>
<br>
Finish Time: 2014-06-05T19:56:10Z<br>
<br>
Result:<br>
<br>
Type Id: rpm<br>
<br>
Unit Key:<br>
<br>
Arch: x86_64<br>
<br>
Checksum: c2ab8901adb1db8ad5d0798d1c65544151fe1133e1da918d830df95247b662<br>
<br>
21<br>
<br>
Checksumtype: sha256<br>
<br>
Epoch: 0<br>
<br>
Name: php-foo<br>
<br>
Release: 1<br>
<br>
Version: 5.5.13<br>
<br>
Task Id: 03aa6208-2efd-4355-9eeb-ac87fc6473e2<br>
<br>
<br>
<br>
<br>
<br>
Looks successful, now let’s republish:<br>
<br>
<br>
<br>
me@pulpserver:~> pulp-admin rpm repo publish run --repo-id Dev-FOO-Custom<br>
<br>
+----------------------------------------------------------------------+<br>
<br>
Publishing Repository [Dev-FOO-Custom]<br>
<br>
+----------------------------------------------------------------------+<br>
<br>
<br>
<br>
This command may be exited by pressing ctrl+c without affecting the actual<br>
<br>
operation on the server.<br>
<br>
<br>
<br>
Publishing packages...<br>
<br>
[= ] 3%<br>
<br>
Packages: 4/106 items<br>
<br>
Publishing distributions...<br>
<br>
[==================================================] 100%<br>
<br>
Distributions: 0/0 items<br>
<br>
[==================================================] 100%<br>
<br>
Packages: 106/106 items<br>
<br>
... completed<br>
<br>
<br>
<br>
Generating metadata<br>
<br>
[-]<br>
<br>
... completed<br>
<br>
<br>
<br>
Publishing repository over HTTPS<br>
<br>
[-]<br>
<br>
... completed<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
But it’s still present in the repository<br>
<br>
<br>
<br>
me@pulpserver:~> pulp-admin rpm repo content rpm --repo-id Dev-FOO-Custom --match 'filename=php-foo-5.5.13-1.x86_64.rpm'<br>
<br>
Arch: x86_64<br>
<br>
Buildhost: fig<br>
<br>
Checksum: c2ab8901adb1db8ad5d0798d1c65544151fe1133e1da918d830df95247b66221<br>
<br>
Checksumtype: sha256<br>
<br>
Description: no description given<br>
<br>
Epoch: 0<br>
<br>
Filename: php-foo-5.5.13-1.x86_64.rpm<br>
<br>
License: unknown<br>
<br>
Name: php-foo<br>
<br>
Provides: php-foo = 5.5.13-1-0, php-foo(x86-64) = 5.5.13-1-0<br>
<br>
Release: 1<br>
<br>
Requires:<br>
<br>
Vendor: root@fig<br>
<br>
Version: 5.5.13<br>
<br>
<br>
<br>
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:<br>

<br>
<br>
<br>
[Thu Jun 05 15:58:55 2014] [error] Generating sqlite DBs<br>
<br>
[Thu Jun 05 15:58:55 2014] [error] Starting other db creation: Thu Jun 5 15:58:55 2014<br>
<br>
[Thu Jun 05 15:58:55 2014] [error] Ending other db creation: Thu Jun 5 15:58:55 2014<br>
<br>
[Thu Jun 05 15:58:56 2014] [error] Starting filelists db creation: Thu Jun 5 15:58:56 2014<br>
<br>
[Thu Jun 05 15:58:57 2014] [error] Ending filelists db creation: Thu Jun 5 15:58:57 2014<br>
<br>
[Thu Jun 05 15:58:57 2014] [error] Starting primary db creation: Thu Jun 5 15:58:57 2014<br>
<br>
[Thu Jun 05 15:58:57 2014] [error] Ending primary db creation: Thu Jun 5 15:58:57 2014<br>
<br>
[Thu Jun 05 15:58:57 2014] [error] Sqlite DBs complete<br>
<br>
<br>
<br>
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.<br>

<br>
<br>
<br>
Any help would be greatly appreciated!<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
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.<br>

<br>
_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com">Pulp-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-list" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-list</a><br>
<br>
________________________________<br>
<br>
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.<br>

<br>
________________________________<br>
<br>
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.<br>

<br>
_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com">Pulp-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-list" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-list</a></div></div></blockquote></div><br></div>