Loading...
Loading...
<!-- Hi there, Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html. If your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers . --> ### Terraform Version <!--- Run `terraform -v` to show the version, and paste the result between the ``` marks below. If you are not running the latest version of Terraform, please try upgrading because your issue may have already been fixed. --> ``` Terraform v0.12.10 ``` ### Terraform Configuration Files <!-- Paste the relevant parts of your Terraform configuration between the ``` marks below. For large Terraform configs, please use a service like Dropbox and share a link to the ZIP file. For security, you can also encrypt the files using our GPG public key. --> ``` /home/devops ├── infrastructure │ └── main.tf └── modules └── test └── empty.tf ``` ```hcl # infrastructure/main.tf: module "a" { source = "/home/devops/modules/test" } module "b" { source = "/home/devops/modules/test" } module "c" { source = "/home/devops/modules/test" } ``` https://leon-downloads.s3-eu-west-1.amazonaws.com/devops/github/012modules.tar.gz ### Debug Output <!-- Full debug output can be obtained by running Terraform with the environment variable `TF_LOG=trace`. Please create a GitHub Gist containing the debug output. Please do _not_ paste the debug output in the issue, since debug output is long. Debug output may contain sensitive information. Please review it before posting publicly, and if you are concerned feel free to encrypt the files using the HashiCorp security public key. --> terraform init ``` 2019/10/08 17:59:39 [INFO] Terraform version: 0.12.10 2019/10/08 17:59:39 [INFO] Go runtime version: go1.12.9 2019/10/08 17:59:39 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init"} 2019/10/08 17:59:39 [DEBUG] Attempting to open CLI config file: /home/geck/.terraformrc 2019/10/08 17:59:39 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. 2019/10/08 17:59:39 [INFO] CLI command args: []string{"init"} Initializing modules... 2019/10/08 17:59:39 [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules 2019/10/08 17:59:39 [DEBUG] Module installer: begin a 2019/10/08 17:59:39 [TRACE] ModuleInstaller: a is not yet installed 2019/10/08 17:59:39 [TRACE] ModuleInstaller: cleaning directory .terraform/modules/a prior to install of a 2019/10/08 17:59:39 [TRACE] ModuleInstaller: a address "/home/devops/modules/test" will be handled by go-getter 2019/10/08 17:59:39 [DEBUG] will download "/home/devops/modules/test" to .terraform/modules/a Downloading /home/devops/modules/test for a... 2019/10/08 17:59:39 [TRACE] go-getter detectors rewrote "/home/devops/modules/test" to "file:///home/devops/modules/test" 2019/10/08 17:59:39 [TRACE] fetching "file:///home/devops/modules/test" to ".terraform/modules/a" 2019/10/08 17:59:39 [TRACE] ModuleInstaller: a "/home/devops/modules/test" was downloaded to .terraform/modules/a 2019/10/08 17:59:39 [DEBUG] Module installer: a installed at .terraform/modules/a - a in .terraform/modules/a 2019/10/08 17:59:39 [DEBUG] Module installer: begin b 2019/10/08 17:59:39 [TRACE] ModuleInstaller: b is not yet installed 2019/10/08 17:59:39 [TRACE] ModuleInstaller: cleaning directory .terraform/modules/b prior to install of b 2019/10/08 17:59:39 [TRACE] ModuleInstaller: b address "/home/devops/modules/test" will be handled by go-getter Downloading /home/devops/modules/test for b... 2019/10/08 17:59:39 [DEBUG] will download "/home/devops/modules/test" to .terraform/modules/b 2019/10/08 17:59:39 [TRACE] go-getter detectors rewrote "/home/devops/modules/test" to "file:///home/devops/modules/test" 2019/10/08 17:59:39 [TRACE] copying previous install .terraform/modules/a to .terraform/modules/b 2019/10/08 17:59:39 [TRACE] ModuleInstaller: b "/home/devops/modules/test" was downloaded to .terraform/modules/b 2019/10/08 17:59:39 [DEBUG] Module installer: b installed at .terraform/modules/b - b in .terraform/modules/b 2019/10/08 17:59:39 [DEBUG] Module installer: begin c 2019/10/08 17:59:39 [TRACE] ModuleInstaller: c is not yet installed 2019/10/08 17:59:39 [TRACE] ModuleInstaller: cleaning directory .terraform/modules/c prior to install of c 2019/10/08 17:59:39 [TRACE] ModuleInstaller: c address "/home/devops/modules/test" will be handled by go-getter Downloading /home/devops/modules/test for c... 2019/10/08 17:59:39 [DEBUG] will download "/home/devops/modules/test" to .terraform/modules/c 2019/10/08 17:59:39 [TRACE] go-getter detectors rewrote "/home/devops/modules/test" to "file:///home/devops/modules/test" 2019/10/08 17:59:39 [TRACE] copying previous install .terraform/modules/a to .terraform/modules/c 2019/10/08 17:59:39 [TRACE] ModuleInstaller: c "/home/devops/modules/test" was downloaded to .terraform/modules/c - c in .terraform/modules/c Initializing the backend... 2019/10/08 17:59:39 [DEBUG] Module installer: c installed at .terraform/modules/c 2019/10/08 17:59:39 [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json 2019/10/08 17:59:39 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config 2019/10/08 17:59:39 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory 2019/10/08 17:59:39 [DEBUG] New state was assigned lineage "149e705b-17e1-d737-3932-325c45c81f32" 2019/10/08 17:59:39 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend) 2019/10/08 17:59:39 [TRACE] Meta.Backend: instantiated backend of type 2019/10/08 17:59:39 [DEBUG] checking for provider in "." 2019/10/08 17:59:39 [DEBUG] checking for provider in "/usr/local/bin" 2019/10/08 17:59:39 [DEBUG] checking for provisioner in "." 2019/10/08 17:59:39 [DEBUG] checking for provisioner in "/usr/local/bin" 2019/10/08 17:59:39 [INFO] Failed to read plugin lock file .terraform/plugins/linux_amd64/lock.json: open .terraform/plugins/linux_amd64/lock.json: no such file or directory 2019/10/08 17:59:39 [TRACE] Meta.Backend: backend does not support operations, so wrapping it in a local backend 2019/10/08 17:59:39 [TRACE] backend/local: state manager for workspace "default" will: - read initial snapshot from terraform.tfstate - write new snapshots to terraform.tfstate - create any backup at terraform.tfstate.backup 2019/10/08 17:59:39 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate 2019/10/08 17:59:39 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay 2019/10/08 17:59:39 [TRACE] statemgr.Filesystem: read nil snapshot 2019/10/08 17:59:39 [DEBUG] checking for provider in "." 2019/10/08 17:59:39 [DEBUG] checking for provider in "/usr/local/bin" ``` ### Crash Output <!-- If the console output indicates that Terraform crashed, please share a link to a GitHub Gist containing the output of the `crash.log` file. --> N/A ### Expected Behavior <!-- What should have happened? --> All of referenced modules symlinked (preferably) or copied to local .terraform/modules cache. ### Actual Behavior <!-- What actually happened? --> Terraform during initialization creates one symlink to source of a module and additional 2 copies of it. Exact numer on copies depends of quantity of the module instances Happens when module source is absolute path to local directory (outside the main terraform working dir). ``` /home/devops ├── infrastructure │ ├── .terraform │ │ └── modules │ │ ├── a -> /home/devops/modules/test # symlink │ │ ├── b # copy │ │ │ └── empty.tf │ │ ├── c # copy │ │ │ └── empty.tf │ │ └── modules.json │ └── main.tf └── modules └── test └── main.tf ``` ### Steps to Reproduce <!-- Please list the full steps required to reproduce the issue, for example: 1. `terraform init` 2. `terraform apply` --> terraform init ### Additional Context <!-- Are there anything atypical about your situation that we should know? For example: is Terraform running in a wrapper script or in a CI system? Are you passing any unusual command line options or environment variables to opt-in to non-default behavior? --> ### References <!-- Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: - #6017 --> - https://github.com/hashicorp/terraform/issues/11435#issuecomment-435680988 (possible root cause)
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.