Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs tail fails to due to charmap problem #8928

Closed
DaniWe opened this issue Sep 18, 2024 · 2 comments
Closed

logs tail fails to due to charmap problem #8928

DaniWe opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness logs p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@DaniWe
Copy link

DaniWe commented Sep 18, 2024

Describe the bug

Executing the following command in PS:

aws logs tail /aws/elasticbeanstalk/app-test-env/var/log/web.stdout.log --since 1h >D:\app-test.log

resulted in the following error and only part of the log was downloaded:
'charmap' codec can't encode character '\u2720' in position 1059: character maps to

Expected Behavior

aws logs tail must deal with undefined characters and unknown character encoding and continue download of the complete log file, with:

  1. The unknown character removed, or
  2. the line containing the unknown character removed, or
  3. replace the unknown character with a default character, such as '?' or ' ', or
  4. the text bytes copied verbatim without any string interaction or parsing/de/encoding by the python language.

Number 4 is obviously the most preferred, followed by number 3 or 1.

Current Behavior

As written in the description; logs tail stops with the following error:

'charmap' codec can't encode character '\u2720' in position 1059: character maps to

Reproduction Steps

I am not certain what character has been inserted into the log to cause this behavior. Could be an upper latin-1 character output in the stream by printing of a "foreign" name perhaps. I suppose inserting '\u2720' into a log file and trying to download it should trigger the bug.

Possible Solution

No response

Additional Information/Context

Our applications producing the logs are written in java21 with spring boot 3.2.0 and lombok.extern.slf4j.Slf4j logger.

CLI version used

aws-cli/2.13.34 Python/3.11.6 Windows/10 exe/AMD64 prompt/off

Environment details (OS name and version, etc.)

Windows 11, PowerShell.

@DaniWe DaniWe added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 18, 2024
@tim-finnigan tim-finnigan self-assigned this Sep 20, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. Can you update your version of the AWS CLI? Version 2.13.34 is extremely old — the latest version is 2.17.55 per the CHANGELOG.

The ...codec can't encode character... error has been reported several times here in the past. This issue is generally caused by your system's locale configurations. Some solutions mentioned in those issues include:

  • Updating to a more recent version of the AWS CLI.
  • Setting your system locale to use UTF-8.
  • Assigning this environment variable:PYTHONUTF8=1

@tim-finnigan tim-finnigan added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. logs p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Sep 20, 2024
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 30, 2024
@github-actions github-actions bot closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness logs p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants