Uploaded image for project: 'Hue (READ ONLY)'
  1. Hue (READ ONLY)
  2. HUE-2264

[core] UnicodeDecodeError when downloading logs as a zip

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.5.0
    • Fix Version/s: None
    • Component/s: core.api
    • Labels:
      None

      Description

      On my 5.0 and 5.1 instance I can't download the server logs as a zip through the "/logs" page. I have a customer seeing the same behavior. Here is the stack trace:

      [05/Aug/2014 09:12:19 -0700] access WARNING 192.168.21.15 cconner - "GET /desktop/download_logs HTTP/1.1"
      [05/Aug/2014 09:12:19 -0700] views ERROR Couldn't construct zip file to write logs to: %s
      Traceback (most recent call last):
      File "/opt/cloudera/parcels/CDH-5.1.0-1.cdh5.1.0.p0.53/lib/hue/desktop/core/src/desktop/views.py", line 103, in download_log_view
      log_tmp.write(smart_str(l) + '\n')
      File "/opt/cloudera/parcels/CDH-5.1.0-1.cdh5.1.0.p0.53/lib/hue/desktop/core/src/desktop/lib/i18n.py", line 79, in smart_str
      s, get_site_encoding(), strings_only, errors)
      File "/opt/cloudera/parcels/CDH-5.1.0-1.cdh5.1.0.p0.53/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/utils/encoding.py", line 128, in smart_str
      return s.decode('utf-8', errors).encode(encoding, errors)
      File "/usr/lib64/python2.6/encodings/utf_8.py", line 16, in decode
      return codecs.utf_8_decode(input, errors, True)
      UnicodeDecodeError: 'utf8' codec can't decode byte 0xd8 in position 69: unexpected end of data
      [05/Aug/2014 09:12:19 -0700] middleware INFO Processing exception: unsupported operand type(s) for %: 'NoneType' and 'exceptions.UnicodeDecodeError': Traceback (most recent call last):
      File "/opt/cloudera/parcels/CDH-5.1.0-1.cdh5.1.0.p0.53/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
      response = callback(request, *callback_args, **callback_kwargs)
      File "/opt/cloudera/parcels/CDH-5.1.0-1.cdh5.1.0.p0.53/lib/hue/desktop/core/src/desktop/views.py", line 121, in download_log_view
      logging.exception("Couldn't construct zip file to write logs to: %s") % e
      TypeError: unsupported operand type(s) for %: 'NoneType' and 'exceptions.UnicodeDecodeError'

      [05/Aug/2014 09:12:19 -0700] base ERROR Internal Server Error: /desktop/download_logs
      Traceback (most recent call last):
      File "/opt/cloudera/parcels/CDH-5.1.0-1.cdh5.1.0.p0.53/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
      response = callback(request, *callback_args, **callback_kwargs)
      File "/opt/cloudera/parcels/CDH-5.1.0-1.cdh5.1.0.p0.53/lib/hue/desktop/core/src/desktop/views.py", line 121, in download_log_view
      logging.exception("Couldn't construct zip file to write logs to: %s") % e
      TypeError: unsupported operand type(s) for %: 'NoneType' and 'exceptions.UnicodeDecodeError'

      There is a funky character on column 69. Can you save the page?

      File "/usr/lib64/python2.6/encodings/utf_8.py", line 16, in decode
      return codecs.utf_8_decode(input, errors, True)
      UnicodeDecodeError: 'utf8' codec can't decode byte 0xd8 in position 69: unexpected end of data

      Or add a print l just before
      File "/opt/cloudera/parcels/CDH-5.
      1.0-1.cdh5.1.0.p0.53/lib/hue/desktop/core/src/desktop/views.py", line 103, in download_log_view
      log_tmp.write(smart_str(l) + '\n')

      We should probably replace the char instead of failing

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              romain Romain Rigaux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: