Description of problem: rhn_sat_node should have uniq constraint on column server_id Try to run this script twice: use RHN::Utils; use RHN::SatCluster; my $hostname = "vmware113.englab.brq.redhat.com"; my $vip = RHN::Utils::find_ip_address($hostname); my $sc = new RHN::SatCluster(customer_id => 1, description => "chod inam", last_update_user => 'installer', server_id => '1000010492', vip => $vip, ); $sc->create_new(); my $key = RHN::SatCluster->fetch_key($sc->recid); print "$key\n"; note: substitute hostename and server id for some machine you have registred to your satellite. If you run it twice you will get two scouts for the same machine. Which is what we do not want Version-Release number of selected component (if applicable): sat530 How reproducible: always Steps to Reproduce: 1. run twice given script Actual results: two scouts in webui Expected results: second run of script fail and only one scout in webui. Additional info:
Commited as e63a160a151d4ed0cd3312ecde90f8181fb81fbb Now insert of second scout on the same machine should give error. The given script shoud say: # perl /tmp/a.pl RHN::Exception: DBD::Oracle::st execute failed: ORA-00001: unique constraint (RHNSAT.RHN_SAT_NODE_SID_IDX) violated (DBD ERROR: OCIStmtExecute) [for Statement " INSERT INTO rhn_sat_node ( ....
verified ISO: Satellite-5.3.0-RHEL5-re20090529.0-i386-embedded-oracle.iso msuchy [root@rlx-3-24 ~]# perl -wc script.sh msuchy script.sh syntax OK msuchy [root@rlx-3-24 ~]# perl script.sh msuchy 4070f1ca306b msuchy [root@rlx-3-24 ~]# perl script.sh msuchy RHN::Exception:
Verified in stage: script above generates ORA-02291 SQL> select index_name, table_name, uniqueness from user_indexes where index_name = upper('rhn_sat_node_sid_idx'); INDEX_NAME TABLE_NAME UNIQUENES ------------------------------ ------------------------------ --------- RHN_SAT_NODE_SID_IDX RHN_SAT_NODE UNIQUE RELEASE_PENDING
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-1434.html