Bug 822069 - Could not unsubscribe: "No JSON object could be decoded"
Could not unsubscribe: "No JSON object could be decoded"
Status: CLOSED ERRATA
Product: Subscription Asset Manager
Classification: Red Hat
Component: katello (Show other bugs)
1.0.0
Unspecified Unspecified
medium Severity high
: beta
: 1.X
Assigned To: Jordan OMara
SAM QE List
: Triaged
Depends On:
Blocks: sam11-tracker
  Show dependency treegraph
 
Reported: 2012-05-16 05:05 EDT by Hui Wang
Modified: 2014-11-09 17:56 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Due to a lack of JSON object upon return, user cannot unsubscribe all consumed subscriptions via CLI. This update returns JSON from delete call and user is now able to unsubscribe all consumed subscriptions via CLI.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 11:20:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
pass json back from delete call (462 bytes, patch)
2012-05-17 15:33 EDT, Chris Duryee
no flags Details | Diff

  None (edit)
Description Hui Wang 2012-05-16 05:05:39 EDT
Description of problem:
Can't unsubscribe all the subscriptions when run "subscription-manager unsubscribe --all" CLI.

Version-Release number of selected component (if applicable):
katello-configure-0.3.3-2.el6_2.noarch
katello-headpin-all-0.2.6-4.el6_2.noarch
katello-common-0.3.1-1.el6_2.noarch
katello-cli-common-0.3.2-3.el6_2.noarch
katello-headpin-0.2.6-4.el6_2.noarch
katello-glue-candlepin-0.3.1-1.el6_2.noarch
katello-cli-headpin-0.2.0-1.el6_2.noarch
katello-selinux-0.2.4-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.1.5-1.el6_2.noarch
candlepin-0.6.2-1.el6_2.noarch
katello-glue-candlepin-0.3.1-1.el6_2.noarch
candlepin-tomcat6-0.6.2-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
thumbslug-0.0.24-1.el6_2.noarch

How reproducible:
100%

Steps to Reproduce:
1.Register to sam (SAM-2012-05-15.1)
# subscription-manager register 
Username: admin
Password: 
The system has been registered with id: 5b67802c-3970-4710-80fe-c347a4f0eb57 
2.Subscribe 
# subscription-manager subscribe --auto
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed               
3.Unsubscribe 
#subscription-manager unsubscribe --all
No JSON object could be decoded
4.List consumed subscriptions
#subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Red Hat Enterprise Linux Server
ContractNumber:     	2596950                  
AccountNumber:      	477931                   
SerialNumber:       	7126170976071892814      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	10/08/2011               
Expires:            	01/01/2022 
.......
  
Actual results:
Can't unsubscribe the consumed subscriptions.

Expected results:
After running "subscription-manager unsubscribe --all", then run "subscription-manager list --consumed", it will give the "No consumed subscription pools to list" prompt.

Additional info:
Comment 1 Chris Duryee 2012-05-16 18:15:21 EDT
Hui,

I was able to replicate the issue, but I am still determining what the best fix is.
Comment 2 Chris Duryee 2012-05-17 15:33:09 EDT
Created attachment 585301 [details]
pass json back from delete call
Comment 3 Chris Duryee 2012-05-17 15:35:33 EDT
To replicate this bug, you can just run "unsubscribe --all" without having to consume entitlements first.
Comment 4 Jordan OMara 2012-05-18 11:28:56 EDT
merged https://github.com/Katello/katello/pull/127
Comment 6 Hui Wang 2012-05-23 05:32:25 EDT
unsubscribe --all still unsubscribe all the entitlements, and report:
"Expected /usr/share/katello/lib/resources/candlepin.rb to define Resources::Candlepin".



Version:
subscription-manager-0.99.19
katello-common-0.3.2-1.el6_2.noarch
katello-headpin-all-0.2.9-1.el6_2.noarch
katello-glue-candlepin-0.3.2-1.el6_2.noarch
katello-cli-headpin-0.2.2-1.el6_2.noarch
katello-headpin-0.2.9-1.el6_2.noarch
katello-configure-0.3.6-1.el6_2.noarch
katello-cli-common-0.3.4-1.el6_2.noarch
katello-selinux-0.2.4-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.1.5-1.el6_2.noarch
katello-glue-candlepin-0.3.2-1.el6_2.noarch
candlepin-0.6.3-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
candlepin-tomcat6-0.6.3-1.el6_2.noarch
thumbslug-0.0.24-1.el6_2.noarch
Comment 8 Hui Wang 2012-05-28 03:24:59 EDT
Verified. The result is PASS.

Packages Tested:
subscription-manager-0.99.19-1.el6.x86_64
katello-headpin-0.2.10-1.el6_2.noarch
katello-configure-0.3.7-1.el6_2.noarch
katello-headpin-all-0.2.10-1.el6_2.noarch
katello-common-0.3.2-1.el6_2.noarch
katello-cli-common-0.3.4-1.el6_2.noarch
katello-selinux-0.2.4-1.el6_2.noarch
katello-glue-candlepin-0.3.2-1.el6_2.noarch
katello-cli-headpin-0.2.2-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.1.5-1.el6_2.noarch
candlepin-tomcat6-0.6.5-1.el6_2.noarch
candlepin-0.6.5-1.el6_2.noarch
thumbslug-0.0.24-1.el6_2.noarch

1.#subscription-manager subscribe --auto --servicelevel=None
2.# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+

Product Name:         	Red Hat Enterprise Linux Server
Contract Number:      	2596950                  
Account Number:       	477931                   
Serial Number:        	1374830180863246400      
Active:               	True                     
Quantity Used:        	1                        
Service Level:        	None                     
Service Type :        	None                     
Begins:               	10/08/2011               
Expires:              	01/01/2022               

3.#subscription-manager unsubscribe --all 

4.# subscription-manager list --consumed
No consumed subscription pools to list
Comment 9 sachua 2012-06-14 02:24:36 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
User cannot unsubscribe consumed subscriptions when running the command: "subscription-manager unsubscribe --all". This update passes json back from delete call and user is now able to unsubscribe consumed subscriptions.
Comment 10 Dan Macpherson 2012-06-15 02:17:43 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-User cannot unsubscribe consumed subscriptions when running the command: "subscription-manager unsubscribe --all". This update passes json back from delete call and user is now able to unsubscribe consumed subscriptions.+Due to a lack of JSON object upon return, user cannot unsubscribe all consumed subscriptions via CLI. This update returns JSON from delete call and user is now able to unsubscribe all consumed subscriptions via CLI.
Comment 12 errata-xmlrpc 2012-06-20 11:20:48 EDT
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.

http://rhn.redhat.com/errata/RHBA-2012-1021.html

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