erlef / setup-beam

Set up your BEAM-based GitHub Actions workflow (Erlang, Elixir, Gleam, ...)
MIT License
373 stars 50 forks source link

OpenSSL not installed in ~> 1.17 release #292

Closed noozo closed 2 months ago

noozo commented 2 months ago
Run erlef/setup-beam@v1.17.6
Installing Erlang/OTP OTP-27.0 - built on ubuntu-22.04
Using Elixir 1.17.0 (built for Erlang/OTP 27)
Installing Elixir v1.17.0-otp-27
Running mix local.rebar,--force
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp: /lib64/libtinfo.so.6: no version information available (required by /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp)

  Error: 13:45:34.903 [error] Unable to load crypto library. Failed with error:
  ":load_failed, Failed to load NIF library: '/home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/lib/crypto-5.5/priv/lib/crypto.so: undefined symbol: EVP_sm4_cbc, version OPENSSL_3.0.0'"
  OpenSSL might not be installed on this system.
noozo commented 2 months ago

Used to work in 1.16.0 (with Elixir 1.16.x and OTP 26.x.x)

noozo commented 2 months ago
ImageOS: ubuntu22
noozo commented 2 months ago

With ubuntu24 i get this:

Run erlef/setup-beam@v1.17.6
Installing Erlang/OTP OTP-27.0 - built on ubuntu-24.04
  /usr/bin/tar zx --strip-components=1 --warning=no-unknown-keyword --overwrite -C /home/ec2-user/actions-runner/_work/_temp/44ecbf30-8f4b-4664-8350-40dd2000da16 -f /home/ec2-user/actions-runner/_work/_temp/5647af16-7c46-4c26-b794-27635dd20c5e
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/Install -minimal /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp
  Installed Erlang/OTP version
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/bin/erl -version
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp: /lib64/libgcc_s.so.1: version `GCC_12.0.0' not found (required by /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp)
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp: /lib64/libtinfo.so.6: no version information available (required by /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp)
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp: /lib64/libm.so.6: version `GLIBC_2.38' not found (required by /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp)
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp: /lib64/libc.so.6: version `GLIBC_2.38' not found (required by /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp)
  Action install Erlang/OTP OTP-27.0 failed for mirror https://builds.hex.pm, with Error: The process '/home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/bin/erl' failed with exit code 1
  Error: Could not install Erlang/OTP OTP-27.0 from any hex.pm mirror
paulo-ferraz-oliveira commented 2 months ago

👋 @noozo.

Is this a self-hosted runner? Or GitHub-hosted one?

The action doesn't install OpenSSL, fwiw. I can try to replicate this (or even add this to CI, because SSL is an important enough element) but I'll ask @ericmj to see if he can spot something that might cause that issue.

noozo commented 2 months ago

It's a self hosted runner. Now that i think about it i might need to change something there as well, right? :)

paulo-ferraz-oliveira commented 2 months ago

Yeah, you probably have to install OpenSSL. I'm not sure how the pre-compiled elements find it, but it's probably dynamic linking. While Eric doesn't show up I'll try to dig some...

paulo-ferraz-oliveira commented 2 months ago

For reference, there's:

but these seem to indicate the provided pre-compiled elements support OpenSSL out-of-the-box.

Not sure what's going on here.

paulo-ferraz-oliveira commented 2 months ago

Here's the result of a recent run of ours: https://github.com/erlef/setup-beam/actions/runs/9535956572/job/26282392572#step:3:3.

It shows it's using:

and it's ✅

noozo commented 2 months ago

These are amazon EC2 instances that have been working flawlessly for 1.16/otp 26 for the past 2 years. Upgraded the libs on the runners just now, but seems to have had no effect.

noozo commented 2 months ago

They have the following installed:

openssl-1:3.0.8-1.amzn2023.0.12.x86_64                             
openssl-devel-1:3.0.8-1.amzn2023.0.12.x86_64                         
openssl-libs-1:3.0.8-1.amzn2023.0.12.x86_64  
paulo-ferraz-oliveira commented 2 months ago

We'll just have to wait for Eric (I'm out of ideas). I'm not sure how OpenSSL linking is done in the pre-compiled elements, but the action is not responsible for OpenSSL (installing it or linking it) 😄

If you want you can read more on Bob at https://github.com/hexpm/bob. Bob's the Builder whose results we use in setup-beam.

Edit: I'll still try to do some local testing with Ubuntu 24.04, but I don't know how far I'll get.

noozo commented 2 months ago

Might be related to something else actually: libtinfo part of ncurses.

noozo commented 2 months ago

Actually not really, the error is crypto related:

 Running mix local.rebar,--force
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
  /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp: /lib64/libtinfo.so.6: no version information available (required by /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/erts-15.0/bin/beam.smp)
  Error: 15:42:46.208 [error] Unable to load crypto library. Failed with error:
  ":load_failed, Failed to load NIF library: '/home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/lib/crypto-5.5/priv/lib/crypto.so: undefined symbol: EVP_sm4_cbc, version OPENSSL_3.0.0'"
  OpenSSL might not be installed on this system.
  ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :sufficient_support, 1, [file: ~c"tls_record.erl", line: 723]}, {:tls_record, :supported_protocol_versions, 1, [file: ~c"tls_record.erl", line: 363]}, {:tls_record, :supported_protocol_versions, 0, [file: ~c"tls_record.erl", line: 351]}, {:ssl, :default_versions, 1, [file: ~c"ssl.erl", line: 3707]}, {:ssl, :opt_versions, 3, [file: ~c"ssl.erl", line: 3696]}, {:ssl, :process_options, 3, [file: ~c"ssl.erl", line: 3617]}, {:ssl, :handle_options, 5, [file: ~c"ssl.erl", line: 3651]}]}}}]}
  Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.
  Action mix rebar failed for mirror https://builds.hex.pm, with Error: The process '/home/ec2-user/actions-runner/_work/_temp/.setup-beam/elixir/bin/mix' failed with exit code 1
  Error: Could not mix rebar from any hex.pm mirror
paulo-ferraz-oliveira commented 2 months ago

I'm on a Mac, so this is what I did:

Got

Erlang/OTP 27 [erts-15.0] [source] [64-bit] [smp:9:8] [ds:9:8:10] [async-threads:1] [jit]

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

This does not seem Bob-related either, so all's good. I'm not sure why AWS would break.

Edit

To top it off:

Got

* creating /root/.mix/elixir/1-17/rebar3

Inside the Elixir shell I could also do :crypto.start() without issues (I think if OpenSSL was not properly linked this would not work properly).

paulo-ferraz-oliveira commented 2 months ago

Did you check https://github.com/erlang/otp/issues/8290? Or Elixir forums/GitHub or Erlang forums/GitHub for similar issues.

paulo-ferraz-oliveira commented 2 months ago

@noozo, I'm closing this as non-setup-beam. Feel free to re-open if you feel otherwise.

noozo commented 2 months ago

Are you sure it's non related, though? the crypto lib that is err'ing is inside the setup-beam action folder :(

noozo commented 2 months ago

@ericmj Any idea?

paulo-ferraz-oliveira commented 2 months ago

Are you sure it's non related

I'm sure it's not action-related, at this moment. The action only downloads an asset, unzips it and runs it. I tried the same asset and same instructions the action performs in a Docker container and showed you I had no issues. If there's a more specific problem with the asset itself I wouldn't be able to assess, since I don't have a self-hosted runner available to test this out.

noozo commented 2 months ago

If i use ubuntu20 as the ImageOS i get this error:

Error: 09:05:15.673 [error] Unable to load crypto library. Failed with error:
  ":load_failed, Failed to load NIF library /home/ec2-user/actions-runner/_work/_temp/.setup-beam/otp/lib/crypto-5.5/priv/lib/crypto: 'libcrypto.so.1.1: cannot open shared object file: No such file or directory'"
  OpenSSL might not be installed on this system.
paulo-ferraz-oliveira commented 2 months ago

That's the action's install folder, so all those paths are "controlled" by the Erlang installer. I'd recommend also checking next to the Erlang forums and/or erlang/otp, on GitHub, to get further help.

ericmj commented 2 months ago

Can you try to confirm what change is causing the error. For example, does it work on Elixir 1.17 OTP 26.0 but not Elixir 1.17 OTP 27.0?

EDIT: The action is only supported on Ubuntu and Windows, if it worked on Amazon Linux in the past it was lucky chance. I would suggest using an Ubuntu base image.