Bug 985947

Summary: attempt to register RHEL5-GOLD system twice generates 'IntegrityError: duplicate key value violates unique constraint "rhn_sp_snep_uq"' in error_log
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED WORKSFORME QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: cperry
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-03 13:58:03 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: 924171    

Description Jan Hutař 2013-07-18 14:51:44 UTC
Description of problem:
When you attempt to register RHEL5-GOLD system twice, it generates 'IntegrityError: duplicate key value violates unique constraint "rhn_sp_snep_uq"' in error_log on Satellite and systemid file is missing on the client.


Version-Release number of selected component (if applicable):
Server:
  spacewalk-backend-1.9.46-23.el6sat.noarch
  spacewalk-java-1.9.83-46.el6sat.noarch
Client:
  rhn-client-tools-0.4.13-1.el5
  rhnlib-2.2.5-1.el5


How reproducible:
1 of 1


Steps to Reproduce:
1. Register RHEL5-GOLD system to Satellite 5.6.0
2. Then try again and again ... I have used `while true...`
   # rhnreg_ks --force --username=<user> --password=<pass>


Actual results:
On client:

# rhnreg_ks --force --username=admin --password=nimda
An error has occurred:
Connection timed out on readline
See /var/log/up2date for more information

On Satellite in error_log

IntegrityError: duplicate key value violates unique constraint "rhn_sp_snep_uq"


Expected results:
Should work


Additional info:
This might be related to bug 924179 or is just caused by already fixed bug in this old RHEL Client tools.

I'm reporting this mostly to have a decision whether this use case (see steps above) is a problem for 5.6.0 or not.

Comment 1 Jan Hutař 2013-07-19 08:23:22 UTC
And this is in the DB log:

2013-07-18 11:05:06.625 EDT ERROR:  duplicate key value violates unique constraint "rhn_sp_snep_uq"
2013-07-18 11:05:06.625 EDT STATEMENT:  
                    insert into rhnServerPackage
                    (server_id, name_id, evr_id, package_arch_id, installtime)
                    values (1000010005, LOOKUP_PACKAGE_NAME(E'indent'), LOOKUP_EVR(NULL, E'2.2.9', E'14.fc6'),
                        LOOKUP_PACKAGE_ARCH(E'x86_64'), TO_TIMESTAMP(E'2013-07-18 04:50:54', 'YYYY-MM-DD HH24:MI:SS')
                    )