Hi when creating a local module on a linux dev box, the 'terraform get' command fails because the working directory is in a CIFS share where symlinks are not permitted (Error below). Is there anyway use modules without symlinks?
➜ fleetyards terraform get
Get: file:///home/bryan/code/fleetyards/fleetyard_pier
Error loading Terraform: Error downloading modules: error downloading 'file:///home/bryan/code/fleetyards/fleetyard_pier': symlink /home/bryan/code/fleetyards/fleetyard_pier .terraform/modules/b6de67523b5e108e85f198409f62571e: operation not supported
(our entire code directory is hosted on a windows CIFS share, but the dev environment is an Ubuntu 14 box)
Hi @bryanvaz! Thanks for opening this issue. I'm not sure there is an easy solution here - this fails on Windows itself as well in many cases as creating symbolic links require special permissions on a domain. You _can_ use modules without symbolic links if their source is not a local file path. I will tag this as a core bug and leave it open as there is nothing I can find currently tracking this.
My idea here would be to augment go-getter to detect the "operation not supported" error and actually copy the files (which it supports). I don't have a Windows machine to repro this on at the moment so just keeping notes.
+1
Without a fix to this, it basically means you can't use terraform modules with local file paths if you're in a situation where symlinks are not supported. Seems very not good to change your whole approach because of this 1 limitation.
+1 to mitchelh's idea to detect "operation not supported" error and copy the files.
I'm having to swtich to github source to work around this issue and make my modules portable. Doesn't seem right that I have to make this design choice to support running on machines where symlinks are not supported.
Just got it on Azure. I have VSTS agents prepared in similar way to this article:
https://open.microsoft.com/2018/05/22/how-to-create-vsts-agent-azure-aci-terraform/
On local MacBook terraform get or terraform init works correctly but on agent with shared drive I get this error.
/usr/local/bin/terraform get -update
- module.namespace
Updating source "./modules/application/namespace"
Error loading modules: error downloading 'file:///var/vsts/agent/1/1/s/modules/application/namespace': symlink /var/vsts/agent/1/1/s/modules/application/namespace .terraform/modules/143f2ae5b87bc60c9873593e5bc03c24: operation not supported
/usr/local/bin/terraform failed with return code: 1
/usr/local/bin/terraform failed with error: /usr/local/bin/terraform failed with return code: 1
When I delete shared drive and make Agent do terraform commands on local drive it works.
Hi all! Sorry for the long silence here.
Since this issue was using an older labeling scheme we've missed it on previous update passes, but it's covering a similar problem as #18681 which has been recently closed due to us no longer using symlinks for local module directory references as of the forthcoming v0.12.0 release. I left some more details in comments in the other issue in case you are interested, and I'm now going to close this out since this should no longer be an issue after v0.12.0 is released.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
My idea here would be to augment go-getter to detect the "operation not supported" error and actually copy the files (which it supports). I don't have a Windows machine to repro this on at the moment so just keeping notes.