Bug 568291 - If there are duplicate Requires in .rpm, rhnpush causes 500 ISE
Summary: If there are duplicate Requires in .rpm, rhnpush causes 500 ISE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 530
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Šimon Lukašík
URL:
Whiteboard:
Depends On: 567659
Blocks: sat540-blockers
TreeView+ depends on / blocked
 
Reported: 2010-02-25 10:17 UTC by Vishal Gaikwad
Modified: 2018-11-14 20:18 UTC (History)
7 users (show)

Fixed In Version: spacewalk-backend-0.6.26-1
Doc Type: Bug Fix
Doc Text:
Clone Of: 567659
Environment:
Last Closed: 2010-10-28 15:02:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Vishal Gaikwad 2010-02-25 10:17:33 UTC
+++ This bug was initially created as a clone of Bug #567659 +++

+++ 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

--- Additional comment from jpazdziora on 2010-02-23 10:32:00 EST ---

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:14:59 UTC
Has been fixed in Spacewalk 0.6, bug 513073.

Relevant commits in spacewalk git:
commit 88e29677361c7051475f4e53a796b5182119bc54
    513073 - Fix rhnpush of packages with duplicate requires.
    Detects duplicate requires/provides/obsoletes/conflicts based on a hash
    of name/version/flags.
commit 3de5d3f48d67c8fcb40c924633638cf2bf06f5fe
    502060 - The uniquify filter for deps is causing missing deps in repodata gen as we

Comment 4 Šimon Lukašík 2010-10-04 07:34:23 UTC
QA: Changing to VERIFIED:

Testing procedure:
Automated test run.

Verified against:
Satellite-5.4.0-RHEL5-re20101001.1

Comment 5 Miroslav Suchý 2010-10-25 19:18:54 UTC
verified in stage
package is pushed into satellite
dependencies of that package in webUI shows duplicates in the same place as "rpm -qR"

Comment 6 Clifford Perry 2010-10-28 14:56:42 UTC
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 


RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332

RHEA-2010:0803 - RHN Tools enhancement update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334

RHEA-2010:0800 - RHN Satellite Server 5.4.0
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335

Docs are available:

http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html 

Regards,
Clifford


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