terraform
Terraform's boxed `Error:` and the `on main.tf line 12` it points at.
iactoolmatcher
Install: ci-doctor matchers add official/terraform
matchers/iac/terraform/matcher.yaml
id: terraformrole: toolclassification: [iac]description: Terraform's boxed `Error:` and the `on main.tf line 12` it points at.pattern: '^\s*│\s*Error: |on .+\.tf line \d+'before: 1after: 12
In bundles
Fixtures
Framing stripped per provider. Highlighted lines are what this matcher selects; the marked line is the anchor.
terraform_apply_errorOpen in playground
1Current runner version: '2.336.0'
2##[group]Operating System
3Ubuntu
424.04.4
5LTS
6##[endgroup]
7Secret source: Actions
8Prepare workflow directory
9Prepare all required actions
10Complete job name: terraform_apply_error
11##[group]Set up job
12Image: ubuntu-24.04
13Runner name: 'GitHub Actions 12'
14##[endgroup]
15Download action repository 'actions/checkout@v4'
16Download action repository 'actions/cache@v4'
17##[group]Run actions/checkout@v4
18 with:
19 fetch-depth: 20
20 lfs: false
21##[endgroup]
22Syncing repository: acme/ledger
23##[group]Getting Git version info
24Working directory is '/home/runner/work/ledger/ledger'
25##[endgroup]
26/usr/bin/git checkout --progress --force 8ad41f02
27##[group]Run actions/cache@v4
28 with:
29 path: ~/.cache
30 key: Linux-deps-8ad41f02
31##[endgroup]
32Received 41943040 of 41943040 (100.0%), 40.0 MBs/sec
33Cache restored from key: Linux-deps-8ad41f02
34##[group]Run terraform init -input=false
35terraform init -input=false
36terraform apply -auto-approve -input=false
37shell: /usr/bin/bash -e {0}
38##[endgroup]
39Initializing the backend...
40Terraform has been successfully initialized!
41data.aws_caller_identity.current: Reading...
42data.aws_caller_identity.current: Read complete after 1s [id=123456789012]
43aws_s3_bucket.artifacts: Creating...
44╷
45│ Error: creating S3 Bucket (team-artifacts-prod): BucketAlreadyOwnedByYou: Your previous request to create the named bucket succeeded and you already own it
46│
47│ with aws_s3_bucket.artifacts,
48│ on s3.tf line 12, in resource "aws_s3_bucket" "artifacts":
49│ 12: resource "aws_s3_bucket" "artifacts" {
50│
51╵
52##[error]Process completed with exit code 1.
53##[group]Post Run actions/checkout@v4
54##[endgroup]
55/usr/bin/git version
56git version 2.54.0
57##[group]Post Run actions/upload-artifact@v4
58##[endgroup]
59Artifact upload complete.
60Post job cleanup.
61Cleaning up orphan processes
1Running with gitlab-runner 16.10.0 (be4e0e33)
2 on infra-runner-01 Tf9Bg5Mz, system ID: s_dd11ee22ff33
3Preparing the "docker" executor
4 Using Docker executor with image hashicorp/terraform:1.9 ...
5Using Docker executor with image hashicorp/terraform:1.9 ...
6Using docker image sha256:5e4d3c2b1a09 for hashicorp/terraform:1.9 with digest terraform@sha256:7f6e...
7Preparing environment
8Running on runner-tf9bg5mz-project-12-concurrent-0...
9Fetching changes...
10Checking out a51c8f60 as detached HEAD...
11Checking cache for terraform-plugins-1.9...
12Successfully extracted cache
13$ terraform init -input=false
14Initializing the backend...
15Terraform has been successfully initialized!
16$ terraform apply -auto-approve -input=false
17data.aws_caller_identity.current: Reading...
18data.aws_caller_identity.current: Read complete after 1s [id=123456789012]
19aws_s3_bucket.artifacts: Creating...
20╷
21│ Error: creating S3 Bucket (team-artifacts-prod): BucketAlreadyOwnedByYou: Your previous request to create the named bucket succeeded and you already own it
22│
23│ with aws_s3_bucket.artifacts,
24│ on s3.tf line 12, in resource "aws_s3_bucket" "artifacts":
25│ 12: resource "aws_s3_bucket" "artifacts" {
26│
27╵
28Running after_script
29$ echo "apply failed, state unchanged"
30apply failed, state unchanged
31Uploading artifacts for failed job
32Uploading artifacts as "archive" to coordinator... 201 Created
33ERROR: Job failed: exit code 1