Bug 1483746 - UTF-8 encoding issues in D-Bus services
Summary: UTF-8 encoding issues in D-Bus services
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Hnidek
QA Contact: Jan Stavel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-21 20:40 UTC by Kevin Howell
Modified: 2018-06-01 10:51 UTC (History)
7 users (show)

Fixed In Version: subscription-manager-1.20.2-1
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 09:51:13 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0681 None None None 2018-04-10 09:51:43 UTC
Github RedHatQE rhsm-qe pull 684 None None None 2017-08-29 10:18:50 UTC
Github candlepin subscription-manager pull 1703 None None None 2017-10-02 16:19:59 UTC
Red Hat Bugzilla 1480395 None CLOSED After updating to latest subscription manager, abrt dumps seen for servers with "System Locale: LANG=ja_JP.UTF-8" 2018-12-13 17:05:15 UTC

Internal Links: 1480395

Description Kevin Howell 2017-08-21 20:40:02 UTC
Description of problem:

ERROR in (PoolAttach-test) (attach_tests.clj:121)
Uncaught exception, not in assertion.
expected: nil
  actual: java.lang.AssertionError: Verification failed: (= stderr "")
	stderr : 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)
  File "<string>", line 2, in PoolAttach
  File "/usr/lib/python2.7/site-packages/rhsmlib/dbus/util.py", line 43, in dbus_handle_exceptions
    six.reraise(exceptions.RHSM1DBusException, "%s: %s" % (type(e).__name__, str(e)), trace)
  File "/usr/lib/python2.7/site-packages/rhsmlib/dbus/util.py", line 35, in dbus_handle_exceptions
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/rhsmlib/dbus/objects/attach.py", line 87, in PoolAttach
    raise dbus.DBusException(str(e))
RHSM1DBusException: com.redhat.RHSM1.Error: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)


Steps to Reproduce:
1. set system encoding to ja_JP.UTF-8
2. Use D-Bus services to try to attach to a pool.

Actual results:
Attach should succeed.

Expected results:
RHSM1DBusException: com.redhat.RHSM1.Error: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

Comment 7 Jan Stavel 2017-10-04 12:08:09 UTC
I have verified this bug.

[root@jstavel-rhel7-server-01 ~]# rpm -qa | egrep 'subscription|rhsm|cockpit'
   
   subscription-manager-plugin-container-1.20.1-1.git.73.4b01c26.el7.x86_64
   python-rhsm-1.20.1-1.git.42.4b01c26.el7.x86_64
   python-rhsm-certificates-1.20.1-1.git.42.4b01c26.el7.x86_64
   subscription-manager-initial-setup-addon-1.20.1-1.git.73.4b01c26.el7.x86_64
   cockpit-system-138-9.el7.noarch
   cockpit-dashboard-148-1.el7.x86_64
   subscription-manager-migration-data-2.0.37-1.git.0.d45a6c7.el7.noarch
   subscription-manager-gui-1.20.1-1.git.73.4b01c26.el7.x86_64
   subscription-manager-plugin-ostree-1.20.1-1.git.73.4b01c26.el7.x86_64
   cockpit-bridge-138-9.el7.x86_64
   subscription-manager-1.20.1-1.git.73.4b01c26.el7.x86_64
   subscription-manager-migration-1.20.1-1.git.73.4b01c26.el7.x86_64
   cockpit-ws-138-9.el7.x86_64


systemctl edit rhsm.service

  [Service]
  Environment="LANG=ja_JP.UTF-8"
  Environment="LC_ALL=ja_JP.UTF-8"

systemctl daemon-reload
systemctl restart rhsm.service

subscription-manager register

systemctl restart rhsm.service # the service knows older state. It needs to be refreshed.

 busctl call com.redhat.RHSM1 /com/redhat/RHSM1/Attach com.redhat.RHSM1.Attach AutoAttach 'sa{sv}' Standard 0

   I see s list of subscriptions.

and I see a japaness letters in journalctl.



   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: INFO [rhsm.connection:556] Response: status=200, requestUuid=9022903f-c5cc-4ced-bc7d-59b9fad53f45, request="G
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: INFO [subscription_manager.entcertlib:131] certs updated:
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: 全ての更新: 1
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: 見付かった (ローカル) シリアル # []
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: 予期される (UEP) シリアル# [4528066276740481154]
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: 追加 (新規)
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Red Hat Beta,) @ /etc/pki/entitlement/4528066276740481154.pem]
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Red Hat Hardware Certification Test Suite,) @ /etc/pki/entitlement/45280662767404811
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Red Hat Software Collections Beta (for RHEL Server),) @ /etc/pki/entitlement/4528066
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Oracle Java (for RHEL Server),) @ /etc/pki/entitlement/4528066276740481154.pem]
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Red Hat Enterprise Linux Server,) @ /etc/pki/entitlement/4528066276740481154.pem]
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Red Hat Enterprise Linux Resilient Storage (for RHEL Server),) @ /etc/pki/entitlemen
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Red Hat Enterprise Linux High Availability (for RHEL Server),) @ /etc/pki/entitlemen
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: [sn:4528066276740481154 (Red Hat Enterprise Linux Load Balancer (for RHEL Server),) @ /etc/pki/entitlement/45
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: 削除済み (変異品):
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com rhsm-service[12162]: <NONE>
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com subscription-manager[12162]: Added subscription for 'Red Hat Enterprise Linux AS, Standard' contract '11480566'
   10月 04 08:01:01 jstavel-rhel7-server-01.usersys.redhat.com subscription-manager[12162]: Added subscription for product 'Red Hat Beta'

Comment 8 Jan Stavel 2017-10-04 12:59:58 UTC
verified. It works now.

Comment 11 errata-xmlrpc 2018-04-10 09:51:13 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


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