Bug 1412113

Summary: subscription-manager attach --auto fails with "Runtime Error ERROR:"
Product: [Community] Candlepin Reporter: Rehana <redakkan>
Component: candlepinAssignee: vritant <vrjain>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: high    
Version: 2.0CC: redakkan, skallesh, vrjain
Target Milestone: ---Keywords: Triaged
Target Release: 2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-2.0.26-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-01 18:17:23 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:

Description Rehana 2017-01-11 09:55:25 UTC
Description of problem:
The issue was observed on a mapped guest machine during attach.

Version-Release number of selected component (if applicable):
subscription management server: 2.0.21-1
subscription management rules: 5.20
subscription-manager: 1.18.6-1.el6
python-rhsm: 1.18.6-1.el6


How reproducible:
always

Steps to Reproduce:
1.Register host and guest with the same Org against candlepin server
2.Make sure the virt-who service is running 
3.Set cpu socket on host machine (ex:say to 50)
Ex:
echo '{"cpu.cpu_socket(s)":"50"}' > /etc/rhsm/facts/sockets.facts
subscription-manager facts --update
4.Make sure a product is installed on the client (ex : 32060.pem)
5.Execute subscription-manager attach --auto or set the heal time and wait till the heal occurs on the guest

Actual results:
Only guest should be healed if not enough quantity is available to make the physical system compliant

Expected results:
attach fails on the client with 

# subscription-manager attach --auto

Runtime Error ERROR: current transaction is aborted, commands ignored until end of transaction block at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102


Additional info:
After disabling auto-attach on the host , the attach was successful on the guest machine

rhsm.log:
=======
2017-01-11 04:05:48,244 [ERROR] subscription-manager:1654:MainThread @managercli.py:177 - Unable to attach: Runtime Error ERROR: current transaction is aborted, commands ignored until end of transaction block at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102
2017-01-11 04:05:48,244 [ERROR] subscription-manager:1654:MainThread @managercli.py:178 - Runtime Error ERROR: current transaction is aborted, commands ignored until end of transaction block at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 1621, in _do_command
    service_level=self.options.service_level)
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 200, in autosubscribe
    ents = cp.bind(consumer_uuid)  # new style
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 1123, in bind
    return self.conn.request_post(method)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 626, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 534, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 587, in validateResponse
    raise RestlibException(response['status'], error_msg, response.get('headers'))
RestlibException: Runtime Error ERROR: current transaction is aborted, commands ignored until end of transaction block at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102

Comment 1 Rehana 2017-01-11 09:58:47 UTC
please read as ;

Actual results:
attach fails on the client with 

# subscription-manager attach --auto

Runtime Error ERROR: current transaction is aborted, commands ignored until end of transaction block at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102

Expected results:

Only guest should be healed if not enough quantity is available to make the physical system compliant