warrensbox/terraform-switcher

Installation via install.sh fails for version 1.0.0

Closed this issue ยท 30 comments

Installation fails using install.sh after release of v1.0.0

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

Script output with debug:

warrensbox/terraform-switcher info checking GitHub for latest tag
warrensbox/terraform-switcher debug http_download https://github.com/warrensbox/terraform-switcher/releases/latest
warrensbox/terraform-switcher info found version: 1.0.0 for 1.0.0/linux/amd64
warrensbox/terraform-switcher debug downloading files into /tmp/tmp.7kYA692ao2
warrensbox/terraform-switcher debug http_download https://github.com/warrensbox/terraform-switcher/releases/download/1.0.0/terraform-switcher_1.0.0_linux_amd64.tar.gz
warrensbox/terraform-switcher debug http_download_curl received HTTP status 404

All of the artifacts contain a leading dot in the version:

terraform-switcher_.1.0.0_Darwin_amd64.tar.gz 

It looks like the gorelease has a space in the path (trying to work out if this is the 'tag' output from the bump action), which I suspect is then being converted to a dot:

      โ€ข uploading to release                         file=dist/terraform-switcher_ 1.0.0_Windows_armv7.tar.gz name=terraform-switcher_ 1.0.0_Windows_armv7.tar.gz

Related:

โฏ brew install warrensbox/tap/tfswitch

Error: invalid attribute for formula 'warrensbox/tap/tfswitch': url ("https://github.com/warrensbox/terraform-switcher/releases/download/1.0.0/terraform-switcher_ 1.0.0_Darwin_arm64.tar.gz")
Please report this issue:

@warrensbox FYI

Meanwhile I updated all achieve names by removing the extraneous dot.

@arturmartins @MatthewJohn Could you please confirm you're not having issues with downloading artifacts now?

Dang, Homebrew tap has spaces in filenames ๐Ÿ˜ž Need @warrensbox here as I have no write perms to tap repo (and I'm still trying to figure out what went wrong with goreleaser)

Fixed and re-uploaded checksums file (manually at this time).

install.sh should be good since my manual changes.

The installer is still failing for me on OSX and Linux:
Linux:

 curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  9270  100  9270    0     0  31929      0 --:--:-- --:--:-- --:--:-- 31965
warrensbox/terraform-switcher info checking GitHub for latest tag
warrensbox/terraform-switcher info found version: 1.0.0 for 1.0.0/linux/amd64
warrensbox/terraform-switcher err hash_sha256_verify unable to find checksum for '/tmp/tmp.JV6aezsn3k/terraform-switcher_1.0.0_linux_amd64.tar.gz' in '/tmp/tmp.JV6aezsn3k/terraform-switcher_1.0.0_checksums.txt'

OSX

curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9270  100  9270    0     0  65317      0 --:--:-- --:--:-- --:--:-- 65744Password:

warrensbox/terraform-switcher info checking GitHub for latest tag
warrensbox/terraform-switcher info found version: 1.0.0 for 1.0.0/darwin/arm64
warrensbox/terraform-switcher err hash_sha256_verify unable to find checksum for '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.UhAErqCXKq/terraform-switcher_1.0.0_darwin_arm64.tar.gz' in '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.UhAErqCXKq/terraform-switcher_1.0.0_checksums.txt'

Passing a tag to the install script is working as a workaround.

Oh, I missed lower vs upper case in platform names since the new automation ๐Ÿคฆ๐Ÿป
Re-uploaded new checksums file with checksums added for lowercased filenames.
install.sh should be good now ๐Ÿคž๐Ÿป

Oh, I missed lower vs upper case in platform names since the new automation ๐Ÿคฆ๐Ÿป Re-uploaded new checksums file with checksums added for lowercased filenames. install.sh should be good now ๐Ÿคž๐Ÿป

Works for me now!

works on linux/amd64 now, thanks

@yermulnik Have updated my use case to confirm - CI running: https://gitlab.dockstudios.co.uk/pub/terrareg/-/pipelines/4769

Many thanks
Matt

Okay, the root cause is found. We're working towards the resolution.
Thank you all for highlighting this and apologies for the inconveniences.
We'll update this issue once the issue is resolved in full.

@yermulnik , does the 1.0.0 have functionality impact (change of core functionality/breaking changes/removed features)?
I can't see release notes here: https://github.com/warrensbox/terraform-switcher/blob/master/CHANGELOG.md
and the Github Release "changelog" isn't entirely obvious :)

Thanks
Matt

does the 1.0.0 have functionality impact

Should not ๐Ÿคž๐Ÿป
None feature has been removed.
No functional changes were applied.
Some security updates were applied.
Also some improvements for Windows OS were added.
Plus some other minor improvements.

Oh, I missed lower vs upper case in platform names since the new automation ๐Ÿคฆ๐Ÿป Re-uploaded new checksums file with checksums added for lowercased filenames. install.sh should be good now ๐Ÿคž๐Ÿป

Many Thanks, works on both linux/amd64, linux/arm64 :)

