Bug 970804

Summary: ORA-02291: integrity constraint (SPACEWALK.RHN_PACKAGESYNCBL_PNID_FK) violated - parent key
Product: [Community] Spacewalk Reporter: ajohnson
Component: InstallationAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 1.9CC: chalal, jpazdziora, tkasparek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-02 13:13:16 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
populate.db.log none

Description ajohnson 2013-06-04 23:28:27 UTC
Created attachment 757011 [details]
populate.db.log

Description of problem:

Oracle database 
spacewalk-setup --disconnected --external-db 

the Spacewalk installation fails with the following error in /var/log/rhn/populate_db.log

ORA-02291: integrity constraint (SPACEWALK.RHN_PACKAGESYNCBL_PNID_FK) violated - parent key



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

How reproducible:
Yes every time clean database 

Steps to Reproduce:
1. spacewalk-setup --disconnected --external-db
2.
3.

Actual results:

ORA-02291: integrity constraint (SPACEWALK.RHN_PACKAGESYNCBL_PNID_FK) violated - parent key

Expected results:
spacewalk would build all tables without error out. 




Additional info:

Here is the problem that oracle found.

diff -u /etc/sysconfig/rhn/oracle/main.sql-20110504 /etc/sysconfig/rhn/oracle/main.sql
--- main.sql-20110504	2011-04-08 21:40:53.000000000 +0200
+++ main.sql	2011-05-04 14:20:24.000000000 +0200
@@ -38940,6 +38940,12 @@
 
 
 -- Source: data/common/rhnPackageSyncBlacklist.sql
+
+select lookup_package_name('gpg-pubkey') from dual;
+
+select lookup_package_name('rhns-ca-cert') from dual;
+
+select lookup_package_name('rhn-org-trusted-ssl-cert') from dual;
     
 insert into rhnPackageSyncBlacklist (package_name_id)
 	values (lookup_package_name('gpg-pubkey'));

Comment 1 Jan Pazdziora (Red Hat) 2013-06-05 06:19:36 UTC
(In reply to ajohnson from comment #0)
> 
> Additional info:
> 
> Here is the problem that oracle found.
> 
> diff -u /etc/sysconfig/rhn/oracle/main.sql-20110504
> /etc/sysconfig/rhn/oracle/main.sql
> --- main.sql-20110504	2011-04-08 21:40:53.000000000 +0200
> +++ main.sql	2011-05-04 14:20:24.000000000 +0200
> @@ -38940,6 +38940,12 @@
>  
>  
>  -- Source: data/common/rhnPackageSyncBlacklist.sql
> +
> +select lookup_package_name('gpg-pubkey') from dual;
> +
> +select lookup_package_name('rhns-ca-cert') from dual;
> +
> +select lookup_package_name('rhn-org-trusted-ssl-cert') from dual;
>      
>  insert into rhnPackageSyncBlacklist (package_name_id)
>  	values (lookup_package_name('gpg-pubkey'));

This patch is incomplete and incorrect.

Comment 2 Jan Pazdziora (Red Hat) 2013-06-05 06:39:28 UTC
Please see bug 965305 comment 8.

Comment 3 Jan Pazdziora (Red Hat) 2013-06-05 06:41:16 UTC
Addressed in Spacewalk master, d2e4546fe40ca153ae7711366c21b6cf9d84ef1a and 66f17625b25ff470743ac4b197c6a47ba18f392b.

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