Setup failed: Failed to copy slug dir: lstat /Users: no such file or directory error in Terraform Enterprise

When you try to execute a Terraform configuration in Terraform Enterprise (Atlas) you may get the error message:

Setup failed: Failed to copy slug dir: lstat /Users: no such file or directory

Cause:

The Git repository contains the .terraform/modules directory, and the Terraform Enterprise server cannot get the latest modules from GitHub.

Solution:

  1. Create a .gitignore file in the repository and add these lines:
    */.terraform/modules/
    
    # Ignore DS_Store if working on a mac
    .DS_Store
  2. Delete the .terraform directory and push the changes to GitHub

 

 

Leave a comment

Your email address will not be published. Required fields are marked *