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

Tgswitch sometimes fails with a 404 from GitHub #133

Closed
crablab opened this issue Nov 2, 2022 · 3 comments · Fixed by #135
Closed

Tgswitch sometimes fails with a 404 from GitHub #133

crablab opened this issue Nov 2, 2022 · 3 comments · Fixed by #135

Comments

@crablab
Copy link
Contributor

crablab commented Nov 2, 2022

Splitting this out as it should have been a separate issue.

Originally posted by @maxfriedrich in #117 (comment)


Hi, I have a simple setup that results in a 404 page from GitHub pages being downloaded and stored in ~/.terragrunt.versions:

terragrunt.hcl:

terragrunt_version_constraint = "0.35.20"
$ rm -r ~/.terragrunt.versions && tgswitch
Terragrunt file found: /Users/max.friedrich/tgswitch-test/terragrunt.hcl
Reading required version from constraint: 0.35.20
Matched version: 0.35.20
2022/07/07 14:56:54 Creating directory for terragrunt: /Users/max.friedrich/.terragrunt.versions/
Downloading https://warrensbox.github.io/terragunt-versions-list/index.json/v0.35.20/terragrunt_darwin_amd64 to terragrunt_darwin_amd64
Downloading ...
9339 bytes downloaded.
Switched terragrunt to version "0.35.20"

$ head ~/.terragrunt.versions/terragrunt_0.35.20
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; connect-src 'self'">
    <title>Page not found &middot; GitHub Pages</title>
    <style type="text/css" media="screen">
      body {
        background-color: #f1f1f1;
        margin: 0;

If the specified version was already downloaded before with tgswitch "0.35.20" everything works as expected.


Opening a new issue as we similar issue with this, periodically, in our pipelines.

@crablab
Copy link
Contributor Author

crablab commented Nov 2, 2022

My 2 cents on this: it's probably rate limiting from GitHub, which is why we see it happening in our automated pipeline.

I think the bug here is that Tgswitch doesn't return a non-zero exit code when it fails to download a Tg binary.

Ideally we would be able to check that Tgswitch had failed to download and then add logic around that to retry with backoff. Even better if Tgswitch did this automatically (although I think that is a want, rather than a need)

@asvinours
Copy link

Seems related to #132

@mrbfrank
Copy link

mrbfrank commented Jan 26, 2023

Just a thought, this might be happening on ARM / Apple Silicon when attempting to install an older release of terragrunt with no ARM binary. I ran into this problem with tfenv & the solution was to specify a variable in the command line like TFENV_ARCH=amd64 tfenv install 0.14.5. This installed the x64 version which runs fine via Rosetta2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants