Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu-latest change does not include libssl1.1 #318

Open
djbberko opened this issue Jan 22, 2025 · 8 comments
Open

ubuntu-latest change does not include libssl1.1 #318

djbberko opened this issue Jan 22, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@djbberko
Copy link

djbberko commented Jan 22, 2025

The bug

Github runners updated ubuntu-latest to use 24.04, which does not include libssl1.1. See here: actions/runner-images#10636
This breaks the action with the following error:

  /home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
  
  Error: 22:13:59.705 [error] Unable to load crypto library. Failed with error:
  ":load_failed, Failed to load NIF library /home/runner/work/_temp/.setup-beam/otp/lib/crypto-5.1.2/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.
  
  ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'builds.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :sufficient_support, 1, [file: 'tls_record.erl', line: 772]}, {:tls_record, :supported_protocol_versions, 1, [file: 'tls_record.erl', line: 392]}, {:tls_record, :supported_protocol_versions, 0, [file: 'tls_record.erl', line: 380]}, {:ssl, :handle_option, 4, [file: 'ssl.erl', line: 1906]}, {:ssl, :process_options, 3, [file: 'ssl.erl', line: 1585]}, {:ssl, :handle_options, 5, [file: 'ssl.erl', line: 1537]}, {:ssl, :connect, 4, [file: 'ssl.erl', line: 618]}]}}}]}
  
  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/runner/work/_temp/.setup-beam/elixir/bin/mix' failed with exit code 1
  Error: Could not mix rebar from any hex.pm mirror

How to replicate

An ordered list of steps to replicate the bug:

  1. run an action on ubuntu-latest

Expected behaviour

Install BEAM succesfully.

Additional context

Any other context about the bug.

@djbberko djbberko added the bug Something isn't working label Jan 22, 2025
@starbelly
Copy link
Member

Do you have a way to reproduce this? I'm not having issues, and have tested across a few projects, so a few more details would help. Specifically, versions of erlang, elixir, etc. Even better would be a failed run or workflow file.

@djbberko
Copy link
Author

djbberko commented Jan 23, 2025

Do you have a way to reproduce this? I'm not having issues, and have tested across a few projects, so a few more details would help. Specifically, versions of erlang, elixir, etc. Even better would be a failed run or workflow file.

I have seen this issue in both OTP 24 and 25. I unfortunately cannot share the workflow itself since it is in a private repository. Maybe the full error output will help?

Installing Erlang/OTP OTP-25.1.2.1 - built on amd64/ubuntu-20.04
  /usr/bin/tar zx --strip-components=1 --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/3ffdfa85-e042-4309-9500-c1ff77a0d36a -f /home/runner/work/_temp/7b55474a-6772-4505-a7c7-748ef3f3daad
  /home/runner/work/_temp/.setup-beam/otp/Install -minimal /home/runner/work/_temp/.setup-beam/otp
  Installed Erlang/OTP version
  /home/runner/work/_temp/.setup-beam/otp/bin/erl -version
  Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 13.1.2.1
