Bug 843367

Summary: ISE when rhnpushing multiple packages
Product: [Community] Spacewalk Reporter: Tomáš Kašpárek <tkasparek>
Component: ServerAssignee: Jan Dobes <jdobes>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.8CC: cperry, jdobes, jpazdziora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-schema-1.10.33, spacewalk-backend-1.10.30 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-02 13:16:08 UTC Type: Bug
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: 991452    
Attachments:
Description Flags
Traceback email none

Description Tomáš Kašpárek 2012-07-26 07:03:25 UTC
Created attachment 600444 [details]
Traceback email

Description of problem:
I was rhnpushing multiple packages from Fedora17 install DVD and I was getting random ISE.


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


How reproducible:
these ISE seemed random for me, I got 2 in 5 minutes and then for 2 hours nothing

Steps to Reproduce:
1. rhnpush contents of any (i recommend fedora17) installation DVD to a custom channel

  
Actual results:
ISE message when pushing packages with rhnpush


Expected results:
No errors


Additional info:
Even if I get ISE when pushing a package I can still see it in Spacewalk web UI in package listing for my custom channel

Comment 1 Michael Mráka 2012-08-10 08:48:36 UTC
Traceback says
SQLError: (1, 'ORA-00001: unique constraint (SPACEUSER.RHN_SRPM_NAME_UQ) violated\n', 'insert into rhnSourceRPM (id, name) values (:id, :value)')
so you were pushing source RPMs, weren't you?

Comment 2 Tomáš Kašpárek 2012-08-10 08:55:49 UTC
I was pushing only contents of Fedora17 installation DVD, and as far as i know there are no sRPMs present
tried ls -R | grep src in Packages folder and no results ...

Comment 3 Jan Pazdziora (Red Hat) 2013-03-08 14:52:44 UTC
The rhnSourceRPM table only holds a id => name lookup and is referenced for example by rhnPackage.source_rpm_id.

Comment 4 Jan Pazdziora (Red Hat) 2013-03-08 15:03:57 UTC
(In reply to comment #0)
> Created attachment 600444 [details]
> Traceback email
> 
> Description of problem:
> I was rhnpushing multiple packages from Fedora17 install DVD and I was
> getting random ISE.
> 
> 
> Version-Release number of selected component (if applicable):
> Spacewalk 1.8 (nightly)
> 
> 
> How reproducible:
> these ISE seemed random for me, I got 2 in 5 minutes and then for 2 hours
> nothing
> 
> Steps to Reproduce:
> 1. rhnpush contents of any (i recommend fedora17) installation DVD to a
> custom channel

Were you by any chance running some other pushing or syncing process in parallel? Possibly of completely different channel / yum repository?

Checking the backend code, the logic there is pretty straightforward -- for keys of hash, select from the table where name = ?, if we don't get the id, get the id from sequence and run insert for the new id and the name pair.

Comment 5 Jan Dobes 2013-05-06 14:38:58 UTC
Traceback says you are trying to insert duplicated values. The backend logic is: select ids and if they aren't there, insert them. We are not limiting count of rhnpush/sync instances running at once, so if first rhnpush does select and second rhnpush does select before first does insert, this happens. This can be maybe improved by adding some synchronization mechanisms. But actually it isn't bug because packages are successfully pushed when rhnpush automatically tries it again.

Comment 6 Jan Dobes 2013-05-13 15:39:05 UTC
improved in spacewalk git master: eb0eba65a0672a1a36714fe8f494d45731345723

Comment 7 Tomáš Kašpárek 2013-08-02 13:16:08 UTC
Fix for this bug is present in Spacewalk 2.0, closing this bug as CURRENTRELEASE.