Bug 567659

Summary: If there are duplicate Requires in .rpm, rhnpush causes 500 ISE
Product: [Community] Spacewalk Reporter: Jan Pazdziora <jpazdziora>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: low    
Version: 0.8CC: cweyl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 567633
: 568291 (view as bug list) Environment:
Last Closed: 2010-03-17 14:06:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 559281, 568291    

Description Jan Pazdziora 2010-02-23 15:31:14 UTC
+++ This bug was initially created as a clone of Bug #567633 +++

Description of problem:
I've attempted to upload the package perl-DBIx-Class-0.08108-1.fc12.noarch.rpm 
to Red Hat Satellite via rhnpush. 

After a couple of seconds, the following error message appears:
Internal server error 500 Internal Server Error Error pushing
/root/mirror.switch.ch/mirror/fedora/linux/releases/12/Everything/x86_64/os/Packages/perl-DBIx-Class-0.08108-1.fc12.noarch.rpm :
Error 500Error Message:
    ORA-00001: unique constraint (RHNSAT.RHN_PKG_REQ_PID_CID_S_UQ) violated
Error Class Code: 54 Error Class Info:  
     Package Upload Failed due to uniqueness constraint violation.
     Make sure the package does not have any duplicate dependencies or
     does not already exists on the server (500) Waiting 5 seconds and trying
again...
Internal server error 500 Internal Server Error Error pushing
/root/mirror.switch.ch/mirror/fedora/linux/releases/12/Everything/x86_64/os/Packages/perl-DBIx-Class-0.08108-1.fc12.noarch.rpm :
Error 500Error Message:
    ORA-00001: unique constraint (RHNSAT.RHN_PKG_REQ_PID_CID_S_UQ) violated
Error Class Code: 54 Error Class Info:  
     Package Upload Failed due to uniqueness constraint violation.
     Make sure the package does not have any duplicate dependencies or
     does not already exists on the server (500) Waiting 5 seconds and trying
again...
Internal server error 500 Internal Server Error Error pushing
/root/mirror.switch.ch/mirror/fedora/linux/releases/12/Everything/x86_64/os/Packages/perl-DBIx-Class-0.08108-1.fc12.noarch.rpm :
Error 500Error Message:
    ORA-00001: unique constraint (RHNSAT.RHN_PKG_REQ_PID_CID_S_UQ) violated
Error Class Code: 54 Error Class Info:  
     Package Upload Failed due to uniqueness constraint violation.
     Make sure the package does not have any duplicate dependencies or
     does not already exists on the server (500) Waiting 1 seconds and trying
again...
Giving up after 3 attempts 

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


How reproducible:
rhnpush -d Packages/ -c fedora12-stag --server=satellite.example.com --force

Steps to Reproduce:
1. rhnpush -d Packages/ -c fedora12-stag --server=satellite.example.com --force
2.
3.

Actual results:
Can't upload package.

Expected results:
Upload package.

