question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeDecodeError with eb logs

See original GitHub issue

Description

When using eb logs, UnicodeDecodeError is thrown and no logs can be viewed

Steps to reproduce

eb logs

Observed result

The api request returned 200. But it seems the eb cli cannot display the returned logs.

2020-07-08 00:44:53,898 (INFO) eb : Traceback (most recent call last):
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/core/ebrun.py", line 62, in run_app
    app.run()
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/cement/core/foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/cement/core/controller.py", line 478, in _dispatch
    return func()
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/core/abstractcontroller.py", line 92, in default
    self.do_command()
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/controllers/logs.py", line 65, in do_command
    self.__get_logs()
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/controllers/logs.py", line 99, in __get_logs
    logsops.retrieve_beanstalk_logs(
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 486, in retrieve_beanstalk_logs
    get_logs(env_name, info_type, do_zip=do_zip, instance_id=instance_id)
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 345, in get_logs
    _handle_tail_logs(instance_id_list)
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 889, in _handle_tail_logs
    data.append(utils.decode_bytes(log_result))
  File "/usr/local/Cellar/aws-elasticbeanstalk/3.18.1/libexec/lib/python3.8/site-packages/ebcli/lib/utils.py", line 378, in decode_bytes
    value = value.decode('utf8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 9577: invalid start byte

2020-07-08 00:44:53,898 (INFO) eb : UnicodeDecodeError - 'utf-8' codec can't decode byte 0xfc in position 9577: invalid start byte

Expected result

Logs

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

MacOS 10.15.5 iTerm2 EB CLI 3.18.1 (Python 3.8.3)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

2reactions
lwiddershovencommented, Oct 22, 2020

I have the same issue, on linux. As this is my very first experience with eb (and aws for that matter) and my app doesn’t do what I expected it really is a nuisance.

leon@xyz:~/Development/spring-boot-aws-1$ eb logs
Retrieving logs...
ERROR: UnicodeDecodeError - 'utf-8' codec can't decode byte 0xe0 in position 20145: invalid continuation byte
leon@xyz:~/Development/spring-boot-aws-1$ eb logs
Retrieving logs...
ERROR: UnicodeDecodeError - 'utf-8' codec can't decode byte 0xe0 in position 1698: invalid continuation byte
leon@xyz:~/Development/spring-boot-aws-1$ eb logs
Retrieving logs...
ERROR: UnicodeDecodeError - 'utf-8' codec can't decode byte 0xe0 in position 1698: invalid continuation byte

I’m using Python 3.8.5, eb was compiled against a python 3.7.2 that was downloaded by the install scripts. No clue if that matters or not but it may be a library thing.

Note that eb logs -a does work. My terminal $LANG is en_US.UTF-8; maybe that is an issue?

1reaction
Palakpatel67commented, Jan 15, 2021

This ishould be fixed in awsebcli version 3.19.3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS UnicodeDecodeError when creating application on ...
eb init --debug. My output was something like this 2019-05-05 13:44:17,548 (INFO) eb : Traceback (most recent call last): File ...
Read more >
eb logs - AWS Elastic Beanstalk
The eb logs command has two distinct purposes: to enable or disable log streaming to CloudWatch Logs, and to retrieve instance logs or...
Read more >
awsebcli - PyPI
Fixed bug causing eb logs command to fail when logs contain unicode characters. Fixed bug that caused eb platform list to fail in...
Read more >
Running Rails on AWS Elastic Beanstalk (Migrating from ...
My first step was to install the Elastic Beanstalk command line tool. ... The logs told me that Rails couldn't connect to a...
Read more >
Deploying a Django App to AWS Elastic Beanstalk - Real Python
Let's look at how to deploy a Django App to AWS Elastic Beanstalk. ... eb logs. This will grab all the recent log...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found