cli icon indicating copy to clipboard operation
cli copied to clipboard

Self-update fails on Arch Linux

Open mccurdyc opened this issue 5 years ago • 3 comments

Version Applies to all versions

Please paste the output of fastly version here.

Fastly CLI version 0.10.0 (306abd1)
Built with go version go1.14.3 linux/amd64

System Info

$ uname -a
Linux hostname 5.6.15-arch1-1 #1 SMP PREEMPT Wed, 27 May 2020 23:42:26 +0000 x86_64 GNU/Linux

What happened

  1. wget https://github.com/fastly/cli/releases/download/v0.10.0/fastly_v0.10.0_linux-amd64.tar.gz
  2. tar -xzf fastly_v0.10.0_linux-amd64.tar.gz -C /usr/local/bin
  3. Update using fastly update
$ sudo /usr/local/bin/fastly update
- Initializing...Current version: 0.10.0
Latest version: 0.12.0
✓ Initializing...
✓ Fetching latest release...
✗ Replacing binary...

ERROR: error moving latest binary in place: error creating destination file: open /usr/local/bin/fastly: text file busy.

If you believe this error is the result of a bug, please file an issue: https://github.com/fastly/cli/issues/new?labels=bug&template=bug_report.md

mccurdyc avatar Jun 05 '20 18:06 mccurdyc

What I do instead is use the steps above and just replace the binary rather than using fastly update.

We can close this, but I did want to document this for anyone who may run into this in the future.

If this is specific to Arch Linux, I wouldn't worry about it as downloading from the Arch User Repository (AUR) would be preferred anyway and would work.

mccurdyc avatar Jun 05 '20 18:06 mccurdyc

I am running into this as well using the WSL. As a user, I'd definitely expect to be able to perform fastly update to get the latest version.

output of fastly version:

Fastly CLI version 0.36.0 (dd0b7d9)
Built with go version go1.16.6 linux/amd64

system info: Linux DESKTOP-S1TBRA9 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

what happened:

  1. check fastly version to ensure it's working before performing my desired action
  2. receive message Run fastly update to get the latest version.
  3. run fastly update
  4. receive error message after the Replacing binary step of ERROR: error moving latest binary in place: error creating destination file: open /usr/local/bin/fastly: text file busy.

swagitda avatar Feb 02 '22 15:02 swagitda

@mccurdyc @swagitda 👋🏻 this issue was opened before I started at Fastly so I've only just seen it 😬

We had a similar issue with a Windows user, and this was the implementation we ended up with:

https://github.com/fastly/cli/blob/5917e4d81f1180428f00286e26d6ac0a2b4e8001/pkg/commands/update/root.go#L99-L123

I'm going to try and get this scheduled into our upcoming Q3 work.

Integralist avatar Jun 23 '22 13:06 Integralist