"ORA-00001: unique constraint (RHNSAT.RHN_PKEY_KEYID_UQ) violated" during schema-upgrade in RHBA-2011:0387

Solution Verified - Updated -

Issue

  • When applying the errata RHBA-2011:0387 to fix "provider unknown" issue. Bug 671464 it failed with following error message in satellite-schema log

    SQL> whenever sqlerror exit sql.sqlcode
    SQL> select 'satellite-schema-5.4.0.9-to-satellite-schema-5.4.0.10/017-rhnPackageKey-data.sql' from dual;
    
    'SATELLITE-SCHEMA-5.4.0.9-TO-SATELLITE-SCHEMA-5.4.0.10/017-RHNPACKAGEKEY-DATA.SQ
    --------------------------------------------------------------------------------
    satellite-schema-5.4.0.9-to-satellite-schema-5.4.0.10/017-rhnPackageKey-data.sql
    
    SQL> insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
      2  (sequence_nextval('rhn_pkey_id_seq'), '7edc6ad6e8e40fde', lookup_package_key_type('gpg'), lookup_package_provider('Fedora'));
    
    1 row created.
    
    SQL> insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
      2  (sequence_nextval('rhn_pkey_id_seq'), '421caddb97a1071f', lookup_package_key_type('gpg'), lookup_package_provider('Fedora'));
    
    1 row created.
    
    SQL>
    SQL> insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
      2  (sequence_nextval('rhn_pkey_id_seq'), 'ed635379b3892132', lookup_package_key_type('gpg'), lookup_package_provider('Spacewalk'));
    
    1 row created.
    
    SQL>
    SQL> insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
      2  (sequence_nextval('rhn_pkey_id_seq'), '199e2f91fd431d51', lookup_package_key_type('gpg'), lookup_package_provider('Red Hat Inc.'));
    insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
    *
    ERROR at line 1:
    ORA-00001: unique constraint (RHNSAT.RHN_PKEY_KEYID_UQ) violated
    

Environment

  • Red Hat Network satellite 5.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content