Bug 970804 - ORA-02291: integrity constraint (SPACEWALK.RHN_PACKAGESYNCBL_PNID_FK) violated - parent key
Summary: ORA-02291: integrity constraint (SPACEWALK.RHN_PACKAGESYNCBL_PNID_FK) violate...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Installation
Version: 1.9
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Jan Pazdziora
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space20
TreeView+ depends on / blocked
 
Reported: 2013-06-04 23:28 UTC by ajohnson
Modified: 2017-07-13 08:19 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-02 13:13:16 UTC
Embargoed:


Attachments (Terms of Use)
populate.db.log (109.25 KB, text/plain)
2013-06-04 23:28 UTC, ajohnson
no flags Details

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 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 2013-06-05 06:39:28 UTC
Please see bug 965305 comment 8.

Comment 3 Jan Pazdziora 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.


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