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

Ignore-checks doesn't work for E000* #1133

Closed
jeffmacdonald opened this issue Sep 17, 2019 · 13 comments · Fixed by #1580
Closed

Ignore-checks doesn't work for E000* #1133

jeffmacdonald opened this issue Sep 17, 2019 · 13 comments · Fixed by #1580
Labels
bug Something isn't working

Comments

@jeffmacdonald
Copy link

jeffmacdonald commented Sep 17, 2019

*cfn-lint version: 0.22.3

Ignore Checks isn't working

Template: https://gist.github.com/jeffmacdonald/cbbdd8cc3a049f89dfb4a17991ca1afa

I am getting the following error:

E0000 Expecting value
templates/ssh-jump-host.yaml:1:1

When I run pipenv run cfn-lint --ignore-checks=E0000 templates/ssh-jump-host.yaml

The fun part is, I have I have errors in other templates (E2521) and I am able to ignore those just fine... it seems it's specifically E0000 that doesn't get ignored.

@kddejong kddejong added the bug Something isn't working label Sep 30, 2019
@kddejong
Copy link
Contributor

Agreed some of the E0000-E0005 checks may not be properly skipped when being configured to ignore them. We'll have to add some logic in for some of these generic rules.

@tkeeber
Copy link

tkeeber commented Apr 17, 2020

Is this still an issue? I'm trying to ignore a check on a specific resource which uses a Transform function. But it is not getting ignore when i use the following;

    Metadata:
      cfn-lint:
        config:
          ignore_checks:
          - E3001
          - E0001

@stlava
Copy link

stlava commented Jun 8, 2020

Seeing the same issue with E0000.

@raphael-riel
Copy link

Idem here. E0001 won't be ignored.
Tried ignoring in Metadata on Resource, top-level node, and in .cfnlintrc file.

@miparnisari
Copy link
Contributor

Agreed some of the E0000-E0005 checks may not be properly skipped when being configured to ignore them. We'll have to add some logic in for some of these generic rules.

@kddejong can you expand a bit on why it's failing for that particular subset of rules?

@kddejong
Copy link
Contributor

They aren't standard rules. The are errors throw when a rule has an exception, or when the template is malformed, or has a null value, or the template can't be found, etc. I don't think there is any reason they can't be ignored. I think we would need to build in a little bit better logic for those types of errors.

Additional I think there may be a few exceptions we have to figure out how to handle.

  • Metadata based exceptions may not work as expected. For instance, I'm not sure we can put an exception in Metadata to ignore the E0000 code for a null value in the template because we are doing that rule at template parsing time. In which case I never have the Metadata to read to apply the exception.
  • Another one will be if the serverless transform fails. We may be able to ignore the error but we can't really check the rest of the rules with a non transformed template. I'm not sure what our expectation would be in this case.

https://github.com/aws-cloudformation/cfn-python-lint/blob/fe0af928a4ab26a6cedfd76564a26c9a4120b14f/src/cfnlint/rules/__init__.py#L424-L448

E0000 could be ignorable. In the early stages we also had a parameter called --ignore-bad-template which was supposed to help there. Given the feature changes since this parameter was put in we would have probably done this differently.

@kddejong
Copy link
Contributor

@miparnisari let me take a swing at this one. I'll want your opinions on some of this as we go but I think I have an idea or two.

@PatMyron PatMyron changed the title Ignore-checks doesn't seem to quite work. Ignore-checks doesn't work for E000* Aug 26, 2020
@mrpatrick
Copy link

This still does not work for me running cfn-lint version 0.51.0 on a SAM template file:

cfn-lint --ignore-checks=E0000 -t template.yaml
E0000 Duplicate resource found "TaskType" (line 200)
template.yaml:200:11

E0000 Duplicate resource found "TaskType" (line 203)
template.yaml:203:11

@PatMyron
Copy link
Contributor

@mrpatrick can you try a space instead of =?

@mrpatrick
Copy link

@PatMyron yes, I tried that too - also tried --ignore-bad-template

cfn-lint --ignore-checks E0000 -t template.yaml
E0000 Duplicate resource found "TaskType" (line 200)
template.yaml:200:11

E0000 Duplicate resource found "TaskType" (line 203)
template.yaml:203:11

cfn-lint --ignore-bad-template --ignore-checks E0000 -t template.yaml
E0000 Duplicate resource found "TaskType" (line 200)
template.yaml:200:11

E0000 Duplicate resource found "TaskType" (line 203)
template.yaml:203:11

@PatMyron
Copy link
Contributor

PatMyron commented Jun 16, 2021

@mrpatrick comfortable sharing the template as well?

@mrpatrick
Copy link

@PatMyron Here is the relevant code snippet (redacted much of the resource which isn't relevant):

  AppFlow:
    DependsOn: "SomeBucketPolicy"
    Type: AWS::AppFlow::Flow
    Properties:
      Tasks:
        - TaskType: Filter
          SourceFields:
            - Email
          ConnectorOperator:
            Salesforce: PROJECTION
        - TaskType: Map
          SourceFields:
            - Email
          TaskProperties:
            - Key: SOURCE_DATA_TYPE
              Value: string
            - Key: DESTINATION_DATA_TYPE
              Value: string
          DestinationField: Email
          ConnectorOperator:
            Salesforce: NO_OP
        - TaskType: Map
          SourceFields:
            - Some_Thing__c
          TaskType: Map
          TaskProperties:
            - Key: SOURCE_DATA_TYPE
              Value: string
            - Key: DESTINATION_DATA_TYPE
              Value: string
          DestinationField: Some_Thing__c
          ConnectorOperator:
            Salesforce: NO_OP
        - TaskType: Map
          SourceFields:
            - Role__c
          TaskType: Map
          TaskProperties:
            - Key: SOURCE_DATA_TYPE
              Value: string
            - Key: DESTINATION_DATA_TYPE
              Value: string
          DestinationField: Role__c
          ConnectorOperator:
            Salesforce: NO_OP
      TriggerConfig:
        TriggerType: Event

The issue is the the TaskType: Map appears twice for the last 2 tasks. cnf-lint (correctly) throws 30000 (this is a bug with my code). I didn't notice it until cfn-lint called it out, however, since cloudformation didn't complain (It actually works fine in cloudformation), I wanted to ignore the check, which doesn't appear to work (see above post).

@thiagomarinho
Copy link

thiagomarinho commented May 6, 2024

Hello :)

It seems like this issue is still happening, right? Is there some sort of fix that maybe I missed that would allow ignoring E0000 for example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants