Bug 796139 - Deleting multiple repos at one go raised: "TypeError: 'NoneType' object is unsubscriptable"
Summary: Deleting multiple repos at one go raised: "TypeError: 'NoneType' object is un...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: RHUA
Version: 2.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: James Slagle
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-22 11:35 UTC by Sachin Ghai
Modified: 2012-08-24 13:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Deleting 20 or more multiple repositories simultaneously causes a traceback error to occur. This update uses an updated version of RHUI that fixes these traceback errors.
Clone Of:
Environment:
Last Closed: 2012-08-24 11:53:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Verifying screen log (173.12 KB, text/plain)
2012-07-19 14:07 UTC, mkovacik
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 796292 0 unspecified CLOSED race condition when deleting lots of repos simultaneously 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2012:1205 0 normal SHIPPED_LIVE RHUI 2.1 Enhancement Update 2012-08-24 15:52:31 UTC

Internal Links: 796292

Description Sachin Ghai 2012-02-22 11:35:38 UTC
Description of problem:
I synced multiple repos and all synced successfully. Then I synced two CDS nodes with RHUA. CDS sync was also successful.

Later I tried to delete multiple synced repos from rhua and this operation raised following traceback in pulp.log and apache's error_log:

error_log:
===========
---
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 581, in delete
    self.packageapi.delete(pkgid, keep_files)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/package.py", line 100, in delete
    pkg["name"], pkg["version"], pkg["release"], pkg["arch"],
TypeError: 'NoneType' object is unsubscriptable
2012-02-22 05:55:37,251 2524:139693744191232: pulp.server.api.repo:ERROR: repo:587 'NoneType' object is unsubscriptable
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 581, in delete
    self.packageapi.delete(pkgid, keep_files)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/package.py", line 100, in delete
    pkg["name"], pkg["version"], pkg["release"], pkg["arch"],
TypeError: 'NoneType' object is unsubscriptable
---

