Open
Description
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
After refactoring in this PR #4494 the --tf-download-url
flag is no longer respected.
Reproduction Steps
Configure custom terraform download URL
- server
- --tf-download-url="https://artifactory.company.com/artifactory/hashicorp-remote"
Trigger the Atlantis plan for the version which needs to be downloaded.
Logs
atlantis-0 atlantis {"level":"debug","ts":"2025-04-23T04:34:06.361Z","caller":"tfclient/terraform_client.go:306","msg":"Found required_version setting of \"1.11.4\"","json":{"repo":"Org/repo","pull":"105"}}
atlantis-0 atlantis {"level":"error","ts":"2025-04-23T04:34:16.363Z","caller":"tfclient/terraform_client.go:326","msg":"error listing available versions: Get \"https://releases.hashicorp.com/terraform/index.json\": context deadline exceeded","json":{"repo":"Org/repo","pull":"105"},"stacktrace":"github.com/runatlantis/atlantis/server/core/terraform/tfclient.(*DefaultClient).DetectVersion\n\tgithub.com/runatlantis/atlantis/server/core/terraform/tfclient/terraform_client.go:326\ngithub.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandContextBuilder).BuildProjectContext\n\tgithub.com/runatlantis/atlantis/server/events/project_command_context_builder.go:127\ngithub.com/runatlantis/atlantis/server/events.(*CommandScopedStatsProjectCommandContextBuilder).BuildProjectContext\n\tgithub.com/runatlantis/atlantis/server/events/project_command_context_builder.go:66\ngithub.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandBuilder).buildAllCommandsByCfg\n\tgithub.com/runatlantis/atlantis/server/events/project_command_builder.go:542\ngithub.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandBuilder).BuildPlanCommands\n\tgithub.com/runatlantis/atlantis/server/events/project_command_builder.go:276\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandBuilder).BuildPlanCommands.func1\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_builder.go:38\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandBuilder).buildAndEmitStats\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_builder.go:71\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandBuilder).BuildPlanCommands\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_builder.go:35\ngithub.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).run\n\tgithub.com/runatlantis/atlantis/server/events/plan_command_runner.go:186\ngithub.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).Run\n\tgithub.com/runatlantis/atlantis/server/events/plan_command_runner.go:299\ngithub.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\tgithub.com/runatlantis/atlantis/server/events/command_runner.go:401"}
Environment details
Additional Context
I tracked it down to this call stack, which uses the default URL.
https://github.com/runatlantis/atlantis/blob/main/server/core/terraform/distribution.go#L128
https://github.com/hashicorp/hc-install/blob/main/releases/versions.go#L61
https://github.com/hashicorp/hc-install/blob/main/internal/releasesjson/releases.go#L59