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

Module directories ending with "tgz" fail when running terraform get #11438

Closed
philippevk opened this issue Jan 26, 2017 · 5 comments · Fixed by hashicorp/go-getter#49
Closed
Assignees

Comments

@philippevk
Copy link

This is a bug report. Steps to reproduce:

  • create a module directory with the name "dir-to-tgz"
  • add any .tf file to the module
  • reference module in your main terraform file
  • run terraform get

Result:

  • Error loading Terraform: Error downloading modules: source path must be a file

What is happening:

  • I'm guessing terraform supports modules compressed to .tgz files
  • I'm guessing terraform checks if source ends with "tgz" to determine this

Possible fix:
check for ".tgz" instead of "tgz" ?

@philippevk philippevk changed the title Modules ending with "tgz" Module directories ending with "tgz" fail when running terraform get Jan 26, 2017
@philippevk
Copy link
Author

FYI, the obvious workaround is to rename module, but it still seems like a bug

@mattlqx
Copy link

mattlqx commented Jan 26, 2017

As a practical exercise, I poked around and found the code to be here:
https://github.com/hashicorp/go-getter/blob/21d247ece01f1f7d5b56f130fd7b1db19bb0d0db/client.go#L156

And the map is here:
https://github.com/hashicorp/go-getter/blob/2fbd997432e72fe36060c8f07ec1eaf98d098177/decompress.go#L21-L27

So yep, only checking for ext at the end and not .ext.

@mitchellh
Copy link
Contributor

Good bug. You can also force a specific getter type with a type:: prefix on the source address. So you can do file:: to force it as a file/directory. Bug going to keep this open to address the not looking for a "."

mitchellh added a commit to hashicorp/go-getter that referenced this issue Feb 7, 2017
Fixes hashicorp/terraform#11438

Decompressors were suffix checking only for the extension WITHOUT a
period. This was causing directories and files ending with that to be
treated as an archive incorrectly.
@mitchellh mitchellh self-assigned this Feb 7, 2017
@mitchellh
Copy link
Contributor

Fix is queued up in PR.

@ghost
Copy link

ghost commented Apr 17, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants