-
Notifications
You must be signed in to change notification settings - Fork 380
Closed
Labels
Description
Summary
It fails to run inside docker container in Jenkins CI with a panic crash.
Thought not clear why because the code checked out in Jenkins workspace is mounted inside docker container.
FYI Jenkins scripted pipeline invocation:
stage('Run TFLint') {
docker.image('ghcr.io/terraform-linters/tflint-bundle:latest').inside("--entrypoint=''") {
sh "export TFLINT_LOG=debug; tflint --chdir=${directory}/"
}
}
Command
tflint --chdir=terraform/pipeline/
Terraform Configuration
module "env" {
source = "../modules/env"
}
module "core" {
source = "../modules/vpc"
vpc_cidr = lookup(module.env.accounts[var.environment], "vpc_cidr")
internal_dns_domain = lookup(module.env.accounts[var.environment], "internal_dns_domain")
availability_zones_count = lookup(module.env.accounts[var.environment], "availability_zones_count")
environment = var.environment
extra_tags = {
Environment = var.environment
ManagedBy = "Terraform"
}
}
module "key_pairs" {
source = "../modules/key_pairs"
key_name_prefix = var.environment
}
TFLint Configuration
config {
module = true
plugin_dir = "/root/.tflint.d/plugins"
}
plugin "terraform" {
enabled = true
preset = "all"
}
plugin "aws" {
enabled = true
}
Output
[Pipeline] { (Run TFLint)
[Pipeline] isUnix
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ docker inspect -f . ghcr.io/terraform-linters/tflint-bundle:latest
.
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] withDockerContainer
Jenkins does not seem to be running inside a container
$ docker run -t -d -u 995:992 --entrypoint= -w /var/lib/jenkins/jobs/terraform/jobs/pipeline/workspace -v /var/lib/jenkins/jobs/terraform/jobs/pipeline/workspace:/var/lib/jenkins/jobs/terraform/jobs/pipeline/workspace:rw,z -v /var/lib/jenkins/jobs/terraform/jobs/pipeline/workspace@tmp:/var/lib/jenkins/jobs/terraform/jobs/pipeline/workspace@tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ghcr.io/terraform-linters/tflint-bundle:latest cat
$ docker top f7577b9ab73ef6c47f39e2df19fae9fd56498e8b3be5ec73b2feb5ffdd5e881c -eo pid,comm
[Pipeline] {
[Pipeline] sh
+ export 'TFLINT_LOG=debug'
+ tflint '--chdir=terraform/pipeline/'
10:06:34 config.go:126: [INFO] Load config: .tflint.hcl
10:06:34 config.go:253: [DEBUG] Config loaded
10:06:34 config.go:254: [DEBUG] Module: true
10:06:34 config.go:255: [DEBUG] Force: false
10:06:34 config.go:256: [DEBUG] IgnoreModules:
10:06:34 config.go:260: [DEBUG] Varfiles:
10:06:34 config.go:261: [DEBUG] Variables:
10:06:34 config.go:262: [DEBUG] DisabledByDefault: false
10:06:34 config.go:263: [DEBUG] PluginDir: /root/.tflint.d/plugins
10:06:34 config.go:264: [DEBUG] Format:
10:06:34 config.go:265: [DEBUG] Rules:
10:06:34 config.go:269: [DEBUG] Plugins:
10:06:34 config.go:271: [DEBUG] terraform: enabled=true, version=, source=
10:06:34 config.go:271: [DEBUG] aws: enabled=true, version=, source=
10:06:34 option.go:51: [DEBUG] CLI Options
10:06:34 option.go:52: [DEBUG] Module: false
10:06:34 option.go:53: [DEBUG] Force: false
10:06:34 option.go:54: [DEBUG] IgnoreModules:
10:06:34 option.go:58: [DEBUG] EnableRules:
10:06:34 option.go:59: [DEBUG] DisableRules:
10:06:34 option.go:60: [DEBUG] Only:
10:06:34 option.go:61: [DEBUG] EnablePlugins:
10:06:34 option.go:62: [DEBUG] Varfiles:
10:06:34 option.go:63: [DEBUG] Variables:
10:06:34 option.go:64: [DEBUG] Format:
10:06:34 loader.go:38: [INFO] Initialize new loader
10:06:34 module_mgr.go:63: [INFO] Module manifest file found. Initializing...
10:06:34 loader.go:80: [INFO] Module inspection is enabled. Building the root module with children...
10:06:34 loader.go:114: [DEBUG] Trying to load the module: key=core, version=, dir=../modules/vpc
10:06:34 loader.go:114: [DEBUG] Trying to load the module: key=env, version=, dir=../modules/env
10:06:34 loader.go:114: [DEBUG] Trying to load the module: key=key_pairs, version=, dir=../modules/key_pairs
10:06:34 runner.go:45: [INFO] Initialize new runner for root
10:06:34 runner.go:45: [INFO] Initialize new runner for module.env
10:06:34 runner.go:45: [INFO] Initialize new runner for module.key_pairs
10:06:34 runner.go:45: [INFO] Initialize new runner for module.core
Panic: runtime error: invalid memory address or nil pointer dereference
-> 0: main.main.func1: /main.go(25)
-> 1: runtime.gopanic: /panic.go(884)
-> 2: runtime.panicmem: /panic.go(260)
-> 3: runtime.sigpanic: /signal_unix.go(835)
-> 4: github.com/terraform-linters/tflint/plugin.checkPluginExistance: /discovery.go(141)
-> 5: github.com/terraform-linters/tflint/plugin.findPluginPath: /discovery.go(126)
-> 6: github.com/terraform-linters/tflint/plugin.FindPluginPath: /discovery.go(86)
-> 7: github.com/terraform-linters/tflint/plugin.Discovery: /discovery.go(29)
-> 8: github.com/terraform-linters/tflint/cmd.launchPlugins: /inspect.go(242)
-> 9: github.com/terraform-linters/tflint/cmd.(*CLI).inspectModule: /inspect.go(165)
-> 10: github.com/terraform-linters/tflint/cmd.(*CLI).inspect.func1: /inspect.go(50)
-> 11: github.com/terraform-linters/tflint/cmd.(*CLI).withinChangedDir: /cli.go(186)
-> 12: github.com/terraform-linters/tflint/cmd.(*CLI).inspect: /inspect.go(32)
-> 13: github.com/terraform-linters/tflint/cmd.(*CLI).Run: /cli.go(102)
-> 14: main.main: /main.go(38)
-> 15: runtime.main: /proc.go(250)
-> 16: runtime.goexit: /asm_amd64.s(1594)
TFLint crashed... :(
Please attach an output log, describe the situation and version that occurred and post an issue to https://github.com/terraform-linters/tflint/issues
TFLint Version
0.44.1
Terraform Version
1.3.7
Operating System
- Linux
- macOS
- Windows
ksommoxy