Bug 659026 - rhn-manage-channel-internal throws a sensible error when the database hits a unique constraint
Summary: rhn-manage-channel-internal throws a sensible error when the database hits a ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Network
Classification: Retired
Component: RHN/Backend
Version: RHN Stable
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: rhn-dev-list
QA Contact: Red Hat Network Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 658545
TreeView+ depends on / blocked
 
Reported: 2010-12-01 19:50 UTC by Stephen Herr
Modified: 2011-03-23 20:19 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-03-23 20:19:56 UTC
Embargoed:


Attachments (Terms of Use)

Description Stephen Herr 2010-12-01 19:50:45 UTC
Instead of just exploding with an ISE when the database hits a unique constraint we should return an error message that tells the user what field is not unique so they can fix it.

Comment 1 Stephen Herr 2010-12-03 15:52:55 UTC
Updates include:

1) For any of the content-mgmt tools: When the database throws a unique constraint error we either display a plain-English explanation of what is required if the constraint is one that we have a plain-English explanation of, or the name of the constraint otherwise. 

2) For any tools that have updated error handling code (currently just manage-channel): We display the data that the error was caused by.

3) For any of the content-mgmt tools (assuming version 0.8.3 or higher): If using a csv to upload data we display the line that the error occurred on.


Venkat, to test:

0) Install the newest rhn-content-mgmt version: https://brewweb.devel.redhat.com/buildinfo?buildID=150698

1) Get a baseline csv that you will modify: 'rhn-manage-channel-internal
--server dev --username <username> --password <password> --list
rhel-i386-server-5 > test.csv'

2) Change the label, try to create channel with that csv: 'rhn-manage-channel-internal --server dev --username <username> --password <password> --create --csv test.csv'

3) You should receive a unique constraint error about the name with the upgrades listed above.

4) Change the name, try again

5) You should receive a different unique constraint error with the upgrades listed above.

6) Similar things should happen for creating or updating channels, or for different tools altogether. Experiment and have fun.

Comment 2 venkat 2010-12-10 17:06:54 UTC
Verified in dev.

Tested both

rhn-manage-channel-internal
and
rhn-manage-errata-product

both of them are giving 

Error Message:
    Unique Constraint Error:

Error Class Code: 23
Error Class Info: Could not update database entry.


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