pulp.log:
=======
[Wed Feb 22 05:55:42 2012] [error] Traceback (most recent call last):
[Wed Feb 22 05:55:42 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 581, in delete
[Wed Feb 22 05:55:42 2012] [error]     self.packageapi.delete(pkgid, keep_files)
[Wed Feb 22 05:55:42 2012] [error]   File "/usr/lib/python2.6/site-packages/pulp/server/api/package.py", line 100, in delete
[Wed Feb 22 05:55:42 2012] [error]     pkg["name"], pkg["version"], pkg["release"], pkg["arch"],
[Wed Feb 22 05:55:42 2012] [error] TypeError: 'NoneType' object is unsubscriptable


Version-Release number of selected component (if applicable):
RHEL-6.2-RHUI-2.0.2-20120221.0-Server-x86_64-DVD1.iso

How reproducible:
always

Steps to Reproduce:
1. Delete multiple repos
2.
3.
  
Actual results:
traceback in pulp.log

Expected results:
rhui-manager shouldn't raise any error on repo deletion

Additional info:

Comment 1 Sachin Ghai 2012-02-22 11:36:54 UTC
This error appears while deleting these 34 repos:
=============================================

Enter value (1-44) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1-34

Select one or more repositories:

  Custom Repositories

  Red Hat Repositories
    x  1 : Red Hat Enterprise Linux 5 Server - Supplementary (RPMs) from RHUI (5Server-i386)
    x  2 : Red Hat Enterprise Linux 5 Server - Supplementary (RPMs) from RHUI (5Server-x86_64)
    x  3 : Red Hat Enterprise Linux 5 Server - Supplementary (Source RPMs) from RHUI (5Server-i386)
    x  4 : Red Hat Enterprise Linux 5 Server - Supplementary (Source RPMs) from RHUI (5Server-x86_64)
    x  5 : Red Hat Enterprise Linux 5 Server - Supplementary Beta (Debug RPMs) from RHUI (5Server-i386)
    x  6 : Red Hat Enterprise Linux 5 Server - Supplementary Beta (Debug RPMs) from RHUI (5Server-x86_64)
    x  7 : Red Hat Enterprise Linux 5 Server - Supplementary Beta (RPMs) from RHUI (5Server-i386)
    x  8 : Red Hat Enterprise Linux 5 Server - Supplementary Beta (RPMs) from RHUI (5Server-x86_64)
    x  9 : Red Hat Enterprise Linux 5 Server - Supplementary Beta (Source RPMs) from RHUI (5Server-i386)
    x  10: Red Hat Enterprise Linux 5 Server - Supplementary Beta (Source RPMs) from RHUI (5Server-x86_64)
    x  11: Red Hat Enterprise Linux 6 Server - Optional (Debug RPMs) from RHUI (6Server-i386)
    x  12: Red Hat Enterprise Linux 6 Server - Optional (Debug RPMs) from RHUI (6Server-x86_64)
    x  13: Red Hat Enterprise Linux 6 Server - Optional (RPMs) from RHUI (6Server-i386)
    x  14: Red Hat Enterprise Linux 6 Server - Optional (RPMs) from RHUI (6Server-x86_64)
    x  15: Red Hat Enterprise Linux 6 Server - Optional (Source RPMs) from RHUI (6Server-i386)
    x  16: Red Hat Enterprise Linux 6 Server - Optional (Source RPMs) from RHUI (6Server-x86_64)
    x  17: Red Hat Enterprise Linux 6 Server - Optional Beta (Source RPMs) from RHUI (6Server-i386)
    x  18: Red Hat Enterprise Linux 6 Server - Optional Beta (Source RPMs) from RHUI (6Server-x86_64)
    x  19: Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI (RPMs) (6Server-i386)
    x  20: Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI (RPMs) (6Server-x86_64)
    x  21: Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI(Debug RPMs) (6Server-i386)
    x  22: Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI(Debug RPMs) (6Server-x86_64)
    x  23: Red Hat Enterprise Linux 6 Server - Supplementary (Debug RPMs) from RHUI (6Server-i386)
    x  24: Red Hat Enterprise Linux 6 Server - Supplementary (Debug RPMs) from RHUI (6Server-x86_64)
    x  25: Red Hat Enterprise Linux 6 Server - Supplementary (RPMs) from RHUI (6Server-i386)
    x  26: Red Hat Enterprise Linux 6 Server - Supplementary (RPMs) from RHUI (6Server-x86_64)
    x  27: Red Hat Enterprise Linux 6 Server - Supplementary (Source RPMs) from RHUI (6Server-i386)
    x  28: Red Hat Enterprise Linux 6 Server - Supplementary (Source RPMs) from RHUI (6Server-x86_64)
    x  29: Red Hat Enterprise Linux 6 Server - Supplementary Beta (Debug RPMs) from RHUI (6Server-i386)
    x  30: Red Hat Enterprise Linux 6 Server - Supplementary Beta (Debug RPMs) from RHUI (6Server-x86_64)
    x  31: Red Hat Enterprise Linux 6 Server - Supplementary Beta (RPMs) from RHUI (6Server-i386)
    x  32: Red Hat Enterprise Linux 6 Server - Supplementary Beta (RPMs) from RHUI (6Server-x86_64)
    x  33: Red Hat Enterprise Linux 6 Server - Supplementary Beta (Source RPMs) from RHUI (6Server-i386)
    x  34: Red Hat Enterprise Linux 6 Server - Supplementary Beta (Source RPMs) from RHUI (6Server-x86_64)
    -  35: Red Hat Update Infrastructure 1.2 (Debug RPMs) (5Server-i386)
    -  36: Red Hat Update Infrastructure 1.2 (Debug RPMs) (5Server-x86_64)
    -  37: Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
    -  38: Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
    -  39: Red Hat Update Infrastructure 1.2 (Source RPMs) (5Server-i386)
    -  40: Red Hat Update Infrastructure 1.2 (Source RPMs) (5Server-x86_64)
    -  41: Red Hat Update Infrastructure 2.0 (Debug RPMs) (6Server-i386)
    -  42: Red Hat Update Infrastructure 2.0 (Debug RPMs) (6Server-x86_64)
    -  43: Red Hat Update Infrastructure 2.0 (RPMs) (6Server-i386)
    -  44: Red Hat Update Infrastructure 2.0 (RPMs) (6Server-x86_64)

Enter value (1-44) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


The following repositories will be deleted:
  Red Hat Repositories
    Red Hat Enterprise Linux 5 Server - Supplementary (RPMs) from RHUI (5Server-i386)
    Red Hat Enterprise Linux 5 Server - Supplementary (RPMs) from RHUI (5Server-x86_64)
    Red Hat Enterprise Linux 5 Server - Supplementary (Source RPMs) from RHUI (5Server-i386)
    Red Hat Enterprise Linux 5 Server - Supplementary (Source RPMs) from RHUI (5Server-x86_64)
    Red Hat Enterprise Linux 5 Server - Supplementary Beta (Debug RPMs) from RHUI (5Server-i386)
    Red Hat Enterprise Linux 5 Server - Supplementary Beta (Debug RPMs) from RHUI (5Server-x86_64)
    Red Hat Enterprise Linux 5 Server - Supplementary Beta (RPMs) from RHUI (5Server-i386)
    Red Hat Enterprise Linux 5 Server - Supplementary Beta (RPMs) from RHUI (5Server-x86_64)
    Red Hat Enterprise Linux 5 Server - Supplementary Beta (Source RPMs) from RHUI (5Server-i386)
    Red Hat Enterprise Linux 5 Server - Supplementary Beta (Source RPMs) from RHUI (5Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Optional (Debug RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Optional (Debug RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Optional (RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Optional (RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Optional (Source RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Optional (Source RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Optional Beta (Source RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Optional Beta (Source RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI (RPMs) (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI (RPMs) (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI(Debug RPMs) (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI(Debug RPMs) (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Supplementary (Debug RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Supplementary (Debug RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Supplementary (RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Supplementary (RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Supplementary (Source RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Supplementary (Source RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Supplementary Beta (Debug RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Supplementary Beta (Debug RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Supplementary Beta (RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Supplementary Beta (RPMs) from RHUI (6Server-x86_64)
    Red Hat Enterprise Linux 6 Server - Supplementary Beta (Source RPMs) from RHUI (6Server-i386)
    Red Hat Enterprise Linux 6 Server - Supplementary Beta (Source RPMs) from RHUI (6Server-x86_64)

Proceed? (y/n) y


Deleting Red Hat Enterprise Linux 5 Server - Supplementary (RPMs) from RHUI (5Server-i386)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary (RPMs) from RHUI (5Server-x86_64)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary (Source RPMs) from RHUI (5Server-i386)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary (Source RPMs) from RHUI (5Server-x86_64)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary Beta (Debug RPMs) from RHUI (5Server-i386)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary Beta (Debug RPMs) from RHUI (5Server-x86_64)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary Beta (RPMs) from RHUI (5Server-i386)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary Beta (RPMs) from RHUI (5Server-x86_64)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary Beta (Source RPMs) from RHUI (5Server-i386)...
Deleting Red Hat Enterprise Linux 5 Server - Supplementary Beta (Source RPMs) from RHUI (5Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Optional (Debug RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Optional (Debug RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Optional (RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Optional (RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Optional (Source RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Optional (Source RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Optional Beta (Source RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Optional Beta (Source RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI (RPMs) (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI (RPMs) (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI(Debug RPMs) (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Optional Beta from RHUI(Debug RPMs) (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary (Debug RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary (Debug RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary (RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary (RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary (Source RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary (Source RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary Beta (Debug RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary Beta (Debug RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary Beta (RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary Beta (RPMs) from RHUI (6Server-x86_64)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary Beta (Source RPMs) from RHUI (6Server-i386)...
Deleting Red Hat Enterprise Linux 6 Server - Supplementary Beta (Source RPMs) from RHUI (6Server-x86_64)...

------------------------------------------------------------------------------
rhui (repo) => ^

Comment 2 Sachin Ghai 2012-02-22 11:44:33 UTC
All repos deleted successfully but with above traceback in pulp.log. 

Later I tried to delete few more in one go. These were smaller repos but this time I didn't get any traceback and repos were deleted successfully

--
The following repositories will be deleted:
  Red Hat Repositories
    Red Hat Update Infrastructure 1.2 (Debug RPMs) (5Server-i386)
    Red Hat Update Infrastructure 1.2 (Debug RPMs) (5Server-x86_64)
    Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
    Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
    Red Hat Update Infrastructure 1.2 (Source RPMs) (5Server-i386)
    Red Hat Update Infrastructure 1.2 (Source RPMs) (5Server-x86_64)
    Red Hat Update Infrastructure 2.0 (Debug RPMs) (6Server-i386)
    Red Hat Update Infrastructure 2.0 (Debug RPMs) (6Server-x86_64)
    Red Hat Update Infrastructure 2.0 (RPMs) (6Server-i386)

Proceed? (y/n) y


Deleting Red Hat Update Infrastructure 1.2 (Debug RPMs) (5Server-i386)...
Deleting Red Hat Update Infrastructure 1.2 (Debug RPMs) (5Server-x86_64)...
Deleting Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)...
Deleting Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)...
Deleting Red Hat Update Infrastructure 1.2 (Source RPMs) (5Server-i386)...
Deleting Red Hat Update Infrastructure 1.2 (Source RPMs) (5Server-x86_64)...
Deleting Red Hat Update Infrastructure 2.0 (Debug RPMs) (6Server-i386)...
Deleting Red Hat Update Infrastructure 2.0 (Debug RPMs) (6Server-x86_64)...
Deleting Red Hat Update Infrastructure 2.0 (RPMs) (6Server-i386)...

---


So I guess the issue appears when we delete multiple repos ( around 20-30) in one go.

Comment 3 James Slagle 2012-02-22 14:39:23 UTC
I can try to reproduce this, but I'm thinking this is probably a not fix for RHUI 2.0.2.  It definitely looks like a race condition when deleting large amounts of repos simultaneously.  As this also would affect Pulp, I'm going to file a Pulp bug for this as well.

Comment 4 James Slagle 2012-02-22 16:04:57 UTC
punting to next release

Comment 5 James Slagle 2012-05-08 19:44:25 UTC
the associated pulp bug is now VERIFIED.  just need to confirm this got committed to the rhui branch.

Comment 6 wes hayutin 2012-05-23 14:06:18 UTC
(In reply to comment #5)
> the associated pulp bug is now VERIFIED.  just need to confirm this got
> committed to the rhui branch.

I can't find a related pulp bug, at least by searching for delete or repo.  I'm not able to recreate the delete issue listed in this bug running against pulp-master. I'll try w/ the rhui branch

Comment 7 James Slagle 2012-06-12 01:40:26 UTC
QA: try to delete many repos (20+) at once.  You should not get this traceback.

Comment 8 mkovacik 2012-07-19 14:07:41 UTC
Created attachment 599158 [details]
Verifying screen log

The tracebak didn't happen while exercizing the repositories (even with an ongoing sync). See the attached screen log.

Comment 9 mkovacik 2012-07-19 14:08:14 UTC
Switching to Verified based on comment 8...

Comment 10 Athene Chan 2012-08-14 04:46:20 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Deleting 20 or more multiple repositories simultaneously causes a traceback error to occur. This update uses an updated version of RHUI that fixes these traceback errors.

Comment 12 errata-xmlrpc 2012-08-24 11:53:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-1205.html


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