terragrunt icon indicating copy to clipboard operation
terragrunt copied to clipboard

Getting (fatal error: concurrent map writes) every now and then in GH Actions

Open a-magdy opened this issue 9 months ago • 0 comments

Describe the bug

Sometimes we get the error

1093 fatal error: concurrent map writes

1095 goroutine 409 [running]: 1096 github.com/gruntwork-io/terragrunt/config.copyFieldsMetadata(...) 1097 /home/circleci/project/config/include.go:835 1098 github.com/gruntwork-io/terragrunt/config.(*TerragruntConfig).Merge(0xc00699a900, 0xc0049cbc20, 0x21137d8?) 1099 /home/circleci/project/config/include.go:297 +0xae8

in our github actions, it could happen during any of the steps, init, validate or plan

Steps To Reproduce

Can't really reproduce it, when we get it, we re-run the same workflow again, and it works

fatal error: concurrent map writes

goroutine 409 [running]:
github.com/gruntwork-io/terragrunt/config.copyFieldsMetadata(...)
	/home/circleci/project/config/include.go:835
github.com/gruntwork-io/terragrunt/config.(*TerragruntConfig).Merge(0xc00699a900, 0xc0049cbc20, 0x21137d8?)
	/home/circleci/project/config/include.go:297 +0xae8
github.com/gruntwork-io/terragrunt/config.handleInclude(0xc00061e770, 0xc003ad7680, 0x1)
	/home/circleci/project/config/include.go:133 +0x3a6
github.com/gruntwork-io/terragrunt/config.PartialParseConfig(0xc00061e150, 0xc002599780, 0x20fa846?)
	/home/circleci/project/config/config_partial.go:366 +0xb12
github.com/gruntwork-io/terragrunt/config.TerragruntConfigFromPartialConfig(0xc00061e150, 0xc002599780, 0x0)
	/home/circleci/project/config/config_partial.go:162 +0x356
github.com/gruntwork-io/terragrunt/config.PartialParseConfigFile(0xc00061e150, {0xc003902600, 0x7c}, 0xc005056c00?)
	/home/circleci/project/config/config_partial.go:142 +0x17f
github.com/gruntwork-io/terragrunt/config.decodeAndRetrieveOutputs(0xc000554460, 0xc0038a46c0)
	/home/circleci/project/config/dependency.go:193 +0x385
github.com/gruntwork-io/terragrunt/config.ParseConfig(0xc0007d8000, 0xc0038a46c0, 0xc003456000?)
	/home/circleci/project/config/config.go:795 +0x1ed
github.com/gruntwork-io/terragrunt/config.ParseConfigFile.func1({0x1c80f80?, 0x450f4f?})
	/home/circleci/project/config/config.go:722 +0x3c5

Expected behavior

Terragrunt to run without this random error

Nice to haves

  • [x] Terminal output
  • [ ] Screenshots

Versions

  • Terragrunt version: 0.55.21
  • OpenTofu/Terraform version: 1.5.7
  • Environment details (Ubuntu 20.04, Windows 10, etc.): Github Actions (ubuntu-latest-16-cores)

a-magdy avatar May 01 '24 12:05 a-magdy