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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

expected a single file: /tmp/getter3359610012/archive: Downloading terraform Version 1.8.2 #4472

Closed
FernandoMiguel opened this issue Apr 24, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@FernandoMiguel
Copy link

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

hashi released a new version of terraform, 1.8.2
and now atlantis seems to be failing to pull the binary

Reproduction Steps

atlantis plan

Logs

{
    "level": "error",
    "ts": "2024-04-24T10:39:52.030Z",
    "caller": "events/instrumented_project_command_runner.go:78",
    "msg": "Error running plan operation: downloading terraform version 1.8.2 at \"https://releases.hashicorp.com/terraform/1.8.2/terraform_1.8.2_linux_amd64.zip?checksum=file:https://releases.hashicorp.com/terraform/1.8.2/terraform_1.8.2_SHA256SUMS\": expected a single file: /tmp/getter168290612/archive: Downloading terraform Version 1.8.2",
    "json": {
        "repo": "foo/bar",
        "pull": "5026"
    },
    "stacktrace": "github.com/runatlantis/atlantis/server/events.RunAndEmitStats
        github.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:78
    github.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandRunner).Plan
        github.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:38
    github.com/runatlantis/atlantis/server/events.runProjectCmds
        github.com/runatlantis/atlantis/server/events/project_command_pool_executor.go:48
    github.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).run
        github.com/runatlantis/atlantis/server/events/plan_command_runner.go:262
    github.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).Run
        github.com/runatlantis/atlantis/server/events/plan_command_runner.go:306
    github.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand
        github.com/runatlantis/atlantis/server/events/command_runner.go:365"
}

Environment details

  • Atlantis version: helm.sh/chart: atlantis-4.25.0
  • Deployment method: eks/helm
  • If not running the latest Atlantis version have you tried to reproduce this issue on the latest version:
  • Atlantis flags:
@FernandoMiguel FernandoMiguel added the bug Something isn't working label Apr 24, 2024
@FernandoMiguel
Copy link
Author

upstream issue hashicorp/terraform#35075

@gjabell
Copy link

gjabell commented Apr 24, 2024

It looks like this fails because they changed their archive strategy to also include the LICENSE file: https://github.com/hashicorp/terraform/releases/tag/v1.8.2 (see the note at the bottom)

@FernandoMiguel
Copy link
Author

thanks @gjabell
good find!
such a shame hashi would introduce such a breaking change without prior heads-up

@gjabell
Copy link

gjabell commented Apr 24, 2024

Yeah very frustrating on their end 馃槙 since this is only an issue if the binary is downloaded for the first time and I didn't want to repin all my modules to 1.8.1, I just manually downloaded the binary to the bin/ directory with the name terraform1.8.2 and it works after that.

@FernandoMiguel
Copy link
Author

@gjabell
harder to do on EKS where the atlantis pod can go away anytime

@gjabell
Copy link

gjabell commented Apr 24, 2024

Yeah depends on your deployment I guess; we are running with a PVC for the data dir so we can restart Atlantis without losing plans. The bin/ dir is stored at the top-level there so the binaries persist across restarts too.

@FernandoMiguel
Copy link
Author

We do the same.
But feels super yacky to go place bins there

@radeksimko
Copy link

馃憢馃徎 TF Core maintainer here, who also happened to cut the release with the change that has impacted you. As mentioned above we did call this out in the changelog but broadly speaking did not anticipate this to be a breaking change that would warrant heads up.

go-getter, which is a library Atlantis appears to be using to install Terraform currently was not designed for this use case, or even broadly interacting with releases.hashicorp.com and we do not intend to make changes in that library to accommodate that use case.

On a more positive note, we do maintain a library that can aid with installation of HashiCorp products, including Terraform - hc-install and we use it ourselves in a number of places. Atlantis would be welcomed to use it as well. That library does not make assumptions about the archive having just one file. Our enterprise packages (although not relevant for Terraform here specifically) already have multiple files and the API accounts for this too, where the consumers specify a path where the license should be placed.

For Terraform CE, the API would let you specify Dir as a path to the directory where the archive gets unpacked, including terraform binary and the license file. What consumers decide to do with those files after the installation would be up to them. The API does not currently make any further assumptions about those files for non-Enterprise versions.

I appreciate this may not be as simple as a drop-in replacement but I hope the API along with examples and documentation is self-explanatory. If you have any questions about it or if it doesn't work for you we'd certainly like to hear it in our issue tracker and be more open to making some changes there (as opposed in go-getter).

@nitrocode
Copy link
Member

This is a duplicate of #4471

Let's move the conversation there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants