Bug 1117753

Summary: CV:Deleting a CV immediately after removing its published version raises 500 ISE
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: WebUIAssignee: Walden Raines <walden>
Status: CLOSED ERRATA QA Contact: Renzo Nuccitelli <rnuccite>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: bbuckingham, bkearney, ehelms, jcallaha, mmccune, rnuccite, sreber
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/9578
Whiteboard:
Fixed In Version: rubygem-katello-3.0.0.78-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-14 21:02:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Logs from production.log none

Description Sachin Ghai 2014-07-09 10:24:36 UTC
Created attachment 916708 [details]
Logs from production.log

Description of problem:
I was trying a specific scenario to delete to a CV. I created a CV and published it and promote it to next env. Later, I created a new activation-key and selected same cv. Now when I tried to delete CV, UI says: To delete CV, first remove its version and move the associated entities (activation-key) to other CV or env. I followed same and removed the version. On removing the CV version, UI raises notification:

"Successfully initiated removal of testcv2 version 1."

After above notification, I tried to remove the CV and got following error on UI:

Required lock is already taken by other running tasks. Please inspect their state, fix their errors nad resume them. Required lock: read Conflicts with tasks: - https://dhcp207-190.lab.eng.pnq.redhat.com/foreman_tasks/tasks/1b44ce3f-c919-4b87-af1c-3b9701948f69 


Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140626.1

How reproducible:
always

Steps to Reproduce:
1. create a CV (cv1), publish it and promote it to next env (dev)
2. create activation-key(ak), select 'dev' env and 'cv1' 
3. Now try to delete CV
4. first UI will sk to delete its version.
5. Once you triggered version deletion, immediately try to delete CV too

Actual results:
UI raises:

Required lock is already taken by other running tasks. Please inspect their state, fix their errors nad resume them. Required lock: read Conflicts with tasks: - https://dhcp207-190.lab.eng.pnq.redhat.com/foreman_tasks/tasks/1b44ce3f-c919-4b87-af1c-3b9701948f69 

Expected results:
UI should raise proper message, saying that deletion is still on-going or something like that and log shouldn't be filled with 500 ISE

There are several other cases, related to locking, and all needs to be handled properly.

Additional info:

Comment 2 Sachin Ghai 2014-07-10 10:31:30 UTC
The other issue I found and looks like relevant to this bz is:

When we delete a CV version, UI raise a message:

Successfully initiated deletion of <CV_name> version 1.

But never gets another message after this that "Successfully removed the CV version". So when we again click "Remove version' to remove the CV, UI throws:

--
Required lock is already taken by other running tasks...
--

This issue is reproducible on latest nightly too.

Comment 3 Walden Raines 2015-02-27 15:30:21 UTC
Created redmine issue http://projects.theforeman.org/issues/9578 from this bug

Comment 4 Walden Raines 2015-03-13 15:34:46 UTC
Moving bugs I'm not currently working on back to NEW

Comment 5 Walden Raines 2015-04-23 18:30:17 UTC
Moving this to 6.2.0 because in order to fix this correctly we need to alter the LockConflict exception class in foreman-tasks to provide an object rather than a simple string.  I believe the blast radius for this change is too large for the benefit we will gain by fixing this for 6.1.

Comment 6 Bryan Kearney 2015-07-13 18:01:16 UTC
Upstream bug assigned to walden

Comment 7 Bryan Kearney 2015-07-13 18:01:18 UTC
Upstream bug assigned to walden

Comment 8 Bryan Kearney 2015-08-25 17:24:41 UTC
Upstream bug component is Tasks Plugin

Comment 10 Walden Raines 2016-05-11 15:29:37 UTC
PR - https://github.com/Katello/katello/pull/6040

Comment 11 Bryan Kearney 2016-05-11 16:02:33 UTC
Upstream bug component is WebUI

Comment 14 Bryan Kearney 2016-05-19 16:02:08 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9578 has been closed

Comment 15 Walden Raines 2016-08-19 14:28:27 UTC
*** Bug 1343924 has been marked as a duplicate of this bug. ***

Comment 17 Walden Raines 2016-09-02 17:34:42 UTC
*** Bug 1372421 has been marked as a duplicate of this bug. ***

Comment 19 errata-xmlrpc 2016-09-14 21:02:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1885