Additional info:
There is the suspicion the error occures because of multiple requires for the
same "package dependencies":
rpm -q --requires -p perl-DBIx-Class-0.08108-1.fc12.noarch.rpm
perl(:MODULE_COMPAT_5.10.0)  
rpmlib(VersionedDependencies) <= 3.0.3-1
perl(Class::Accessor::Grouped) >= 0.08003
perl(Class::C3::Componentised) >= 1.0005
perl(SQL::Abstract) >= 1.56
perl(Carp::Clan) >= 6
perl(Class::Inspector) >= 1.24
perl(DBD::SQLite) >= 1.25
perl(DBI) >= 1.605
perl(Data:age) >= 2
perl(JSON::Any) >= 1.18
perl(List::Util)  
perl(MRO::Compat) >= 0.09
perl(Module::Find) >= 0.06
perl(Path::Class) >= 0.16
perl(SQL::Abstract::Limit) >= 0.13
perl(Scalar::Util)  
perl(Scope::Guard) >= 0.03
perl(Storable)  
perl(Sub::Name) >= 0.04
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(VersionedDependencies) <= 3.0.3-1
perl(base)  
perl(Carp)  
perl(Carp::Clan)  
perl(Class::Inspector)  
perl(Class::Trigger)  
perl(Clone)  
perl(Data:umper)  
perl(Data:age)  
perl(DBI)  
perl(DBIx::Class::CDBICompat::Relationship)  
perl(DBIx::Class::ClassResolver:assThrough)  
perl(DBIx::Class::Exception)  
perl(DBIx::Class::ResultSet)  
perl(DBIx::Class::ResultSetColumn)  
perl(DBIx::Class::ResultSourceHandle)  
perl(DBIx::Class::ResultSource::Table)  
perl(DBIx::Class::Schema)  
perl(DBIx::Class::StartupCheck)  
perl(DBIx::Class::Storage:BI)  
perl(DBIx::Class::Storage:BI::Cursor)  
perl(DBIx::Class::Storage:BI::Replicated::Balancer)  
perl(DBIx::Class::Storage:BI::Replicated:ool)  
perl(DBIx::Class::Storage:BI::Replicated::Replicant)  
perl(DBIx::Class::Storage:BI::Replicated::Types)  
perl(DBIx::Class::Storage::Statistics)  
perl(DBIx::Class::Storage::TxnScopeGuard)  
perl(DBIx::ContextualFetch)  
perl(Exporter)  
perl(File::Copy)  
perl(File:ath)  
perl(File::Spec)  
perl(Getopt::Long)  
perl(Hash::Merge)  
perl(IO::File)  
perl(JSON::Any)  
perl(List::Util)  
perl(Module::Find)  
perl(Moose)  
perl(Moose::Role)  
perl(MooseX::AttributeHelpers)  
perl(MooseX::Types::Moose)  
perl(mro)  
perl(MRO::Compat)  
perl(namespace::clean)  
perl(overload)  
perl(Path::Class)  
perl(Pod::Usage)  
perl(POSIX)  
perl(Scalar::Util)  
perl(Scope::Guard)  
perl(SQL::Translator::Schema::Constants)  
perl(SQL::Translator::Utils)  
perl(Storable)  
perl(strict)  
perl(Sub::Name)  
perl(vars)  
perl(warnings)  
rpmlib(VersionedDependencies) <= 3.0.3-1
/usr/bin/perl  
rpmlib(PayloadIsXz) <= 5.2-1

--- Additional comment from ndevos on 2010-02-23 09:45:32 EST ---

The actual problem is that there are duplicate requires in the RPM. These are not allowed by Satellite/Spacewalk and should be prevented:

$ rpm -q --requires -p perl-DBIx-Class-0.08108-1.fc12.noarch.rpm | sort > perl-DBIx-Class-0.08108-1.fc12.noarch.rpm.full
$ rpm -q --requires -p perl-DBIx-Class-0.08108-1.fc12.noarch.rpm | sort -u > perl-DBIx-Class-0.08108-1.fc12.noarch.rpm.filtered
$ diff -u perl-DBIx-Class-0.08108-1.fc12.noarch.rpm.full perl-DBIx-Class-0.08108-1.fc12.noarch.rpm.filtered
--- perl-DBIx-Class-0.08108-1.fc12.noarch.rpm.full	2010-02-23 14:37:47.138900460 +0000
+++ perl-DBIx-Class-0.08108-1.fc12.noarch.rpm.filtered	2010-02-23 14:37:56.291901898 +0000
@@ -42,7 +42,6 @@
 perl(JSON::Any)  
 perl(JSON::Any) >= 1.18
 perl(List::Util)  
-perl(List::Util)  
 perl(:MODULE_COMPAT_5.10.0)  
 perl(Module::Find)  
 perl(Module::Find) >= 0.06
@@ -60,7 +59,6 @@
 perl(Pod::Usage)  
 perl(POSIX)  
 perl(Scalar::Util)  
-perl(Scalar::Util)  
 perl(Scope::Guard)  
 perl(Scope::Guard) >= 0.03
 perl(SQL::Abstract) >= 1.56
@@ -68,7 +66,6 @@
 perl(SQL::Translator::Schema::Constants)  
 perl(SQL::Translator::Utils)  
 perl(Storable)  
-perl(Storable)  
 perl(strict)  
 perl(Sub::Name)  
 perl(Sub::Name) >= 0.04

Comment 1 Jan Pazdziora 2010-02-23 15:32:00 UTC
While it's nice to remind people that they should not have duplicate Requires, we might want to be less strict and just remove those duplicates before trying to insert to database.

Comment 2 Michael Mráka 2010-03-17 14:06:23 UTC
This issue has been fixed in Spacewalk 0.6.

*** This bug has been marked as a duplicate of bug 513073 ***