Skip to content
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

cfn-lint gives an error output even if check empty yaml file #3573

Closed
ThomasDDY opened this issue Aug 5, 2024 · 4 comments · Fixed by #3574
Closed

cfn-lint gives an error output even if check empty yaml file #3573

ThomasDDY opened this issue Aug 5, 2024 · 4 comments · Fixed by #3574

Comments

@ThomasDDY
Copy link

CloudFormation Lint Version

1.9.5

What operating system are you using?

AWS Linux

Describe the bug

The new version of cfn-lint gives an error message even if checking the empty yaml file.
The last working version is 0.87.4. Any versions newer than 0.87.4 give the same error message.
Here is the output.

(venv) [root@ip-10-188-193-11 ~]# cfn-lint --version
cfn-lint 1.9.5
(venv) [root@ip-10-188-193-11 ~]# vi test.yaml
(venv) [root@ip-10-188-193-11 ~]# ls
test.yaml venv
(venv) [root@ip-10-188-193-11 ~]# cat test.yaml

test purpose

(venv) [root@ip-10-188-193-11 ~]# cfn-lint -t test.yaml
E0002 Unknown exception while processing rule E1001: "'dict' object has no attribute 'start_mark'"
test.yaml:1:1

Expected behavior

Fix the bug

Reproduction template

(venv) [root@ip-10-188-193-11 ~]# cfn-lint --version
cfn-lint 1.9.5
(venv) [root@ip-10-188-193-11 ~]# vi test.yaml
(venv) [root@ip-10-188-193-11 ~]# ls
test.yaml venv
(venv) [root@ip-10-188-193-11 ~]# cat test.yaml

test purpose

(venv) [root@ip-10-188-193-11 ~]# cfn-lint -t test.yaml
E0002 Unknown exception while processing rule E1001: "'dict' object has no attribute 'start_mark'"
test.yaml:1:1

@ThomasDDY
Copy link
Author

ThomasDDY commented Aug 7, 2024

@kddejong
I still got the error.
test.yaml only has one line comment. # test purpose

(venv) [root@ip-10-188-224-84 ~]# cfn-lint --version
cfn-lint 1.9.5
(venv) [root@ip-10-188-224-84 ~]# vi test.yaml
(venv) [root@ip-10-188-224-84 ~]# cfn-lint -t test.yaml
E0002 Unknown exception while processing rule E1001: "'dict' object has no attribute 'start_mark'"
test.yaml:1:1

(venv) [root@ip-10-188-224-84 ~]# cat test.yaml

test purpose

@kddejong
Copy link
Contributor

kddejong commented Aug 7, 2024

Fix is in main but not released. We've been releasing fairly frequently so shouldn't be much longer

@ThomasDDY
Copy link
Author

@kddejong
1.10.1 version gives another error for empty yaml file.

(venv) [root@ip-10-188-193-12 ~]# cfn-lint --version
cfn-lint 1.10.1
(venv) [root@ip-10-188-193-12 ~]# vi test.yaml
(venv) [root@ip-10-188-193-12 ~]# cat test.yaml

test purpose

(venv) [root@ip-10-188-193-12 ~]# cfn-lint -t test.yaml
E1001 'Resources' is a required property
test.yaml:1:1

@GZLiew
Copy link

GZLiew commented Aug 20, 2024

yes we are getting the error as well even with a defined json file with properties

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 a pull request may close this issue.

3 participants