@arturmartins @MatthewJohn Could you please confirm you're not having issues with downloading artifacts now?

To test that, the tap will need to be updated with the new path. (Current HEAD is
warrensbox/homebrew-tap@0c26995)

At the moment, I can't even untap. I guess I will wait for @warrensbox to update the tap when possible.

Yep ๐Ÿ˜ข Or #340

As of look of it, this should be all fixed now, inc Homebrew.

> brew upgrade
==> Auto-updating Homebrew...
==> Upgrading 1 outdated package:
warrensbox/tap/tfswitch 0.13.1308 -> 1.0.1
==> Fetching warrensbox/tap/tfswitch
==> Downloading https://github.com/warrensbox/terraform-switcher/releases/download/1.0.1/terraform-s
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/13
############################################################################################# 100.0%
==> Upgrading warrensbox/tap/tfswitch
  0.13.1308 -> 1.0.1
==> Caveats
Type 'tfswitch' on your command line and choose the terraform version that you want from the dropdown. This command currently only works on macOS and Linux
==> Summary
โœ”  /home/linuxbrew/.linuxbrew/Cellar/tfswitch/1.0.1: 6 files, 10.5MB, built in 1 second
==> Running `brew cleanup tfswitch`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /home/linuxbrew/.linuxbrew/Cellar/tfswitch/0.13.1308... (6 files, 9.8MB)

> tfswitch --version

Version: 1.0.1

@warrensbox Thank you ๐Ÿ‘๐Ÿป

@yermulnik can you help me test the install.sh script as well?

@warrensbox Looks okay:

> curl -SsL https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash -s -- -b ~/tmp/test_tfswitch_install.sh latest
warrensbox/terraform-switcher info checking GitHub for tag 'latest'
warrensbox/terraform-switcher info found version: 1.0.1 for 1.0.1/linux/amd64
warrensbox/terraform-switcher info installed /home/giermulnik/tmp/test_tfswitch_install.sh/tfswitch

> ~/tmp/test_tfswitch_install.sh/tfswitch --version

Version: 1.0.1

> curl -SsL https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash -s -- -b ~/tmp/test_tfswitch_install.sh 0.13.1308
warrensbox/terraform-switcher info checking GitHub for tag '0.13.1308'
warrensbox/terraform-switcher info found version: 0.13.1308 for 0.13.1308/linux/amd64
warrensbox/terraform-switcher info installed /home/giermulnik/tmp/test_tfswitch_install.sh/tfswitch

> ~/tmp/test_tfswitch_install.sh/tfswitch --version

Version: 0.13.1308

@warrensbox The only broken "leftover" looks to be v1.0.0 via Homebrew (warrensbox/homebrew-tap@0c26995) ๐Ÿคท๐Ÿป

Oh ๐Ÿ˜•

Just in case: #346

does the 1.0.0 have functionality impact

Should not ๐Ÿคž๐Ÿป

I lied ๐Ÿ˜ข

does the 1.0.0 have functionality impact

Should not ๐Ÿคž๐Ÿป

I lied ๐Ÿ˜ข

The #346 resolves backward compatibility, though partially (as lower supported versions of Linux are going to be Debian Bullseye 11 and Ubuntu Jammy 20.04, whilst tfswitch 0.13.1308 supported more older releases like Ubuntu Bionic)

@yermulnik Have updated my use case to confirm - CI running: https://gitlab.dockstudios.co.uk/pub/terrareg/-/pipelines/4769

Many thanks Matt

All seems good! Thank you :)

All good! Thanks for the fix!

brew install warrensbox/tap/tfswitch
 [... REDACTED ...]
tfswitch 0.13.1308 is already installed but outdated (so it will be upgraded).
==> Fetching warrensbox/tap/tfswitch
==> Downloading https://github.com/warrensbox/terraform-switcher/releases/download/1.0.2/terraform-switcher_1.0.2_darwin_arm64.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/131640155/f47c966a-4513-49d7-b313-a5f91
################################################################################################################################## 100.0%
==> Upgrading warrensbox/tap/tfswitch
  0.13.1308 -> 1.0.2
  [... REDACTED ...]

@MatthewJohn @arturmartins Thanks for checking and confirming.