Checkov (3.2.368) crashes with KeyError: '__startline__'
when scanning restructured serverless YAML file
#7006
Labels
KeyError: '__startline__'
when scanning restructured serverless YAML file
#7006
We've been using Checkov for serverless checks in our Bitbucket Pipelines CI/CD, and it has been working fine with our standard serverless configurations, scanning everything properly. However, after recently modularizing our serverless YAML files—splitting them into separate files for functions and resources, and referencing them in the main
serverless.yml
— Checkov started throwing errors during scans. Specifically, it seems unable to process the file references within the main YAML file. Since restructuring, Checkov consistently throws aKeyError: '__startline__'
when scanning. We've validated the YAML files using yamllint, and no syntax errors are present. The issue appears to be related to how Checkov handles modular serverless resources, and it persists even after addressing all reported YAML issues.Examples
checkov -f serverless.yml
Exception Trace
ran
LOG_LEVEL=debug checkov -d .
checkov --version 3.2.368
Desktop (please complete the following information):
Ubuntu 20.04.6
3.2.368
Additional context
The text was updated successfully, but these errors were encountered: