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.

Request for improved handling of decode errors during builds.

See original GitHub issue

Hi,

Recently, my team encountered an error during a docker build where we hit the docker build log limit, and the output was clipped; this resulted in a random non-utf-8 character being produced. The log limit non-deterministically clipped off content in the middle of a UTF-8 Character. In our logs, there was a UTF-8 Character ➤ present; this is made up of 3 bytes (see Find all Unicode Characters from Hieroglyphs to Dingbats – Unicode Compart ) 0xE2 0x9E 0xA4. the 1MiB log clipping terminates the output at 0xE2 0x9E. It took us some time and troubleshooting to come to this finding.

We are asking if there could be more graceful handling of these decoding errors implemented as we believe that the current handling covered up the log limit error and produced a stack trace with the not-so-helpful UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 10-11: invalid continuation byte

Thank you!

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
LewisGaulcommented, Oct 5, 2022

It might be better to use one of the other decode error handling options, e.g. ignore errors instead of raising https://docs.python.org/3/library/codecs.html#error-handlers. Or could explicitly handle cases where decode errors are ‘expected’ by checking it occurs at the end of the string and just trimming the end off.

1reaction
gabrieldemarmiessecommented, Oct 17, 2022

I’m planning to do it on Thursday 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Json decode error during upload stage · Issue #2 - GitHub
It seems there are two problems here: The server returns a 400 Bad Request response with an empty body, after some requests for...
Read more >
Passing JSON Decode error into something actionable
First of all you can improve the error handling immensely if you print error instead of error.localizedDescription in a Decoding catch block ...
Read more >
codecs — Codec registry and base classes — Python 3.11.1 ...
This module defines base classes for standard Python codecs (encoders and decoders) and provides access to the internal Python codec registry, which manages...
Read more >
Error handling and Go - The Go Programming Language
If you have written any Go code you have probably encountered the built-in error type. Go code uses error values to indicate an...
Read more >
What is encoding and decoding? - TechTarget
Encoding and decoding are used in many forms of communications, including computing, data communications, programming, digital electronics and human ...
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