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

terraform init cannot compute checksum on Windows 10 #36357

Open
borrrden opened this issue Jan 17, 2025 · 7 comments
Open

terraform init cannot compute checksum on Windows 10 #36357

borrrden opened this issue Jan 17, 2025 · 7 comments

Comments

@borrrden
Copy link

Terraform Version

Terraform v1.10.4
on windows_amd64

Terraform Configuration Files

terraform {
    required_providers {
      aws = {
        source  = "hashicorp/aws"
        version = "~> 4.16"
      }
    }

    required_version = ">= 1.2.0"
}

Debug Output

https://gist.github.com/borrrden/65db1481e5e2a1e88e2cc6b64ce4b849

Expected Behavior

The init should succeed

Actual Behavior

The error message

╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/aws v4.67.0: failed to compute checksum for C:\Users\jim.borden\AppData\Local\Temp\terraform-provider4160808953: The system cannot find the path
│ specified.
╵

But, this file exists so I'm guessing it is something ELSE that cannot be found:

ls C:\Users\jim.borden\AppData\Local\Temp\terraform-provider4160808953

        Directory: C:\Users\jim.borden\AppData\Local\Temp


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a---         1/17/2025  12:02 PM       82080760   terraform-provider4160808953

Steps to Reproduce

  1. terraform init

Additional Context

No response

References

No response

Generative AI / LLM assisted development?

No response

@borrrden borrrden added bug new new issue not yet triaged labels Jan 17, 2025
@jbardin jbardin added windows waiting for reproduction unable to reproduce issue without further information labels Jan 17, 2025
@jbardin
Copy link
Member

jbardin commented Jan 17, 2025

Hi @borrrden,

There is really only one system call which would return that Windows error from that point, which is where the file is opened, so there not really anything else that it could be failing to find. The path is first normalized with filepath.EvalSymlinks though to give a better error in the case of a bad link, so it's possible the result of that is slightly different if there are any symlinks involved.

Do you have multiple filesystems or volumes linked together (I'm not sure what the windows terminology is for this)? The ls output has some unprintable/invalid unicode characters, I'm not sure if that's an artifact from copy&paste or maybe something obscuring the file name.

What we need to do here is either need to figure out how your system differs from other similar systems, or create a reproducible example for further investigation.

Thanks!

@borrrden
Copy link
Author

I do not have multiple filesystems here. The unprintable character there is just because I use a profile to make things print a little more pretty.

Here is the output without a profile set:

PS C:\Users\jim.borden> ls C:\Users\jim.borden\AppData\Local\Temp\terraform-provider4160808953


    Directory: C:\Users\jim.borden\AppData\Local\Temp


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         1/17/2025  12:02 PM       82080760 terraform-provider4160808953

@borrrden
Copy link
Author

Ok I found the problem actually. You reminded me that C:\Users\jim.borden is a symlink because so many programs have issues with what the folder actually is (C:\Users\Jim Borden with a space in it). If I alter $TMP to be the real path there is no issue.

@crw crw closed this as completed Jan 21, 2025
@borrrden
Copy link
Author

Is there any documentation around the fact that symlinks are not allowed in the path?

@jbardin
Copy link
Member

jbardin commented Jan 22, 2025

Symlinks should be fine (they definitely work on unix systems), so this is something specific to Windows that will need to be investigated.

@jbardin jbardin reopened this Jan 22, 2025
@jbardin jbardin removed new new issue not yet triaged waiting for reproduction unable to reproduce issue without further information labels Jan 22, 2025
@borrrden
Copy link
Author

borrrden commented Jan 22, 2025

Ok, let me know if you want me to provide any context or information. This won't block me now that I know how to work around the issue, but I appreciate that I am the minority probably in that I am a full time developer that spends 90+% of my time in Windows (or WSL).

On that note, here is the symlink in question. I forget if I made it a junction or an actual symlink (with admin)

ls C:\Users

Mode LastWriteTime Length Name
d---- 12/12/2024 10:00 AM Jim Borden
l----- 5/29/2023 9:51 AM jim.borden → C:\Users\Jim Borden

@jbardin
Copy link
Member

jbardin commented Jan 23, 2025

IIRC junctions on Windows are not symlinks, but "reparse points", so they end up being evaluated differently in different contexts. I don't use Windows, so I'm not familiar with the details, but problems resolving paths over junctions sounds like a problem I've seen before. We'll have to see what filepath.EvalSymlinks returns for the given path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants