Skip to content

archive/tar: write too long error when files are symlinked at least twice #31895

@calvinbui

Description

@calvinbui

Terraform Version

Terraform v1.3.1
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v3.68.0
+ provider registry.terraform.io/hashicorp/helm v2.4.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.7.1

Terraform Configuration Files

...terraform config...

Debug Output

https://gist.github.com/calvinbui/044f82fb2fb6486f23750353bff6acdf

Expected Behavior

terraform apply follows the symlink to the original file, as if it was in the same directory/workspace.

Actual Behavior

Error: Failed to upload configuration files: failed copying file "/Users/calvin/common_file.tf" to archive: archive/tar: write too long

Steps to Reproduce

I symlink files between different orgs/workspaces/environments if they share a common configuration. Sometimes files are double symlinked, like in the example below.

Create a folder structure like so and run terraform init, then terraform apply to run into the error.

.
├── application
│   ├── common
│   │   ├── bucket.tf
│   │   └── common_file.tf -> ../../common_file.tf
│   ├── workspace1
│   │   ├── bucket.tf -> ../common/bucket.tf
│   │   ├── common_file.tf -> ../common/common_file.tf
│   │   └── vars.tf
│   └── workspace2
│       ├── bucket.tf -> ../common/bucket.tf
│       ├── common_file.tf -> ../common/common_file.tf
│       └── vars.tf
└── common_file.tf

Additional Context

This was working in Terraform <1.3.0.

I'm using tfenv on my Mac, but the same issue occurred on Linux without it.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions