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 fails on windows (v0.9.0-beta1) #12012

Closed
erikvanbrakel opened this issue Feb 16, 2017 · 1 comment · Fixed by #12059
Closed

terraform init fails on windows (v0.9.0-beta1) #12012

erikvanbrakel opened this issue Feb 16, 2017 · 1 comment · Fixed by #12059
Assignees

Comments

@erikvanbrakel
Copy link

Terraform Version

Terraform v0.9.0-beta1 (4e96da57eef7b1bfd6e2752839e897f932752656)

Terraform Configuration Files

terraform {
    backend "local" {
        path = "terraform.tfstate"
    }
}

Debug Output

(pasting here as it's tiny)

2017/02/16 16:21:36 [INFO] Terraform version: 0.9.0 beta1 4e96da57eef7b1bfd6e2752839e897f932752656
2017/02/16 16:21:36 [INFO] CLI args: []string{"C:\\temp\\tt\\terraform.exe", "init"}
2017/02/16 16:21:36 [DEBUG] Attempting to open CLI config file: C:\Users\erikb\AppData\Roaming\terraform.rc
2017/02/16 16:21:36 [INFO] CLI command args: []string{"init"}
2017/02/16 16:21:36 [DEBUG] command: loading backend config file: C:\temp\tt
Initializing the backend...
2017/02/16 16:21:36 [DEBUG] command: no data state file found for backend config
2017/02/16 16:21:36 [DEBUG] New state was assigned lineage "726d6303-d03f-4261-af9a-184a0bd9c739"
2017/02/16 16:21:36 [DEBUG] New state was assigned lineage "722c6d27-a0d0-488d-a8f6-c7ade089aaa1"
2017/02/16 16:21:36 [TRACE] Preserving existing state lineage "722c6d27-a0d0-488d-a8f6-c7ade089aaa1"

Error saving the backend configuration: Failed to write state: write C:\temp\tt\.terraform\terraform.tfstate: The process cannot access the file because another process has locked a portion of the file.

Terraform saves the complete backend configuration in a local file for
configuring the backend on future operations. This cannot be disabled. Errors
are usually due to simple file permission errors. Please look at the error
above, resolve it, and try again.

2017/02/16 16:21:36 [DEBUG] plugin: waiting for all plugin processes to complete...

Expected Behavior

Terraform should have initialized the remote backend.

Actual Behavior

Terraform can't initialize the backend, as it thinks the file is locked.

Steps to Reproduce

  1. terraform init

Important Factoids

Tried on Windows 10, Windows Server 2012R2 (both domain joined) and a fresh Windows Server 2016 in AWS. Same result.
Using Bash on Ubuntu on Windows it doesn't throw the error.

@ghost
Copy link

ghost commented Apr 16, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants