hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.65k stars 9.55k forks source link

Wrong message about the latest version #34717

Closed EugenKon closed 8 months ago

EugenKon commented 8 months ago

Terraform Version

1.7.2

Terraform Configuration Files

not relevant

Debug Output

$ terraform version
Terraform v1.7.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.37.0
+ provider registry.terraform.io/hashicorp/external v2.3.3
+ provider registry.terraform.io/hashicorp/local v2.4.1
+ provider registry.terraform.io/hashicorp/null v3.2.2

Your version of Terraform is out of date! The latest version
is 1.7.3. You can update by downloading from https://www.terraform.io/downloads.html

kes@Eugens-MacBook-Pro aws $ brew upgrade terraform
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 3 taps (hashicorp/tap, homebrew/core and homebrew/cask).
==> New Formulae
autobrr               go@1.21               mariadb@11.2          pawk                  sqlboiler
cekit                 greenmask             moon                  podman-tui            ssh3
dhall-toml            ignite                neosync               proto                 uv
dotslash              ktfmt                 netaddr               rawdog                xcode-build-server
envio                 kubetui               noseyparker           robin-map
glasskube             magic-wormhole.rs     overtls               seam
==> New Casks
acreom                     elecom-mouse-util          hancom-docs                ollamac
amneziavpn                 endless-sky-high-dpi       ia-markdown-dictionary     qdirstat
cleanclip                  fixkey                     jamie                      spatial
dnsmonitor                 freeshow                   jordanbaird-ice            upscayl
dosbox-staging             gitbutler                  kit

You have 75 outdated formulae installed.

==> Upgrading 1 outdated package:
hashicorp/tap/terraform 1.7.2 -> 1.7.4
==> Fetching hashicorp/tap/terraform
==> Downloading https://releases.hashicorp.com/terraform/1.7.4/terraform_1.7.4_darwin_amd64.zip
##################################################################################################### 100.0%
==> Upgrading hashicorp/tap/terraform
  1.7.2 -> 1.7.4

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Settings.

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 15.1.

🍺  /usr/local/Cellar/terraform/1.7.4: 3 files, 90.8MB, built in 7 seconds
==> Running `brew cleanup terraform`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/terraform/1.7.2... (3 files, 90.8MB)
Removing: /Users/kes/Library/Caches/Homebrew/terraform--1.7.2.zip... (26.3MB)

Expected Behavior

terraform version reports that The latest version is 1.7.3 but it upgrades unexpectedly to 1.7.4. It should either report that the latest version is 1.7.4 or upgrade to 1.7.3.

Actual Behavior

It upgrades to the different version then it reports

Steps to Reproduce

  1. terraform version
  2. brew upgrade terraform

Additional Context

Probably I upgraded it in a wrong way. Probably here:

Your version of Terraform is out of date! The latest version
is 1.7.3. You can update by downloading from https://www.terraform.io/downloads.html

you should extend this message with the command to use for the version upgrade, eg. use 'terraform upgrade' to upgrade bla-bla-bla.

References

No response

liamcervante commented 8 months ago

Hi @EugenKon, are you still seeing this? I've checked this now, and I see the correct latest version being reported in the upgrade message. The v1.7.4 version was released recently, so I wonder if there may have been some caching happening somewhere in the network stack that was looking up the latest version. Or, there may have been some race between homebrew and the checkpoint service for reporting that reports the latest version in which homebrew published the latest version before checkpoint was publishing the new version number.

You upgraded the right way with a homebrew installation.

I'm going to close this, because the right version is being reported for me now and we were close enough to the new release point that there may have been some caching/racing affecting the upgrade message. But, if you are still seeing the wrong message with an earlier version now then we should reopen this and investigate.

Thanks!

github-actions[bot] commented 7 months ago

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.