-
Notifications
You must be signed in to change notification settings - Fork 61
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
source_dir property of archive_file data source doesn't work with ${path.module} and "../" #5
Comments
I think I just hit the same thing, except the error I'm getting is:
|
Still happens with terraform v0.10.7 and archive 1.0.0 provider |
Still happening with Terraform v0.11.3
Except i get an
|
Can confirm this is still a problem with:
panic:
|
Hi @reg0l, @thyrion, @brikis98, @philipl, Thank you for opening and commenting on this issue. I have fixed the panic (#26) and can now see what is actually happening here: [23:21:56] kt@snowbook:~/hashi/2018/gh/archive-5$ cat main.tf
module "test" {
source = "m"
}
[23:22:00] kt@snowbook:~/hashi/2018/gh/archive-5$ cat m/m.tf
data "archive_file" "function" {
type = "zip"
source_dir = "${path.module}/../m"
output_path = "${path.root}/somefile.zip"
}
[23:22:27] kt@snowbook:~/hashi/2018/gh/archive-5$ tfinitautoapply
Initializing modules...
- module.test
[...]
data.archive_file.function: Refreshing state...
Error: Error refreshing state: 1 error(s) occurred:
* module.test.data.archive_file.function: 1 error(s) occurred:
* module.test.data.archive_file.function: data.archive_file.function: error archiving directory: error encountered during file walk: lstat /Users/kt/hashi/2018/gh/archive-5/.terraform/modules/m/m.tf: no such file or directory
[23:22:49] kt@snowbook:~/hashi/2018/gh/archive-5$ It seems
I've run out of time to spend on this tonight but at least now there will be a reasonable error 🙂 |
Just ran into this problem: Terraform code: data "archive_file" "geodetection" {
type = "zip"
source_dir = "${path.module}/../../../../dev/lambda-edge-geodetection"
output_path = "${path.module}/lambda-edge-geodetection.zip"
} Apply result:
Had to change to this and it worked... source_dir = "${path.root}/../../../dev/lambda-edge-geodetection" |
I can confirm that @swoodford's solution of replacing
Other than that, the |
came across this issue as well |
I've tried both When I add Anyone have a solution? |
I'm seeing the same as @codeinaire |
Terraform v0.12.17 and this is happening, my terminal just hangs at
no error message stayed like that for 5 minutes The archive_file is a single python script with 11 lines.
I would not maintain #8344 (hashicorp/terraform#8344) closed, although I do not have access. |
This issue was originally opened by @philipl as hashicorp/terraform#12929. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform Version
terraform 0.9.1
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Log
https://gist.github.com/philipl/e5108167c11c17f2b96564e81e34e0fc
Expected Behavior
zip file is created with contents of directory
Actual Behavior
empty zip file is created and crash is reported in debug output
Steps to Reproduce
terraform plan
Important Factoids
This seems a very specific failure. The following scenarios work fine:
source_dir = "${path.module}/src"
source_dir = "/some/path/../src"
source_file = "${path.module}/../src/filename.js"
The specific failure is when ${path.module} is combined with "../"
The text was updated successfully, but these errors were encountered: