I’m trying to install Elixir 1.18.3 with asdf on macOS Catalina (10.15.7), but the installation fails because the downloaded archive is empty. Here’s the full output:
sudo asdf install elixir 1.18.3
==> Checking whether specified Elixir release exists...
==> Downloading 1.18.3 to /Users/x/.asdf/downloads/elixir/1.18.3/elixir-precompiled-1.18.3.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
==> Copying release into place
[/Users/x/.asdf/downloads/elixir/1.18.3/elixir-precompiled-1.18.3.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /Users/x/.asdf/downloads/elixir/1.18.3/elixir-precompiled-1.18.3.zip or
/Users/x/.asdf/downloads/elixir/1.18.3/elixir-precompiled-1.18.3.zip.zip, and cannot find /Users/x/.asdf/downloads/elixir/1.18.3/elixir-precompiled-1.18.3.zip.ZIP, period.
It looks like asdf is downloading a zero-byte file instead of the actual precompiled release.
What I’ve tried so far:
Updated asdf itself (git -C ~/.asdf pull) and the Elixir plugin (asdf plugin-update elixir)
Removed stale downloads in ~/.asdf/downloads/elixir/1.18.3/
Retried with ASDF_DEBUG=1 (still shows a zero-byte download)
Installing different Elixir versions (e.g. 1.18.4, 1.18.3, and earlier) — all give the same result
Questions:
Is this a known issue with the precompiled Elixir 1.18.3/1.18.4 releases on GitHub?
Or could it be something wrong with my local setup (curl, TLS, certificates)?
In case you don’t figure it out with asdf, I can recommend mise. After the asdf rewrite, I decided to take stock as to what the options are and gave mise a try … and haven’t looked back, having found misemore ergonomic and reliable. It serves the same use cases as asdf, and so has been a drop-in replacement for my use of asdf.
That’s what I was going to mention too – mise. It’s simpler to use, it works both with shims and without them. I use it without them. All its benefits are listed on their website, but to me, it’s just simpler than asdf.
Well finally I can breathe a sigh of relief. I am not the only person on ElixirForum who knows about mise, after a year or two shilling for it here.
No shims, for one thing. To me that’s already a huge benefit by itself. But it can also work as a task runner, and it has even a few more functions on top of that + the version manager thing.
I’m unable to install 1.18.4-otp-28 myself; same issue with the zero-byte archive. I’m using Mise, but it’s the same issue if I download the archive directly from https://builds.hex.pm/builds/elixir/v1.18.4-otp-28.zip
Looks like it might be a CDN issue; a co-worker was able to install it fine (and download from the link above) so I connected to a VPN a few provinces over and it downloaded and installed fine.
No idea why the download is borked using asdf or mise but to workaround the installation failure with mise, I went to https://builds.hex.pm/builds/elixir/v1.18.4-otp-27.zip in my browser to download the complete zip (7.6mb) first. I then moved the .zip to ~/.local/share/mise/downloads/elixir/1.18.4-otp-27 and ran mise install elixir@1.18.4-otp-27.
That installed without issue for me, whereas running mise install elixir@1.18.4-otp-27 (or any other impacted version) without having manually placed the zip fails for the same reason, a zero byte archive.