Bug 219808 - RHNSat5 rhnpush failure unique constraint (RHNSAT.RHN_CNP_CID_NID_UQ) violated
Summary: RHNSat5 rhnpush failure unique constraint (RHNSAT.RHN_CNP_CID_NID_UQ) violated
Keywords:
Status: CLOSED DUPLICATE of bug 429777
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 500
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Pradeep Kilambi
QA Contact: Brandon Perkins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-15 15:55 UTC by Matt Domsch
Modified: 2008-10-29 14:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-10-29 14:21:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
traceback.txt (49.71 KB, text/plain)
2006-12-15 15:55 UTC, Matt Domsch
no flags Details
rhn.bz2 mbox file (391.47 KB, application/octet-stream)
2006-12-15 16:12 UTC, Matt Domsch
no flags Details

Description Matt Domsch 2006-12-15 15:55:40 UTC
Description of problem:
I created a clone of each of the RHEL5 Server i386 and x86_64 channels and tried
to push new snapshot RPMs into those channels using rhnpush.  It failed after
uploading a lot of packages with the above error and traceback.

Further satellite-sync runs succeed fine.

Version-Release number of selected component (if applicable):
RHN Satellite Server beta 4.9

How reproducible:
often

Steps to Reproduce:
1. rhnpush into a channel

Actual results:
traceback

Expected results:
success

Additional info:

Comment 1 Matt Domsch 2006-12-15 15:55:41 UTC
Created attachment 143773 [details]
traceback.txt

Comment 2 Matt Domsch 2006-12-15 16:12:12 UTC
Created attachment 143778 [details]
rhn.bz2 mbox file

in fact, a lot of unique constraints were violated.  29 tracebacks were sent to
my email.  I attach an mbox file (bz2 compressed) with all of them.

Comment 3 Pradeep Kilambi 2006-12-15 18:04:48 UTC
I have seen this issue before. This is due to a race condition, usually happens
when we try to repush a redhat owned package(with null on server) as a non-null
org . This results in a situation where the package to be uploaded is
available on that particular channel with same nvrea but different orgs.

So as it has different orgs it calculates a new packageid for this package and
hence uploads the same package with different pids into the rhnchannelPackage
 table and so does insert it as a new package.

Now in the next step when it calls rhn_channel.refresh_newest_package,
it does :
inserts a row into rhnChannelNewestPackage with channel_id, name_id, evr_id,
package_id, package_arch_id.
and thats when it hits the uniqueness constraint error ...

I already have a bugzilla aligned to this:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196471

looks like you are hitting the same case here.



Comment 4 Pradeep Kilambi 2006-12-15 18:40:57 UTC
So What I think is happening is, when you created a clone channel for
RHEL5Server i386/x86_64 that already has a RHEL5 Server i386 and x86_64 related
packages(which it probably does as its cloning) you cannot repush these packages
with your orgid as the packages in the cloned channel will probably have the
same org as its parent(which is different from whatever yours is) and hence the
constraint.

Ideally rhnpush should not allow you to do that and throw an exception.

one question I want to ask is, why are you trying to repush RHEL5 Server
packages when you cloned it. Cloning basically mirrors the original channel, so
it should already have rhel5 server i386 and x86 packages same as parent channel.
 

Comment 5 Matt Domsch 2006-12-16 14:24:36 UTC
RHN isn't carrying updated content for RHEL5 beta (e.g. the weekly snapshots we
can get being a Red Hat development partner).  For our testers that want to use
the RHN Satellite to keep their systems-under-test current, either I need to
have a channel on the satellite or need to set up a local yum repo for the new
weekly content.  Hence a rawhide channel I made.

Comment 6 Red Hat Bugzilla 2007-04-12 02:06:51 UTC
User bnackash's account has been closed

Comment 8 Matt Domsch 2008-10-29 14:21:55 UTC
These have been open for years with no investigation or resolution.  Since then the code base has moved on significantly, such that many of these no longer would apply to the current spacewalk code.  I'm closing these requests in the hope they're no longer necessary, or if they are, they'll get discovered anew.


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