Skip to content

logfile: Ignore decode errors #917

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leo-pempera
Copy link
Contributor

If there are unconforming entries in the input file the python open function can´t parse the input and throws an exception as the default error handling is set to 'strict'. Setting it to 'ignore' skips these characters and lets the exectuion continue.

In our monitoring we have seen the following error a couple of times:

Traceback (most recent call last):
  File "logfile.py", line 476, in 'module'
  File "logfile.py", line 292, in main
  File "'frozen codecs'", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x99 in position 3565: invalid start byte

The following line was the offending one in the log:

2025-07-31T05:15:03.646865+02:00 XXXX [XXXX][1060]: ERROR: <core> [XXXX]: parse_msg(): ERROR: parse_msg: message=<k._#030#031<H^?#010#015#0046e#036X%e#021~#003xek#034=YC#011#bb#016XB&q~nq#007{<99><D2>>

If there are unconforming entries in the input file the python open function can´t parse the input and throws an exception as the default error handling is set to 'strict'.
Setting it to 'ignore' skips these characters and lets the exectuion continue.

Error seen in our Monitoring:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x99 in position 2443: invalid start byte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant