Bug 1569133

Summary: Entitlements Removed from Source when transfer fails
Product: [Community] Candlepin Reporter: bstracha
Component: candlepinAssignee: Abhishek Kumar <abhiskum>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: high    
Version: 2.2CC: bcourt, bstracha, crog, khowell, redakkan, skallesh
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Fixed In Version: candlepin-2.8.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-24 17:21:29 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:
Description Flags
Shows 500 error on source subscription allocation none

Description bstracha 2018-04-18 16:30:36 UTC
Created attachment 1423671 [details]
Shows 500 error on source subscription allocation

Description of problem:
Using RHSM (which in turn is calling CP), while transferring entitlements of certain SKUs from a SAM 1.4 to SAM 1.2, the migration of entitlements fails with a 500 (which is an error returned directly from CP). Entitlements, however, are still removed from the source subscription allocation.
We also use Candlepin to migrate subscriptions between Satellites, so we wanted to make sure the flow when a failure occurs is as expected.

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

How reproducible:

Steps to Reproduce:
Visit access.stage.redhat/management

Log-in with the following credentials:

Visit https://access.stage.redhat.com/management/subscription_allocations/2f873d2e-4de3-48cc-a117-a848f42f0a00/subscriptions
In Search bar - Type "SER0135US"
Click check box next to Subscription and then hit "Move to Another Allocation"
Enter '10' in 'Quantity to Move'
Click "Next"
Select "SAM_1_2"
Click "Submit"

Actual results:
You get a 500 error but you'll see the entitlements decremented by 10
However, if you visit:
You will see that "SAM_1_2" still has 0 Entitlements

Expected results:
We expect to get an error, but the entitlements on the source subscription
allocation should not be decremented since the transfer is not completed

Additional info:
Screenshots added

Comment 1 Barnaby Court 2018-04-19 12:45:08 UTC
Can you provide the Candlepin logs that show the details of the error?