(Failed to read state file) error occurded when I using Terraformer (original) (raw)

Hi teams!
I’ve been simple testing that import vpc information with Terraformers.
but the (Missing required provider) error occurded.
so I used command terraform state replace-provider -- -/aws hashicorp/aws and It was fixed.
but another error occueded below.
The terraform is only being used in vscode, and the dependency problem is occurring even though all other terminals are turned off

image

Planning failed. Terraform encountered an error while generating this plan.


│ Error: Failed to read state file

│ The state file could not be read: read terraform.tfstate: The process cannot access the file because another process has locked a portion of the file.

how to fix this error?
Thank you!

jbardin May 1, 2025, 3:46pm 2

That is an error from your operating system telling you that Terraform cannot read the file. You have some other process running which is holding the file open.

Thank you for your answer!
you said that I have some other process running which is holding the file open but I didn’t have any other process wihch holding the file.
I have only vscode.
The same goes for turning your computer on and off.