tsloughter / beamup

Install and control active BEAM languages and components
https://tsloughter.github.io/beamup/
Apache License 2.0
40 stars 2 forks source link

Unable to install latest Elixir due to asset not found error #38

Closed fhunleth closed 2 weeks ago

fhunleth commented 2 weeks ago

I'm trying this on an M2 Mac running Sonoma 14.6.1.

Installing and using Erlang (latest) works great.

I'm not quite sure what's happening with the Elixir install:

$ beamup install elixir latest
Error: Github release asset download failed

Caused by:
    Asset not found

Location:
    src/github.rs:211:29

I'm certain this is a red herring:

$ beamup languages
Languages:

erlang
gleam

Is there a way to turn on verbosity to get more information? I don't use Rust for anything, but if it's easy to post the build/install procedure, I'll give it a try.

tsloughter commented 2 weeks ago

Run with DEBUG=1.

What version of beamup is this? If not the latest I'd try the latest as this may be an issue that you have no Erlang installed through beamup. I don't currently have it look for a general install of Erlang to know what OTP version you have to know which Elixir to download.

fhunleth commented 2 weeks ago

Here are answer to all of your questions, I think:

Beamup version:

$ beamup -V
beamup 0.4.3

Erlang version and location:

$ which erl
/Users/fhunleth/.beamup/bin/erl
$ erl
Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Eshell V15.0.1 (press Ctrl+G to abort, type help(). for help)
1>

Running with DEBUG=1:

DEBUG=1 beamup install elixir latest
current bin path: /Users/fhunleth/.cargo/bin/beamup
running install: Elixir latest None None None
No local config found. Using global config
Found default "latest"
Looking up install for latest
Getting latest release from elixir-lang/elixir
with_native_roots processed 154 valid and 0 invalid certs
service.ready=true message=processing request
HTTP; http.method=GET http.url=https://api.github.com/repos/elixir-lang/elixir/releases/latest otel.name="HTTP" otel.kind="client"
requesting
resolving host="api.github.com"
connecting to 140.82.113.5:443
connected to 140.82.113.5:443
No cached session for DnsName("api.github.com")
Not resuming any session
Using ciphersuite TLS13_AES_128_GCM_SHA256
Not resuming
TLS1.3 encrypted extensions: [ServerNameAck]
ALPN protocol is None
HTTP; http.status_code=200
pooling idle connection for ("https", api.github.com)
buffer closing; waking pending tasks
Error: Github release asset download failed

Caused by:
    Asset not found

Location:
    src/github.rs:211:29
tsloughter commented 2 weeks ago

@fhunleth can you try a known release like v1.17.2.

tsloughter commented 2 weeks ago

I see now I missed languages command in the tests, hehe, so of course its broken. Will get that fixed this morning.

fhunleth commented 2 weeks ago

Here's the result with v1.17.2:

$ DEBUG=1 beamup install elixir v1.17.2
current bin path: /Users/fhunleth/.cargo/bin/beamup
running install: Elixir v1.17.2 None None None
No local config found. Using global config
Found default "latest"
Looking up install for latest
Getting v1.17.2 release from elixir-lang/elixir
with_native_roots processed 154 valid and 0 invalid certs
service.ready=true message=processing request
HTTP; http.method=GET http.url=https://api.github.com/repos/elixir-lang/elixir/releases/tags/v1.17.2 otel.name="HTTP" otel.kind="client"
requesting
resolving host="api.github.com"
connecting to 140.82.114.6:443
connected to 140.82.114.6:443
No cached session for DnsName("api.github.com")
Not resuming any session
Using ciphersuite TLS13_AES_128_GCM_SHA256
Not resuming
TLS1.3 encrypted extensions: [ServerNameAck]
ALPN protocol is None
HTTP; http.status_code=200
pooling idle connection for ("https", api.github.com)
buffer closing; waking pending tasks
Error: Github release asset download failed

Caused by:
    Asset not found

Location:
    src/github.rs:211:29

I believe this is completely unrelated, but in full transparency, my un-VPN'd home IP address is forever rate limited by GitHub. I'll eventually have to figure out how to get a GitHub token involved with the API requests, but I've been changing IP addresses to avoid the error.

$ beamup install elixir v1.17.2
Error: Failed fetching Github release v1.17.2 from elixir-lang/elixir

Caused by:
   0: GitHub
   1: API rate limit exceeded for 100.36.104.163. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
      Documentation URL: https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting

Location:
    src/github.rs:185:29
fhunleth commented 2 weeks ago

I forgot to add this to the first message, but thank you for all the help!

tsloughter commented 2 weeks ago

Oh, crap. It could be the rate limit :(. I noticed sometimes CI fails with this same issue but rerunning it passes. I figured it was something like rate limiting. Didn't think that would be the case for you. Interesting that you eventually got that actual error message instead of a response with empty assets though. So hm

fhunleth commented 2 weeks ago

Sadly, I don't think that it's the rate limit. I changed public IP addresses between runs to avoid GitHub rate limit issues. I can go back and forth between IP addresses and get the rate limit error or not get it reliably.

tsloughter commented 2 weeks ago

Oh, so you always get the "no assets" but only on the 1 IP get the rate limit error?

tsloughter commented 2 weeks ago

I need to add some more debug logs to see what exact asset it is looking for. I bet its getting something weird for the OTP version because its a bit of a hack how I find the major OTP version. I need to fix that.

Thanks for this, I bet I know what it is and I need to fix my hack based on directory name.

tsloughter commented 2 weeks ago

Pushed a possible fix to main that may make it work and will at least print out the name of the asset its looking for. Are you able to build rustup from source easily or should I make another release?

fhunleth commented 2 weeks ago

I'm out most of the rest of tonight. I don't know how to build rustup, but I'm game to learn. Just probably can't do it tonight. If you have time and push out a release, that seems quick and I'm sure I can run it before I turn in.

tsloughter commented 2 weeks ago

Ok, I went ahead and pushed a new release so a build will publish shortly.

tsloughter commented 2 weeks ago

Published: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/tsloughter/beamup/releases/download/v0.4.7/beamup-installer.sh | sh

tsloughter commented 2 weeks ago

Hm, though realized I see these intermittent failures in CI for Gleam which doesn't look up the current otp version. So this may or may not fix it.

fhunleth commented 2 weeks ago

I think you fixed everything for me:

$ beamup --version
beamup 0.4.7
$  beamup install elixir latest
[trimmed...]
$ which iex
/Users/fhunleth/.beamup/bin/iex
$ iex
Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Interactive Elixir (1.17.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
$ beamup languages
Languages:

Elixir
Erlang
Gleam

I think that the issue can be closed unless you want some additional debug from me. Thanks for the quick fix!!

Fwiw, I still get GitHub rate limit errors from my permanently broken home public IP address, but that's normal for me. If you want, I can create another issue for supporting $GITHUB_USER and $GITHUB_TOKEN. I'm so used to this that it's doesn't even slow me down any more from using beamup. Might affect CI use, though.

tsloughter commented 2 weeks ago

@fhunleth woo, na we can close this one and open another for adding support for tokens. That should be simple enough. Thanks!