C1_W4 Terraform Init Error in Lab: "Failed to Install Provider" (chmod operation not permitted)

Hi all,

I’m currently working on the C1_W4 and encountered an issue during step 2.4, where we’re instructed to re-initialize the Terraform module using the following commands:

terraform init
terraform plan
terraform apply

After running terraform init from the terraform folder in the terminal, I received the following error:

Error: Failed to install provider

Error while installing hashicorp/random v3.7.2: 
chmod .terraform/providers/registry.terraform.io/hashicorp/random/3.7.2/linux_amd64/LICENSE.txt: operation not permitted

It seems like there’s a permission issue when Terraform tries to install the hashicorp/random provider. Has anyone encountered this before or found a workaround?

Any help would be greatly appreciated!

Thanks in advance.

Hi,

Please fill out this lab refresh form, wait 2 to 3 business days, and try again afterward.

Hi,

I’ll go ahead and submit the lab refresh form again for the C1_W4 error after step 2.4. Just for your information, this is not my first time submitting it, the issue still persisted after the previous refresh.

Appreciate your support!

1 Like

Update: Issue Resolved :slightly_smiling_face:

I was able to fix the issue by following these steps:

  1. Renamed the terraform directory to terraform_ex .
  2. Clicked Lab Help > Get latest version to refresh the lab files.
  3. Located the newly downloaded terraform directory in the file explorer.
  4. Ran the Terraform commands again – the issue was resolved.
2 Likes