Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlink support for module on windows is not working anymore since 1.10.0 version #36545

Open
AlainLeconte opened this issue Feb 20, 2025 · 2 comments
Labels
bug new new issue not yet triaged windows

Comments

@AlainLeconte
Copy link

Terraform Version

terraform -v    
Terraform v1.10.0
on windows_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v4.52.0
+ provider registry.terraform.io/hashicorp/aws v5.87.0
+ provider registry.terraform.io/hashicorp/helm v2.17.0
+ provider registry.terraform.io/hashicorp/http v3.4.5
+ provider registry.terraform.io/hashicorp/kubernetes v2.35.1
+ provider registry.terraform.io/hashicorp/local v2.5.2
+ provider registry.terraform.io/hashicorp/null v3.2.3

Your version of Terraform is out of date! The latest version
is 1.10.5. You can update by downloading from https://www.terraform.io/downloads.html

Terraform Configuration Files

C:/
├── Modules.project/
│ └── modules/
│ └── service/
│ └── maint.tf
│ └── etc.tf...
│ └── ....

C:/
├── Main.project/
│ └── .github/
│ └── action => SYMLINK to local Modules.project folder
│ └── terraform/
│ └── service/
│ └── main.tf
main.tf
module "service" {
source = "../../.github/actions/modules/service"

Debug Output

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Upgrading modules...

  • service in

    │ Error: Unreadable module directory

    │ Unable to evaluate directory symlink: The system cannot find the path specified.


    │ Error: Unreadable module directory

    │ The directory could not be read for module "service" at main.tf:1.


### Expected Behavior

Working as expected with Terraform 1.9.8 ...
Upgrading modules...
- service in C:\Module.project\modules\service
Downloading registry.terraform.io/terraform-aws-modules/iam/aws 5.52.2 for service.irsa_role...
- service.irsa_role in .terraform\modules\service.irsa_role\modules\iam-role-for-service-accounts-eks
Initializing provider plugins...
- Finding hashicorp/local versions matching "~> 2.0"...
- Finding hashicorp/null versions matching "~> 3.0"...
- Finding latest version of hashicorp/http...


### Actual Behavior

 Error: Unreadable module directory

### Steps to Reproduce

terraform -init -upgrade

### Additional Context

_No response_

### References

_No response_

### Generative AI / LLM assisted development?

_No response_
@AlainLeconte AlainLeconte added bug new new issue not yet triaged labels Feb 20, 2025
@AlainLeconte AlainLeconte changed the title Symlink support for module on windows Symlink support for module on windows is oit working anymore since 1.10.0 version Feb 20, 2025
@AlainLeconte AlainLeconte changed the title Symlink support for module on windows is oit working anymore since 1.10.0 version Symlink support for module on windows is not working anymore since 1.10.0 version Feb 20, 2025
@AlainLeconte
Copy link
Author

AlainLeconte commented Feb 20, 2025

Got an error above, the right one is ... (action is a symlink in the .github folder and service is a subfolder of terraform)

C:/
├── Main.project/
│.└── .github/
│ ......... └─ action => SYMLINK Junction to local Modules.project folder
│ └── terraform/
│...........└─ service/
│ ................└─ main.tf

@jbardin
Copy link
Member

jbardin commented Feb 20, 2025

Hi @AlainLeconte,

IIRC, a junction is not a symlink, though it behaves similarly in many cases. I also recall seeing some issues on other projects where treating a junction as a symlinks caused bugs of a different sort, so this may be a result of fixing the symlink evaluation code on Windows in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new new issue not yet triaged windows
Projects
None yet
Development

No branches or pull requests

2 participants