Loading...
Loading...
### Terraform Version ```shell Terraform v0.12.31 ``` ### Terraform Configuration Files ```terraform #!/bin/bash terraformPath=$1 environment=$2 cd $terraformPath resourceGroupName=$(grep -i 'resource_group_name' "./Config/backend.$environment.tfvars" | awk -F'=' '{print $2}' | sed -e 's/"//g' | sed -e 's/ //g') backendStorageAccount=$(grep -i 'storage_account_name' "./Config/backend.$environment.tfvars" | awk -F'=' '{print $2}' | sed -e 's/"//g' | sed -e 's/ //g') containerName=$(grep -i 'container_name' "./Config/backend.$environment.tfvars" | awk -F'=' '{print $2}' | sed -e 's/"//g' | sed -e 's/ //g') subscriptionId=$(grep -i 'subscription_id' "./Config/backend.$environment.tfvars" | awk -F'=' '{print $2}' | sed -e 's/"//g' | sed -e 's/ //g') echo "resourceGroupName:" $resourceGroupName echo "backendStorageAccount:" $backendStorageAccount echo "containerName:" $containerName echo "subscriptionId:" $subscriptionId #set subscription to ado subscription az account set --subscription $subscriptionId echo "Check if storage account $backendStorageAccount exists in resource group $resourceGroupName" az storage account show -n $backendStorageAccount -g $resourceGroupName if [ $? -eq 0 ] then echo "Using storage account $backendStorageAccount in resource group $resourceGroupName" else echo "$backendStorageAccount storage account in resource group $resourceGroupName was not found." echo "Please ensure the base infrastructure pipeline ran successfully and try again" exit -1 fi az storage container create --name $containerName --account-name $backendStorageAccount ...terraform config... ``` ### Debug Output ``` panic: runtime error: slice bounds out of range goroutine 272 [running]: github.com/zclconf/go-cty/cty/json.unmarshalTuple(0xc000a54c00, 0x596, 0x600, 0xc0006f99e0, 0x8, 0x9, 0x0, 0x0, 0x0, 0xc00005c070, ...) /go/pkg/mod/github.com/zclconf/go-cty@v1.2.1/cty/json/unmarshal.go:282 +0x1040 github.com/zclconf/go-cty/cty/json.unmarshal(0xc000a54c00, 0x596, 0x600, 0x246cb20, 0xc0001a8c20, 0x0, 0x0, 0x0, 0xc00135dde8, 0x40c1d8, ...) /go/pkg/mod/github.com/zclconf/go-cty@v1.2.1/cty/json/unmarshal.go:43 +0x51c github.com/zclconf/go-cty/cty/json.Unmarshal(0xc000a54c00, 0x596, 0x600, 0x246cb20, 0xc0001a8c20, 0x0, 0xc00000e498, 0x1bd1de0, 0xc00009b3b0, 0x0, ...) /go/pkg/mod/github.com/zclconf/go-cty@v1.2.1/cty/json/value.go:64 +0x77 github.com/hashicorp/terraform/states/statefile.prepareStateV4(0xc000e05d10, 0x1b173, 0x1fe00, 0x1be8720, 0xc000e05d10) /home/circleci/project/project/states/statefile/version4.go:289 +0x8bc github.com/hashicorp/terraform/states/statefile.readStateV4(0xc001a88000, 0x1b173, 0x1fe00, 0xc00135eb00, 0x1, 0x1, 0x0) /home/circleci/project/project/states/statefile/version4.go:26 +0x14e github.com/hashicorp/terraform/states/statefile.readState(0xc001a88000, 0x1b173, 0x1fe00, 0xc001a88000, 0x1b173, 0x1fe00, 0x0) /home/circleci/project/project/states/statefile/read.go:101 +0x7b9 github.com/hashicorp/terraform/states/statefile.Read(0x2425400, 0xc0018bb500, 0x0, 0x0, 0x42afff) /home/circleci/project/project/states/statefile/read.go:55 +0x2c0 github.com/hashicorp/terraform/state/remote.(*State).refreshState(0xc000207080, 0x1fd9700, 0xc000207080, 0x0) /home/circleci/project/project/state/remote/state.go:130 +0x13a github.com/hashicorp/terraform/state/remote.(*State).RefreshStateWithoutCheckVersion(0xc000207080, 0x0, 0x0) /home/circleci/project/project/state/remote/state.go:110 +0x72 github.com/hashicorp/terraform/builtin/providers/terraform.dataSourceRemoteStateRead(0x246caa0, 0xc00000f890, 0x1bd1de0, 0xc0016645d0, 0xc0001f2160, 0x16, 0xc0004858f0, 0xc, 0x0, 0x0, ...) /home/circleci/project/project/builtin/providers/terraform/data_source_state.go:114 +0x870 github.com/hashicorp/terraform/builtin/providers/terraform.(*Provider).ReadDataSource(0xc00064cd80, 0xc0001f2160, 0x16, 0x246caa0, 0xc00000f890, 0x1bd1de0, 0xc0016645d0, 0x0, 0x0, 0x0, ...) /home/circleci/project/project/builtin/providers/terraform/provider.go:80 +0x26d github.com/hashicorp/terraform/terraform.(*EvalReadData).Eval(0xc0006a0a80, 0x24a2960, 0xc0003ff110, 0x2, 0x2, 0x0, 0x0) /home/circleci/project/project/terraform/eval_read_data.go:205 +0x16b5 github.com/hashicorp/terraform/terraform.EvalRaw(0x2427520, 0xc0006a0a80, 0x24a2960, 0xc0003ff110, 0x0, 0x0, 0x0, 0x0) /home/circleci/project/project/terraform/eval.go:57 +0x131 github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc001582b80, 0x24a2960, 0xc0003ff110, 0x2, 0x2, 0xf3e66d, 0x24273c0) /home/circleci/project/project/terraform/eval_sequence.go:20 +0xfd github.com/hashicorp/terraform/terraform.EvalRaw(0x2427660, 0xc001582b80, 0x24a2960, 0xc0003ff110, 0x1bc2480, 0x3535784, 0x1b25bc0, 0xc0008f60b0) /home/circleci/project/project/terraform/eval.go:57 +0x131 github.com/hashicorp/terraform/terraform.Eval(0x2427660, 0xc001582b80, 0x24a2960, 0xc0003ff110, 0xc001582b80, 0x2427660, 0xc001582b80, 0x0) /home/circleci/project/project/terraform/eval.go:35 +0x4d github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x1e66060, 0xc000482c90, 0x0, 0x0, 0x0) /home/circleci/project/project/terraform/graph.go:90 +0xf40 github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc001342480, 0x1e66060, 0xc000482c90, 0xc000e847c0) /home/circleci/project/project/dag/walk.go:392 +0x353 created by github.com/hashicorp/terraform/dag.(*Walker).Update /home/circleci/project/project/dag/walk.go:314 +0xa9b !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! Terraform crashed! This is always indicative of a bug within Terraform. A crash log has been placed at "crash.log" relative to your current working directory. It would be immensely helpful if you could please report the crash with Terraform[1] so that we can fix this. When reporting bugs, please include your terraform version. That information is available on the first line of crash.log. You can also get it by running 'terraform --version' on the command line. SECURITY WARNING: the "crash.log" file that was created may contain sensitive information that must be redacted before it is safe to share on the issue tracker. ``` ### Expected Behavior no errors occur ### Actual Behavior ``` panic: runtime error: slice bounds out of range goroutine 272 [running]: github.com/zclconf/go-cty/cty/json.unmarshalTuple(0xc000a54c00, 0x596, 0x600, 0xc0006f99e0, 0x8, 0x9, 0x0, 0x0, 0x0, 0xc00005c070, ...) /go/pkg/mod/github.com/zclconf/go-cty@v1.2.1/cty/json/unmarshal.go:282 +0x1040 github.com/zclconf/go-cty/cty/json.unmarshal(0xc000a54c00, 0x596, 0x600, 0x246cb20, 0xc0001a8c20, 0x0, 0x0, 0x0, 0xc00135dde8, 0x40c1d8, ...) /go/pkg/mod/github.com/zclconf/go-cty@v1.2.1/cty/json/unmarshal.go:43 +0x51c github.com/zclconf/go-cty/cty/json.Unmarshal(0xc000a54c00, 0x596, 0x600, 0x246cb20, 0xc0001a8c20, 0x0, 0xc00000e498, 0x1bd1de0, 0xc00009b3b0, 0x0, ...) /go/pkg/mod/github.com/zclconf/go-cty@v1.2.1/cty/json/value.go:64 +0x77 github.com/hashicorp/terraform/states/statefile.prepareStateV4(0xc000e05d10, 0x1b173, 0x1fe00, 0x1be8720, 0xc000e05d10) /home/circleci/project/project/states/statefile/version4.go:289 +0x8bc github.com/hashicorp/terraform/states/statefile.readStateV4(0xc001a88000, 0x1b173, 0x1fe00, 0xc00135eb00, 0x1, 0x1, 0x0) /home/circleci/project/project/states/statefile/version4.go:26 +0x14e github.com/hashicorp/terraform/states/statefile.readState(0xc001a88000, 0x1b173, 0x1fe00, 0xc001a88000, 0x1b173, 0x1fe00, 0x0) /home/circleci/project/project/states/statefile/read.go:101 +0x7b9 github.com/hashicorp/terraform/states/statefile.Read(0x2425400, 0xc0018bb500, 0x0, 0x0, 0x42afff) /home/circleci/project/project/states/statefile/read.go:55 +0x2c0 github.com/hashicorp/terraform/state/remote.(*State).refreshState(0xc000207080, 0x1fd9700, 0xc000207080, 0x0) /home/circleci/project/project/state/remote/state.go:130 +0x13a github.com/hashicorp/terraform/state/remote.(*State).RefreshStateWithoutCheckVersion(0xc000207080, 0x0, 0x0) /home/circleci/project/project/state/remote/state.go:110 +0x72 github.com/hashicorp/terraform/builtin/providers/terraform.dataSourceRemoteStateRead(0x246caa0, 0xc00000f890, 0x1bd1de0, 0xc0016645d0, 0xc0001f2160, 0x16, 0xc0004858f0, 0xc, 0x0, 0x0, ...) /home/circleci/project/project/builtin/providers/terraform/data_source_state.go:114 +0x870 github.com/hashicorp/terraform/builtin/providers/terraform.(*Provider).ReadDataSource(0xc00064cd80, 0xc0001f2160, 0x16, 0x246caa0, 0xc00000f890, 0x1bd1de0, 0xc0016645d0, 0x0, 0x0, 0x0, ...) /home/circleci/project/project/builtin/providers/terraform/provider.go:80 +0x26d github.com/hashicorp/terraform/terraform.(*EvalReadData).Eval(0xc0006a0a80, 0x24a2960, 0xc0003ff110, 0x2, 0x2, 0x0, 0x0) /home/circleci/project/project/terraform/eval_read_data.go:205 +0x16b5 github.com/hashicorp/terraform/terraform.EvalRaw(0x2427520, 0xc0006a0a80, 0x24a2960, 0xc0003ff110, 0x0, 0x0, 0x0, 0x0) /home/circleci/project/project/terraform/eval.go:57 +0x131 github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc001582b80, 0x24a2960, 0xc0003ff110, 0x2, 0x2, 0xf3e66d, 0x24273c0) /home/circleci/project/project/terraform/eval_sequence.go:20 +0xfd github.com/hashicorp/terraform/terraform.EvalRaw(0x2427660, 0xc001582b80, 0x24a2960, 0xc0003ff110, 0x1bc2480, 0x3535784, 0x1b25bc0, 0xc0008f60b0) /home/circleci/project/project/terraform/eval.go:57 +0x131 github.com/hashicorp/terraform/terraform.Eval(0x2427660, 0xc001582b80, 0x24a2960, 0xc0003ff110, 0xc001582b80, 0x2427660, 0xc001582b80, 0x0) /home/circleci/project/project/terraform/eval.go:35 +0x4d github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x1e66060, 0xc000482c90, 0x0, 0x0, 0x0) /home/circleci/project/project/terraform/graph.go:90 +0xf40 github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc001342480, 0x1e66060, 0xc000482c90, 0xc000e847c0) /home/circleci/project/project/dag/walk.go:392 +0x353 created by github.com/hashicorp/terraform/dag.(*Walker).Update /home/circleci/project/project/dag/walk.go:314 +0xa9b !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! Terraform crashed! This is always indicative of a bug within Terraform. A crash log has been placed at "crash.log" relative to your current working directory. It would be immensely helpful if you could please report the crash with Terraform[1] so that we can fix this. When reporting bugs, please include your terraform version. That information is available on the first line of crash.log. You can also get it by running 'terraform --version' on the command line. SECURITY WARNING: the "crash.log" file that was created may contain sensitive information that must be redacted before it is safe to share on the issue tracker. ``` ### Steps to Reproduce run virtualmachine plan stage ### Additional Context _No response_ ### References _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.