OS/RHEL8

RHEL8 - subscription 등록시 UnicodeEncodeError

zzerog 2021. 7. 9. 08:58
728x90
증상

RHEL8.2 설치 후 subscription 등록시 아래와 같은 에러 메시지 발생

[root@rhel8 ~]# subscription-manager register
You are attempting to use a locale that is not installed.
등록 대상: subscription.rhsm.redhat.com:443/subscription
사용자 이름: test
??: test

시스템은 ID로 등록되어 있습니다: xxxx
등록된 시스템 이름: rhel8
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/__init__.py", line 996, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 157-162: ordinal not in range(128)
Call stack:
  File "/usr/sbin/subscription-manager", line 11, in <module>
    load_entry_point('subscription-manager==1.26.16', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 87, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2996, in main
    ret = CLI.main(self)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cli.py", line 183, in main
    return cmd.main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 536, in main
    return_code = self._do_command()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 1389, in _do_command
    self.log_server_version()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 392, in log_server_version
    log.debug("Server Versions: %s" % self.server_versions)
Message: "Server Versions: {'candlepin': '3.2.19-1', 'server-type': 'Red Hat 서브스크립션 관리', 'rules-version': '5.41'}"
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/__init__.py", line 996, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 104-105: ordinal not in range(128)
Call stack:
  File "/usr/sbin/subscription-manager", line 11, in <module>
    load_entry_point('subscription-manager==1.26.16', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 87, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2996, in main
    ret = CLI.main(self)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cli.py", line 183, in main
    return cmd.main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 536, in main
    return_code = self._do_command()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 1434, in _do_command
    self.entcertlib.update()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 32, in update
    self.report = self.locker.run(self._do_update)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 18, in run
    return action()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 42, in _do_update
    return action.perform()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 131, in perform
    log.info('certs updated:\n%s', self.report)
Message: 'certs updated:\n%s'
Arguments: (<subscription_manager.entcertlib.EntCertUpdateReport object at 0x7f1f6f4fe278>,)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/__init__.py", line 996, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 102-106: ordinal not in range(128)
Call stack:
  File "/usr/sbin/subscription-manager", line 11, in <module>
    load_entry_point('subscription-manager==1.26.16', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 87, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2996, in main
    ret = CLI.main(self)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cli.py", line 183, in main
    return cmd.main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 536, in main
    return_code = self._do_command()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 1434, in _do_command
    self.entcertlib.update()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 32, in update
    self.report = self.locker.run(self._do_update)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 18, in run
    return action()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 42, in _do_update
    return action.perform()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 142, in perform
    self.repo_hook()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 215, in repo_hook
    content_action.update()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/base_action_client.py", line 54, in update
    self.update_reports = self._run_updates(autoheal)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/base_action_client.py", line 85, in _run_updates
    update_report = self._run_update(lib)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/base_action_client.py", line 62, in _run_update
    update_report = lib.update()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 32, in update
    self.report = self.locker.run(self._do_update)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 18, in run
    return action()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/repolib.py", line 195, in _do_update
    res = action.perform()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/repolib.py", line 466, in perform
    log.debug("repos updated: %s" % self.report)
Message: 'repos updated: 리포지터리 업데이트\n\n총 리포지터리 업데이트: 0\n업데이트됨\n    <NONE>\n추가됨 (신규)\n    <NONE>\n삭제됨\n    <NONE>'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/__init__.py", line 996, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 102-106: ordinal not in range(128)
Call stack:
  File "/usr/sbin/subscription-manager", line 11, in <module>
    load_entry_point('subscription-manager==1.26.16', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 87, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2996, in main
    ret = CLI.main(self)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cli.py", line 183, in main
    return cmd.main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 536, in main
    return_code = self._do_command()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 1434, in _do_command
    self.entcertlib.update()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 32, in update
    self.report = self.locker.run(self._do_update)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 18, in run
    return action()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 42, in _do_update
    return action.perform()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 169, in perform
    self.repo_hook()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/entcertlib.py", line 215, in repo_hook
    content_action.update()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/base_action_client.py", line 54, in update
    self.update_reports = self._run_updates(autoheal)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/base_action_client.py", line 85, in _run_updates
    update_report = self._run_update(lib)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/base_action_client.py", line 62, in _run_update
    update_report = lib.update()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 32, in update
    self.report = self.locker.run(self._do_update)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/certlib.py", line 18, in run
    return action()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/repolib.py", line 195, in _do_update
    res = action.perform()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/repolib.py", line 466, in perform
    log.debug("repos updated: %s" % self.report)
Message: 'repos updated: 리포지터리 업데이트\n\n총 리포지터리 업데이트: 0\n업데이트됨\n    <NONE>\n추가됨 (신규)\n    <NONE>\n삭제됨\n    <NONE>'
Arguments: ()
[root@rhel8 ~]#

 

원인

LANG이 ko_KR.UTF-8로 되어 있을때 나타나는 문제로 보임

 

 

해결
vi ~/.bash_profile
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_COLLATE=C
export LC_CTYPE=en_US.UTF-8

source ~/.bash_profile
 
반응형