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

bug: Pushing a template with a symbolically linked module fails #13203

Open
jmshoffs0812 opened this issue May 7, 2024 · 0 comments
Open

bug: Pushing a template with a symbolically linked module fails #13203

jmshoffs0812 opened this issue May 7, 2024 · 0 comments
Labels
bug Used to filter all bug issues

Comments

@jmshoffs0812
Copy link
Contributor

The link-and-push workflow described in the FAQ fails at least on Coder v2.10.2+a11b169. It appears Coder is not traversing the link itself.

A simple template referencing a linked module directory thus:

module "example-module" {
  source = "./modules/aws-s3-static-website-bucket"
  bucket_name = "foo"
}

Template directory:

➜  example ls -al
total 8
drwxr-xr-x  6 jms staff  192 May  7 14:33 ./
drwxr-xr-x 11 jms staff  352 May  7 14:29 ../
drwxr-xr-x  4 jms staff  128 May  7 14:32 .terraform/
-rw-r--r--  1 jms staff 1406 May  7 14:33 .terraform.lock.hcl
-rw-r--r--  1 jms staff  346 May  7 14:32 main.tf
lrwxr-xr-x  1 jms staff   10 May  7 14:26 modules -> ../modules/

Module directory:

➜  example ls -al modules/
total 0
drwxr-xr-x  3 jms staff  96 Apr 16 19:35 ./
drwxr-xr-x 11 jms staff 352 May  7 14:29 ../
drwxr-xr-x  7 jms staff 224 Apr 16 19:33 aws-s3-static-website-bucket/

Command tar --exclude='.terraform' -cvh . | coder -v templates push -y fails with the following error:

==> ⧗ Detecting persistent resources
2024-05-07 14:42:20.437-04:00 Error: Unreadable module directory
2024-05-07 14:42:20.437-04:00 Unable to evaluate directory symlink: lstat modules: no such file or
2024-05-07 14:42:20.437-04:00 directory
2024-05-07 14:42:20.437-04:00 Error: Unreadable module directory
2024-05-07 14:42:20.437-04:00 The directory  could not be read for module "example-module" at main.tf:10.

Deleting the symlink and requesting Coder to push the same effective structure always succeeds:
rm modules ; cp -R ../modules . ; tar --exclude='.terraform' -cvh . | coder -v templates push -y

And relinking and repeating always fails:
rm -rf modules ; ln -sf ../modules modules ; tar --exclude='.terraform' -cvh . | coder -v templates push -y

@coder-labeler coder-labeler bot added the bug Used to filter all bug issues label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to filter all bug issues
Projects
None yet
Development

No branches or pull requests

1 participant