Skip to content

Crashing python check does not change exit code #7157

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
lacop11 opened this issue May 14, 2025 · 0 comments
Open

Crashing python check does not change exit code #7157

lacop11 opened this issue May 14, 2025 · 0 comments

Comments

@lacop11
Copy link

lacop11 commented May 14, 2025

When a custom Python check crashes the tool does not exit with non-zero exit code, which means CI integrations could be silently ignoring checks due to bugs.

Reproduction:

git clone https://github.com/lacop11/checkov-crash-repro.git
cd checkov-crash-repro
uvx [email protected] -d . --run-all-external-checks --external-checks-dir checks --quiet
echo $?

Output:

$ uvx ...
[ERROR]  Failed to run check CKV_BUG_1 on /main.tf:null_resource.example
Traceback (most recent call last):
...

$ echo $?
0

Expected output: Should exit with non-zero code (probably 2).

Notes

I feel like I'm missing something obvious but I can't find nothing relevant in docs nor github issues. There is the flag --no-fail-on-crash which I'm not setting and it defaults to false, and it's existence implies a crash should result in exit code 2.

Is there some other configuration change I need to make? It's surprising that default behavior would not fail on crashing check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant