Bug 1322252

Summary: candlepin return "undefined method `inject' for nil:NilClass" when system has been delete from webUI
Product: Red Hat Satellite Reporter: Liushihui <shihliu>
Component: OtherAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bkearney, hsun, ldai, sgao
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-02 20:58:25 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 Liushihui 2016-03-30 07:03:27 UTC
Description of problem:
After unregister system from webUI, virt-who will fail to communicate with subscription-manager as get return info "undefined method `inject' for nil:NilClass" from candlepin.

Version-Release number of selected component (if applicable):
candlepin-0.9.49.11-1.el7.noarch
katello-2.2.0.18-1.el7sat.noarch
Satellite-6.1.0-RHEL-6-20160321.0

How reproducible:
Always

Steps to Reproduce:
1 Register system to satellite6.1.
2 Configure virt-who monitor hyperv.
[root@sgi-xe500-01 run]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=2
VIRTWHO_HYPERV=1
VIRTWHO_HYPERV_OWNER=ACME_Corporation
VIRTWHO_HYPERV_ENV=Library
VIRTWHO_HYPERV_SERVER=10.73.5.212
VIRTWHO_HYPERV_USERNAME=administrator
VIRTWHO_HYPERV_PASSWORD=Welcome1
3 Restart virt-who 
[root@sgi-xe500-01 run]# service virt-who restart
4 Delete the system using the stage candlepin site
5.In hyperv, start/stop/pause guests.
6 Check the virt-who log in rhsm.log
[root@sgi-xe500-01 run]# tail -f /var/log/rhsm/rhsm.log
2016-03-30 02:50:26,642 [virtwho.main DEBUG] MainProcess(12420):MainThread @subscriptionmanager.py:hypervisorCheckIn:186 - Host-to-guest mapping: {
    "564D80F1-61F0-8510-87BF-57F9EC6122D7": [
        {
            "guestId": "C877953C-A19E-5149-B614-D97873C4CBD2", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "hypervisorVersion": "6.3.9600.16404", 
                "virtWhoType": "hyperv", 
                "hypervisorType": "hyperv"
            }
        }, 
        {
            "guestId": "8329390B-8359-F646-9176-27D738580E81", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "hypervisorVersion": "6.3.9600.16404", 
                "virtWhoType": "hyperv", 
                "hypervisorType": "hyperv"
            }
        }
    ]
}
2016-03-30 02:50:26,763 [virtwho.main ERROR] MainProcess(12420):MainThread @virtwho.py:send:203 - Unable to send data: Communication with subscription manager failed with code 500: undefined method `inject' for nil:NilClass

Actual results:
Virt-who get return info from candlepin as the following:
"Unable to send data: Communication with subscription manager failed with code 500: undefined method `inject' for nil:NilClass"

Expected results:
Candlepin shouldn't return "undefined method `inject' for nil:NilClass", it should return " "Communication with subscription manager failed: consumer no longer exists""

Additional info:

Comment 1 Barnaby Court 2016-04-04 19:27:26 UTC
Candllepin does not return this. Katello is injecting it.

Comment 3 Bryan Kearney 2016-07-26 15:25:24 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 4 Bryan Kearney 2016-07-26 15:31:40 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 6 Bryan Kearney 2018-08-02 20:58:25 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the forseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.