Bug 1516439

Summary: Unregister DBus object returns a raw message when unregistering and a candlepin server is down
Product: Red Hat Enterprise Linux 7 Reporter: Jan Stavel <jstavel>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: Jan Stavel <jstavel>
Severity: low Docs Contact:
Priority: low    
Version: 7.5CC: jhnidek, jsefler, khowell, salmy
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.20.10-1 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 09:52:44 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:
Bug Depends On:    
Bug Blocks: 1489521    

Description Jan Stavel 2017-11-22 15:55:40 UTC
Description of problem:

A method Unregister of Unregister DBus object gives just a raw message when candlepin server is down.

How reproducible:

   Each time.

Steps to Reproduce:

   subscription-manager unregister

   dbus-send --system --print-reply --dest='com.redhat.RHSM1' '/com/redhat/RHSM1/Unregister' com.redhat.RHSM1.Unregister.Unregister dict:string:string:"",""

Error org.freedesktop.DBus.Python.dbus.exceptions.DBusException: Tunnel connection failed: 503 Service Unavailable

Actual results:

 A raw python exception


Expected results:

   Better self explanatory error message.

Comment 2 Jiri Hnidek 2017-11-24 08:54:38 UTC
This error is reported, when rhsm.conf includes valid configuration of proxy server and proxy server cannot connect to candlepin server. When no proxy server is used, then following error message is printed:

[root@centos7 ~]# dbus-send --system --print-reply --dest='com.redhat.RHSM1' '/com/redhat/RHSM1/Unregister' com.redhat.RHSM1.Unregister.Unregister dict:string:string:"",""

Error org.freedesktop.DBus.Python.dbus.exceptions.DBusException: [Errno 113] No route to host

Comment 4 Jan Stavel 2018-01-31 12:11:49 UTC
There is a additional string argument in method call:

error case:
[root@jstavel-rhel7-server ~]# dbus-send --system --print-reply --dest='com.redhat.RHSM1' '/com/redhat/RHSM1/Unregister' com.redhat.RHSM1.Unregister.Unregister dict:string:string:"",""
Error org.freedesktop.DBus.Python.TypeError: Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
TypeError: Unregister() takes at least 3 arguments (3 given)

right case:
[root@jstavel-rhel7-server ~]# dbus-send --system --print-reply --dest='com.redhat.RHSM1' '/com/redhat/RHSM1/Unregister' com.redhat.RHSM1.Unregister.Unregister dict:string:string:"","" string:""
method return time=1517400605.596377 sender=:1.15120 -> destination=:1.15270 serial=101 reply_serial=2

Comment 5 Jan Stavel 2018-02-01 10:04:47 UTC
It works:

[root@jstavel-rhel7-server ~]# dbus-send --system --print-reply --dest='com.redhat.RHSM1' /com/redhat/RHSM1/Unregister com.redhat.RHSM1.Unregister.Unregister dict:string:string:'','' string:'en'


Error org.freedesktop.DBus.Python.dbus.exceptions.DBusException: Tunnel connection failed: 500 Unable to connect

Comment 8 errata-xmlrpc 2018-04-10 09:52:44 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-2018:0681