CB Response: UnicodeEncodingError:'ascii' codec can't encode characters in position 0-1
search cancel

CB Response: UnicodeEncodingError:'ascii' codec can't encode characters in position 0-1

book

Article ID: 287986

calendar_today

Updated On:

Products

Carbon Black EDR (formerly Cb Response)

Issue/Introduction

  • /var/log/cb/coreservices/debug.log
  • Traceback error
    2018-06-08 14:24:55 [113359] <err> cb.core.notifications.listener - Message handler threw an exception: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) 
    Traceback (most recent call last): 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/listener.py", line 255, in __call__ 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/listener.py", line 270, in parse 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/event_factory.py", line 33, in create_event 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/event_factory.py", line 47, in _json_parse 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/base_event.py", line 190, in from_json_dict 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/base_event.py", line 114, in unpack 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/base_event.py", line 121, in _repack 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/base_event.py", line 39, in coerce 
    File "/opt/jenkins/build/workspace/build-cbent-signed-docker-staging/code/coreservices/src/cb/core/notifications/base_event.py", line 57, in _coerce 
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) 
    2018-06-08 14:24:57 [113359] <err> cb.core.notifications.listener - Message handler threw an exception: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

Environment

  • Carbon Black Response Server: All Versions

Cause

 str() is called without checking that it will be a valid conversion

Resolution

  • There are no known issues caused by this error message
  • CB-23065 is filed to handle non-ascii characters