UnicodeDecodeError with eb logs
See original GitHub issueDescription
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:
- Created 3 years ago
- Reactions:4
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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
isen_US.UTF-8
; maybe that is an issue?This ishould be fixed in awsebcli version 3.19.3.