Open GadgetSteve opened 4 months ago
Hi @GadgetSteve
first of all, thanks a lot for reporting the issue. if I understood correctly, this is the content of the problematic file
# ℹCommand-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails
am i right?
can you tell what the path of the file is can you share the command you use to run?
in addition, if you find your changes as useful for other users, you are welcoming to contribute (-:
That was a part of the content, the lines that gave the problems. The problem happened in a work environment, so I can not share the actual file. After 2 months, I can't recall the exact command, but I know that I was scanning a large number of files.
Regards Steve
Describe the issue Running a scan and found in an otherwise working file that UnicodeDecodeError was raised crashing checkov.
Examples Eventually found which file was causing the issue, as below, and that the yaml file contained:
Luckly all in comments!
Exception Trace Please share the trace for the exception and all relevant output by checkov. To maximize the understanding, please run checkov with LOG_LEVEL set to debug as follows:
Not available!
Desktop (please complete the following information):
Additional context Was able to identify the problem file by modifying
C:\temp\test_install_checkov\Lib\site-packages\checkov\github_actions\runner.py
line 67-69 From:To:
This allowed me to actually see which file was giving the issues & since the odd characters were all in comments I was able to remove them so as to complete the run.
In general it is a shame that the UnicodeDecodeError does not give the name of the file that was being read when the exception occurred but a review of the code so as to improve reporting can allow the users to address such problems. (Or maybe add
errors='xmlcharrefreplace'
orerrors='backslashreplace'
on allopen
operations?)