How to fix the Terraform stuck on “Refreshing state…” problem

0 min read 121 words

Terraform is a fantastic tool to help automate your infrastructure as code.

Quite a few times however, I have noticed a few strange issues, one of them is when Terraform gets stuck while refreshing the state.

This can happen when running terraform plan or in-fact, when running a range of other commands that require the state-file to be refreshed and used.

The problem

Terraform gets stuck on this message:

Refreshing Terraform state in-memory prior to plan…

The solution

Before you run your terraform plan (or other command where it gets stuck), first run this:

export TF_LOG=TRACE

Then try and run your command again.

This will tell you exactly why the problem is occurring so that you know just what to fix.

Tags:
Andrew
Andrew

Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.

Tags