stelligent / config-lint

Command line tool to validate configuration files
https://stelligent.github.io/config-lint/#/
MIT License
193 stars 39 forks source link

issues with latest release #196

Closed AFriemann closed 4 years ago

AFriemann commented 4 years ago

EDIT: white this is likely still an issue, my current problem starts with the next comment

When running config-lint for terraform I currently get these for everything

  {
    "AssertionMessage": "At 6:10: Unknown token: 6:10 IDENT var.tags",
    "Category": "load",
    "CreatedAt": "2020-04-17T14:09:09Z",
    "Filename": "config.tf",
    "LineNumber": 0,
    "ResourceID": "config.tf",
    "ResourceType": "file",
    "RuleID": "FILE_LOAD",
    "RuleMessage": "Unable to load file",
    "Status": "FAILURE"
  },

running strace shows

epoll_ctl(4, EPOLL_CTL_DEL, 3, 0xc0001fe5ec) = -1 EPERM (Operation not permitted)

for every file that is raised, which is reasonable since epoll can not be run on normal files.

Any clue what is going on here? I'm on void linux (musl).

AFriemann commented 4 years ago

ok, I have to correct myself. Seems like I was on an old release (0.44). Updated to 1.0 now and running into this issue:

$ config-lint -terraform .
Failed to load built-in rules for Terraform: File or directory doesnt exist

seems to try to open something in /home/runner ? what should be in there?

AFriemann commented 4 years ago

this seems like the build is broken somehow tbh - I see that /home/runner only shows up in your github workflows. I assume that shouldn't be happening.

AFriemann commented 4 years ago

definitely tries to open some files in /home/runner/work/config-lint/config-lint/cli/assets/terraform

AFriemann commented 4 years ago

i'm trying to build it locally but still have some trouble

kmonihen commented 4 years ago

Replicated

~/config-lint/example-files/config# config-lint -debug -terraform
Looking for file terraform in Box: {./assets /home/runner/work/config-lint/config-lint/cli map[] map[]}
New Box: {./assets/terraform /home/runner/work/config-lint/config-lint/cli map[] map[]}
Failed to load built-in rules for Terraform: File or directory doesnt exist
AFriemann commented 4 years ago

so building it locally seems to work; will try once a new release is out if my initial issue is gone. If not I guess it's likely due to musl?

kmonihen commented 4 years ago

I'm working on a fix, it appears to be a relative pathing issue when referencing files in the packr box.

Thanks for raising the issue, we'll need to add better smoke tests as well.

AFriemann commented 4 years ago

sure, thx for the fast response; sh*t happens :) Trying it currently and for now it's really impressive :+1: Unlike tflint it actually finds something in our modules, which is great.

CubicNitrous commented 4 years ago

@kmonihen im still seeing this in 1.1.0

config-lint -terraform main.tf -debug
Failed to load built-in rules for Terraform: File or directory doesnt exist
config-lint --version
1.1.0
kmonihen commented 4 years ago

@CubicNitrous Please try with 1.2.0, the 1.1.0 release was cut without the fix

CubicNitrous commented 4 years ago

@kmonihen looks good in 1.2.0 thanks for the quick fix!

kmonihen commented 4 years ago

@AFriemann This should be fixed in 1.2.0. Thanks again for bringing it to our attention.