cli
cli copied to clipboard
Self-update fails on Arch Linux
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
wget https://github.com/fastly/cli/releases/download/v0.10.0/fastly_v0.10.0_linux-amd64.tar.gztar -xzf fastly_v0.10.0_linux-amd64.tar.gz -C /usr/local/bin- 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
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.
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:
- check
fastly versionto ensure it's working before performing my desired action - receive message
Run fastly update to get the latest version. - run
fastly update - receive error message after the
Replacing binarystep ofERROR: error moving latest binary in place: error creating destination file: open /usr/local/bin/fastly: text file busy.
@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.