Terraform complains with "EvalSymlinks: too many links" when on a Windows roaming profile
Posted in development on January 31, 2024 by Adrian Wyssmann ‐ 2 min read
Working with terraform on Windows can be a pain, even more when using
Problem
While try to do a terraform init you get the following error
The problem seem to occur if the profile is a roaming user profiles.
Solution
Use Local Folder
This happens on Windows servers, where the profile is not local. To fix it you need a local folder where you have read access, and then configure the following variables either in PS or bash
- TEMP
- TMP
- TF_PLUGIN_CACHE_DIR
Not sure if TF_PLUGIN_CACHE_DIR
is really needed, but setting only this variable is not enough
You might need additional permissions to do so. Also using the same shared TEMP folders with others is probably not the best idea.
Subst Temp Folder
A better idea might be to set the temp folder to a separate drive using subst. Then configure the TEMP environment variable accordingly. So in powershell
The assignment of the letter is not permanent and will be gone after a system reboot.
Turning a folder into a drive letter
Another solution could be Turning a folder into a drive letter - Microsoft Community. However I did not test this one.