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

[BUG] falco will crush with the fastly service without VCL in the terraform planned output #185

Open
Shinyaigeek opened this issue Sep 20, 2023 · 1 comment
Assignees

Comments

@Shinyaigeek
Copy link

Describe the problem

falco will crush if falco get the fastly service without VCL in the terraform planned output. I have the project which have the multiple fastly services managed in the single terraform state. These fastly services include the service which does not have VCL.

I tried to introduce falco linter/tester into this project, but when I run terraform show -json planned.out | falco terraform command, falco will crush with the below error output.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1008da520]

goroutine 1 [running]:
main.(*Runner).run(0x140002ae690, 0x2?, 0x0, 0x1)
        /home/runner/work/falco/falco/cmd/falco/runner.go:227 +0x30
main.(*Runner).Run(0x140002ae690, {0x100bf16c0?, 0x140007b26c0})
        /home/runner/work/falco/falco/cmd/falco/runner.go:211 +0x180
main.runLint(0x140002ae690, {0x100bf16c0?, 0x140007b26c0?})
        /home/runner/work/falco/falco/cmd/falco/main.go:145 +0x30
main.main()
        /home/runner/work/falco/falco/cmd/falco/main.go:131 +0x84c

falco's linter/tester/simulator expect all fastly service to have VCL (ref: https://github.com/ysugimoto/falco/blob/main/resolver/terraform.go#L29), so falco will crush when falco encounter the fastly service which does not have VCL. I think falco should filter the fastly services which does not have VCL in advance.

VCL code that cause the problem

This is not related to VCL, but I made simple repro; https://github.com/Shinyaigeek/falco-with-multiple-services

Desktop (please complete the following information):

  • OS: MacOS arm64
  • Shell zsh
@Shinyaigeek
Copy link
Author

Shinyaigeek commented Sep 20, 2023

I sent the PR to fix this issue in #186

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

No branches or pull requests

2 participants