Bug 602788 - Trying to edit a script-based alert notification fails with FK constraint violation.
Summary: Trying to edit a script-based alert notification fails with FK constraint vio...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Alerts
Version: 1.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Joseph Marques
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On: 607548
Blocks: jon24-alert-notify
TreeView+ depends on / blocked
 
Reported: 2010-06-10 18:56 UTC by Corey Welton
Modified: 2010-08-12 16:54 UTC (History)
1 user (show)

Fixed In Version: 2.4
Clone Of:
Environment:
Last Closed: 2010-08-12 16:54:50 UTC
Embargoed:


Attachments (Terms of Use)

Description Corey Welton 2010-06-10 18:56:59 UTC
Description of problem:
If user saves an alert notification which runs a JBoss AS descendent script, and afterwards tries to edit it, s/he gets a FK constraint violation.

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


How reproducible:
Every time

Steps to Reproduce:
1.  Create an alert for a jboss as server, i.e., RHQ
2.  Type: Resource Operations
    Resource Selection Mode: Relative Resource
    Start Search from: JBoss AS Server
    Then Filter By: Script 
3.  Enter "porbe.sh" in the box next to "Script"
4.  Operation name: Execute script
5.  Command Line arguments: keep "Unset" checked.
6.  Return to the box which contains "porbe.sh".  change this to "probe.sh"
7.  hit save  
Actual results:

Failed to save alert notification Cause: javax.ejb.EJBException:javax.persistence.EntityExistsException: org.hibernate.exception.ConstraintViolationException: could not execute update query -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: could not execute update query -> org.hibernate.exception.ConstraintViolationException:could not execute update query -> org.postgresql.util.PSQLException:ERROR: update or delete on table "rhq_config" violates foreign key constraint "rhq_alert_notification_extra_config_id_fkey" on table "rhq_alert_notification" Detail: Key (id)=(13618) is still referenced from table "rhq_alert_notification".[SQLException=ERROR: update or delete on table "rhq_config" violates foreign key constraint "rhq_alert_notification_extra_config_id_fkey" on table "rhq_alert_notification" Detail: Key (id)=(13618) is still referenced from table "rhq_alert_notification".]

Expected results:

No errors.
Additional info:

Comment 1 Corey Welton 2010-06-10 18:58:56 UTC
workaround is to remove busted notification and recreate.

Comment 2 Joseph Marques 2010-06-14 14:55:01 UTC
commit f4223c6c628f5b5788e804a0c7f382cfea121cdd
Author: Joseph Marques <joseph>
Date:   Fri Jun 11 14:01:40 2010 -0400

    BZ-602788: fix FK constaint violation when editing an alert notification with operation arguments
    
    * instead of deleting and recreating the extraConfiguration object, just merge properties changes into it
    * if user changes selection mode, need to null out the extraConfiguration

Comment 3 Sudhir D 2010-06-24 10:59:07 UTC
Blocked by 607548

Comment 4 Corey Welton 2010-06-29 18:35:23 UTC
QA Verified.

Comment 5 Corey Welton 2010-08-12 16:54:50 UTC
Mass-closure of verified bugs against JON.


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