Using Elixir 1.14.2 (built for Erlang/OTP 25)
Installing Elixir v1.14.2-otp-25
  /usr/bin/unzip -o -q /home/runner/work/_temp/984ab6ab-b323-4929-9205-cedea2e7e549
  Installed Elixir version
  /home/runner/work/_temp/.setup-beam/elixir/bin/elixir -v
  Erlang/OTP 25 [erts-13.1.2.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
  
  Elixir 1.14.2 (compiled with Erlang/OTP 25)
Running mix local.rebar,--force
  /home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
  
  Error: 22:13:59.705 [error] Unable to load crypto library. Failed with error:
  ":load_failed, Failed to load NIF library /home/runner/work/_temp/.setup-beam/otp/lib/crypto-5.1.2/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.
  
  ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'builds.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :sufficient_support, 1, [file: 'tls_record.erl', line: 772]}, {:tls_record, :supported_protocol_versions, 1, [file: 'tls_record.erl', line: 392]}, {:tls_record, :supported_protocol_versions, 0, [file: 'tls_record.erl', line: 380]}, {:ssl, :handle_option, 4, [file: 'ssl.erl', line: 1906]}, {:ssl, :process_options, 3, [file: 'ssl.erl', line: [15](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:4:16)85]}, {:ssl, :handle_options, 5, [file: 'ssl.erl', line: 1537]}, {:ssl, :connect, 4, [file: 'ssl.erl', line: 618]}]}}}]}
  
  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/runner/work/_temp/.setup-beam/elixir/bin/mix' failed with exit code 1
  Error: Could not mix rebar from any hex.pm mirror

And the setup

Current runner version: '2.32[1](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:1:1).0'
Operating System
  Ubuntu
  24.04.1
  LTS
Runner Image
  Image: ubuntu-[2](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:1:2)4.04
  Version: 20250105.1.0
  Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250105.1/images/ubuntu/Ubuntu2404-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250105.1
Runner Image Provisioner
GITHUB_TOKEN Permissions
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'octokit/request-action@v2.x' (SHA:786[3](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:1:3)51db496fa66730d8faa09ef279108da175a3)
Download action repository 'actions/checkout@v3' (SHA:f[4](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:1:4)3a0e5ff2bd29409[5](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:1:5)638e1828[6](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:1:7)ca9a3d1956744)
Download action repository 'erlef/setup-beam@v1' (SHA:5304e04ea2b355f03681464e683d92e3b2f18451)
Download action repository 'actions/cache@v3' (SHA:f4b3439a656ba812b8cb41[7](https://github.com/adRise/apollo/actions/runs/12918024493/job/36025728265#step:1:8)d2d49f9c810103092)
Complete job name: Mix Test

and the action (I have tried using the latest setup-beam version as well)

      - uses: erlef/setup-beam@v1
        with:
          otp-version: ${{ needs.init.outputs.otp_version }}
          elixir-version: ${{ needs.init.outputs.elixir_version }}

@starbelly
Copy link
Member

Do you have a way to reproduce this? I'm not having issues, and have tested across a few projects, so a few more details would help. Specifically, versions of erlang, elixir, etc. Even better would be a failed run or workflow file.

I have seen this issue in both OTP 24 and 25. I unfortunately cannot share the workflow itself since it is in a private repository. Maybe the full error output will help?

Installing Erlang/OTP OTP-25.1.2.1 - built on amd64/ubuntu-20.04
  /usr/bin/tar zx --strip-components=1 --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/3ffdfa85-\

Shot in the dark here, but I ran into a similar issue the other day, it turned out I had ImageOS set in the env, which overrode what setup-beam attempted to detect. This was left over from temporarily moving to self-hosted runners for a bit, then back to github runners, but wasn't a problem until the recent update.

If this turns out to be the issue, what should be done perhaps is to insert a determined via ... in setup-beam, this might be helpful.

@starbelly
Copy link
Member

Hi @djbberko did you see if what I stated as a hypothesis could be disproved?

@serpent213
Copy link

Hi folks,

setting up a Gitea Actions Runner for a Phoenix project, I stumbled upon this issue.

Workflow file is based on the template, added MinIO:

workflow.yaml
name: Heimdall Mix Tests

# Define workflow that runs when changes are pushed to the
# `main` branch or pushed to a PR branch that targets the `main`
# branch. Change the branch name if your project uses a
# different name for the main branch like "master" or "production".
on: [push, pull_request]

# Sets the ENV `MIX_ENV` to `test` for running tests
env:
  MIX_ENV: test
  MINIO_ROOT_USER: minio
  MINIO_ROOT_PASSWORD: miniosecret

permissions:
  contents: read

jobs:
  test:
    # Set up a Postgres DB service. By default, Phoenix applications
    # use Postgres. This creates a database for running tests.
    # Additional services can be defined here if required.
    services:
      pgsql:
        image: postgres:latest
        ports: ['5432:5432']
        env:
          POSTGRES_USER: dev
          POSTGRES_PASSWORD: dev
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

      minio:
        image: bitnami/minio:latest
        ports: ['9000:9000']
        # env:
        #   MINIO_ROOT_USER: minio
        #   MINIO_ROOT_PASSWORD: minio
        options: >-
          --health-cmd "curl -I http://localhost:9000/minio/health/live"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 6
          --health-start-period 30s

    runs-on: ubuntu-latest
    name: Heimdall Mix Tests
    # name: Test on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
    strategy:
      # Specify the OTP and Elixir versions to use when building
      # and running the workflow steps.
      matrix:
        otp: ['25.3.2']       # Define the OTP version [required]
        elixir: ['1.17.3']    # Define the elixir version [required]
    steps:
    # Step: Setup Elixir + Erlang image as the base.
    - name: Set up Elixir
      uses: erlef/setup-beam@v1
      with:
        otp-version: ${{matrix.otp}}
        elixir-version: ${{matrix.elixir}}

    # Step: Check out the code.
    - name: Checkout code
      uses: actions/checkout@v4

    # Step: Define how to cache deps. Restores existing cache if present.
    - name: Cache deps
      id: cache-deps
      uses: actions/cache@v3
      env:
        cache-name: cache-elixir-deps
      with:
        path: deps
        key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
        restore-keys: |
          ${{ runner.os }}-mix-${{ env.cache-name }}-

    # Step: Define how to cache the `_build` directory. After the first run,
    # this speeds up tests runs a lot. This includes not re-compiling our
    # project's downloaded deps every run.
    - name: Cache compiled build
      id: cache-build
      uses: actions/cache@v3
      env:
        cache-name: cache-compiled-build
      with:
        path: _build
        key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
        restore-keys: |
          ${{ runner.os }}-mix-${{ env.cache-name }}-
          ${{ runner.os }}-mix-

    # Step: Download project dependencies. If unchanged, uses
    # the cached version.
    - name: Install dependencies
      run: mix deps.get

    # Step: Compile the project treating any warnings as errors.
    # Customize this step if a different behavior is desired.
    - name: Compiles without warnings
      run: mix compile
      # run: mix compile --warnings-as-errors

    # Step: Check that the checked in code has already been formatted.
    # This step fails if something was found unformatted.
    # Customize this step as desired.
    - name: Check Formatting
      run: mix format --check-formatted

    # Step: Execute the tests.
    - name: Setup DB and Assets
      run: mix setup

    # Step: Execute the tests.
    - name: Run tests
      run: |
        mix test || true
        sleep 3600
Set up Elixir step logs
::group::Installing Erlang/OTP OTP-25.3.2.16 - built on amd64/ubuntu-20.04
[2](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-2)
[command]/usr/bin/tar zx --strip-components=1 --warning=no-unknown-keyword --overwrite -C /tmp/76a1696c-9fb9-406e-9d91-1d1f7ad37436 -f /tmp/c833402a-517b-4c75-9795-4298697335cb
[3](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-3)
[command]/tmp/.setup-beam/otp/Install -minimal /tmp/.setup-beam/otp
[4](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-4)
Installed Erlang/OTP version
[5](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-5)
[command]/tmp/.setup-beam/otp/bin/erl -version
[6](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-6)
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 13.2.2.12
[7](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-7)
::endgroup::
[8](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-8)
Using Elixir 1.17.3 (built for Erlang/OTP 25)
[9](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-9)
::group::Installing Elixir v1.17.3-otp-25
[10](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-10)
Installed Elixir version
[11](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-11)
[command]/tmp/.setup-beam/elixir/bin/elixir -v
[12](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-12)
Erlang/OTP 25 [erts-13.2.2.12] [source] [64-bit] [smp:32:6] [ds:32:6:10] [async-threads:1] [jit:ns]
[13](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-13)
[14](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-14)
Elixir 1.17.3 (compiled with Erlang/OTP 25)
[15](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-15)
##[add-matcher]/run/act/actions/7c0d8ed7f53b94922866a2ffb6fde3823398b21f2476f74350a77adac5a7c7fe/dist/elixir-matchers.json
[16](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-16)
::endgroup::
[17](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-17)
::group::Running mix local.rebar,--force
[18](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-18)
[command]/tmp/.setup-beam/elixir/bin/mix local.rebar --force
[19](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-19)
[20](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-20)
10:06:30.426 [error] Unable to load crypto library. Failed with error:
[21](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-21)
":load_failed, Failed to load NIF library /tmp/.setup-beam/otp/lib/crypto-5.1.4.3/priv/lib/crypto: 'libcrypto.so.1.1: cannot open shared object file: No such file or directory'"
[22](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-22)
OpenSSL might not be installed on this system.
[23](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-23)
[24](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-24)
** (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: 772]}, {:tls_record, :supported_protocol_versions, 1, [file: ~c"tls_record.erl", line: 392]}, {:tls_record, :supported_protocol_versions, 0, [file: ~c"tls_record.erl", line: 380]}, {:ssl, :handle_option, 4, [file: ~c"ssl.erl", line: 1910]}, {:ssl, :process_options, 3, [file: ~c"ssl.erl", line: 1582]}, {:ssl, :handle_options, 5, [file: ~c"ssl.erl", line: 1534]}, {:ssl, :connect, 4, [file: ~c"ssl.erl", line: 624]}]}}}]}
[25](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-25)
[26](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-26)
Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.
[27](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-27)
[28](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-28)
Action mix rebar failed for mirror https://builds.hex.pm, with Error: The process '/tmp/.setup-beam/elixir/bin/mix' failed with exit code 1
[29](https://git.example/XPL/heimdall/actions/runs/25#jobstep-1-29)
::error::Could not mix rebar from any hex.pm mirror

Runner config:

    labels = [
      # NixOS example config
      # fake the ubuntu name, because node provides no ubuntu builds
      # "ubuntu-latest:docker://node:20-bookworm"
      # "ubuntu-22:docker://node:20-bookworm"
      # "ubuntu-20:docker://node:20-bullseye"
      # Gitea example config
      "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest"
      "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04"
      "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04"
    ];

I'm new to Action Runner and not a Docker expert, still trying to make sense of these labels thing (and mapping Ubuntu to Debian...?). Anyway, the above log is from running with docker://gitea/runner-images:ubuntu-latest, also docker://node:20-bookworm results in the same libcrypto error.

Got it to work with docker://node:20-bullseye, but that opens other gates to dependency hell in my setup.

@serpent213
Copy link

P.S.: Used the fly.io template, as it looked like a good fit...

@serpent213
Copy link

serpent213 commented Feb 4, 2025

Working now using docker://gitea/runner-images:ubuntu-22.04. I don't know if this is a setup-beam or a https://gitea.com/gitea/runner-images issue...

(Happened with debian-latest as well, though.)

@arpunk
Copy link

arpunk commented Feb 4, 2025

FWIW, I'm also hitting this error using gitea with the same fly.io template and ubuntu-latest. Works fine if I use ubuntu-22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants