Bug 494920

Summary: Cloning errata to a custom channel causes ISE
Product: Red Hat Satellite 5 Reporter: Sayli Karmarkar <skarmark>
Component: ServerAssignee: Justin Sherrill <jsherril>
Status: CLOSED CURRENTRELEASE QA Contact: Sayli Karmarkar <skarmark>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: bperkins, cperry
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 20:35:23 UTC Type: ---
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: 456985    
Attachments:
Description Flags
before confirming update errata
none
after clicking on update errata none

Description Sayli Karmarkar 2009-04-08 17:51:16 UTC
Description of problem:
If we create a clone of a channel with select errata and then go back to manage that channel and try to clone some more errata, its giving an ISE. 

Steps to Reproduce:
1. Create a clone of a channel which has associated errata.
2. Choose "select errata" when cloning channel and leave out 4-5 errata and clone rest of them. 
3. Now go back to manage software channels -> cloned channel -> errata
4. select clone from the tab 
5. It will show 4-5 errata that can be cloned. 
6. Confirm clone errata. 
  
Actual results:
ISE

Expected results:
no ISE and errata should get cloned

Comment 1 Sayli Karmarkar 2009-04-08 17:54:28 UTC
Created attachment 338769 [details]
before confirming update errata

Comment 2 Sayli Karmarkar 2009-04-08 17:55:07 UTC
Created attachment 338770 [details]
after clicking on update errata

Comment 3 Justin Sherrill 2009-04-15 17:22:29 UTC
The following exception occurred while executing this request:
 POST /network/software/channels/manage/errata/clone_confirm.pxt HTTP/1.1 (from browser)
 /network/software/channels/manage/errata/clone_confirm.pxt (from Apache)

Date:
  Wed Apr 15 13:12:14 2009

Headers:
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  Accept-Encoding: gzip,deflate
  Accept-Language: en-us,en;q=0.5
  Connection: keep-alive
  Content-Length: 415
  Content-Type: application/x-www-form-urlencoded
  Cookie: rh_omni_tc=70160000000H4AoAAK; s_vi=[CS]v1|4907A59100005110-A3A0813000024B9[CE]; pysid=8d5c57c20bf108138f785de0728e1b69; s_cc=true; s_sq=redhatglobal%2Credhatcom%3D%2526pid%253Dhttps%25253A//www.redhat.com/wapps/sso/rhn/login.html%25253Fredirect%25253Dhttp%2525253A%2525252F%2525252Frhn.redhat.com%2525252Frhn%2525252FYourRhn.do%2526oid%253DLog%252520In%2526oidt%253D3%2526ot%253DSUBMIT; rh_sso=0|7GbUuTHxzYDOmBnKBIhEcbskrxHklce0bmH; rh_user=rhn-support-jsherril|Justin|member; rh_shared_auth=853cc4631a145cc3ee10e99806d34522f946f410e4f1e00846f179a2fc4b87df5c2f90d4ff5a7b91b3f28b324537638e2d6e18c56622c4291da0a489fb05de2673744e5e94a9cb27dac74b5b13c254d446ef76192932c7d92816b36015a51652; pxt-session-cookie=29986xa8f926ef886cc166cf88a21df1d3c8e0
  Host: columbia.devel.redhat.com
  Keep-Alive: 300
  Referer: https://columbia.devel.redhat.com/network/software/channels/manage/errata/clone_confirm.pxt?cid=931
  User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009030503 Fedora/3.0.7-1.fc10 Firefox/3.0.7

Form variables:
  alphabar_column => 
  cid => 931
  first_lower => 1
  first_upper => 250
  formvars => alphabar_column
  formvars => alphabar_column
  last_lower => 1
  last_upper => 4
  list_action_label_confirm_errata_application => Update Errata
  list_action_url_confirm_errata_application => /network/software/channels/manage/index.pxt
  list_mode => potential_for_cloned_channel
  lower => 1
  next_lower => 1
  next_upper => 4
  prev_lower => 1
  prev_upper => 250
  pxt:trap => rhn:errata_list_cb
  upper => 4

User Information:
  User admin (id 1, org_id 1)

Error notes:
  (none)

Initial Request:
  Yes

Error message:
  RHN::Exception: DBD::Oracle::st execute failed: ORA-00001: unique constraint (RHNSAT.RHN_CE_CE_UQ) violated (DBD ERROR: OCIStmtExecute) [for Statement "INSERT INTO rhnChannelErrata
       (errata_id, channel_id)
VALUES (:eid, :cid)
" with ParamValues: :eid=6944, :cid='931']
  RHN::DB /var/www/lib/RHN/DB.pm 233 RHN::Exception::DB::throw
  RHN::DB::st /var/www/lib/RHN/DB.pm 561 RHN::DB::handle_error
  RHN::DB::ChannelEditor /var/www/lib/RHN/DB/ChannelEditor.pm 886 RHN::DB::st::execute_h
  Sniglets::ListView::ErrataList /var/www/lib/Sniglets/ListView/ErrataList.pm 539 RHN::DB::ChannelEditor::add_cloned_errata_to_channel
  Sniglets::ListView::List /var/www/lib/Sniglets/ListView/List.pm 374 Sniglets::ListView::ErrataList::potential_for_cloned_channel_cb
  Sniglets::Lists /var/www/lib/Sniglets/Lists.pm 142 Sniglets::ListView::List::callback
  PXT::ApacheHandler /var/www/lib/PXT/ApacheHandler.pm 621 Sniglets::Lists::listview_cb
  PXT::ApacheHandler /var/www/lib/PXT/ApacheHandler.pm 124 PXT::ApacheHandler::pxt_parse_data
  PXT::ApacheHandler /var/www/lib/PXT/ApacheHandler.pm 124 (eval)
  main -e 0 PXT::ApacheHandler::handler
  main -e 0 (eval)

Offending Query: INSERT INTO rhnChannelErrata
       (errata_id, channel_id)
VALUES (:eid, :cid)

Comment 4 Justin Sherrill 2009-04-15 19:17:09 UTC
Turns out the set wasn't being cleared, so it was trying to clone errata that was already cloned:

f6762d9

Comment 5 Justin Sherrill 2009-04-15 19:17:36 UTC
master: ea37485

Comment 6 Sayli Karmarkar 2009-04-28 21:21:11 UTC
verified.

Comment 7 Brandon Perkins 2009-08-25 21:11:08 UTC
Release Pending.  No ISE and errata are being cloned.

Comment 8 Brandon Perkins 2009-09-10 20:35:23 UTC
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