Orb version:
2.0.0 (also 1.8.0)
What happened:
After updating cimg/node from 16.17.1 to 16.18.0, the gem installation failed in the environment set up with ruby/install. ruby version was 2.7.6.
Here is the configuration file that reproduces
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
# https://circleci.com/developer/orbs/orb/circleci/ruby
ruby: circleci/[email protected]
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build:
docker:
- image: cimg/node:16.18.0
steps:
- checkout
- ruby/install:
version: 2.7.6
- run: |
gem install bundler
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- build
ref. https://github.com/mkusaka/ruby-orb-issue-repro/blob/3a1188dac37599e24814c020058e3b71415c79c8/.circleci/config.yml
The error message was something like this
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Exited with code exit status 1
ref. https://app.circleci.com/pipelines/github/mkusaka/ruby-orb-issue-repro/2/workflows/bbc2c09a-36d2-4bb0-b926-9cb3b3123c58/jobs/2
As the error message shows, this seems to be caused by openssl.
Expected behavior:
I want gem install to not fail after install ruby2.7.6 with ruby/install even in an environment with cimb/base:2022.09 as the base image.
Additional Information:
After some investigation, I found that cimg/node 16.17.1 uses openssl 1.1.1f (ubuntu 20.04) and cimg/node 16.18.0 uses openssl 3.0.2 (ubuntu 22.04).
~/src/github.com/mkusaka/ruby-orb-issue-repro
❯ docker run -it --rm cimg/node:16.17.1 openssl version
OpenSSL 1.1.1f 31 Mar 2020
~/src/github.com/mkusaka/ruby-orb-issue-repro
❯ docker run -it --rm cimg/node:16.17.1 cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
~/src/github.com/mkusaka/ruby-orb-issue-repro
❯ docker run -it --rm cimg/node:16.18.0 openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
~/src/github.com/mkusaka/ruby-orb-issue-repro
❯ docker run -it --rm cimg/node:16.18.0 cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
This is caused by cimg/base changing the base image from ubuntu 20.04 to 22.04 at the time of 2022.08 to 2022.09, and cimg/node changing the base image from cimg/base 2022.08 to 2022.10 at the time of 16.17.1.
~/src/github.com/mkusaka/ruby-orb-issue-repro workaround
❯ docker run -it --rm cimg/base:2022.08 cat /etc/os-releases
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
~/src/github.com/mkusaka/ruby-orb-issue-repro
❯ docker run -it --rm cimg/base:2022.09 cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
refs.
The problem related to openssl 3.0.0 (ubuntu22.04) seems to be a known issue in ruby and in case of ruby-build, a solution has been found .
However, the current installation of the ruby-orb script (based on rvm) does not work, and it seems that we need to re-install via script.
At this moment, there are several workarounds.
A. Re-install via rvm
Change the configuration file as follows
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
# https://circleci.com/developer/orbs/orb/circleci/ruby
ruby: circleci/[email protected]
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build:
docker:
- image: cimg/node:16.18.0
steps:
- checkout
- ruby/install:
version: 2.7.6
- run: |
rvm pkg install openssl
rvm reinstall ruby-2.7.6 --with-openssl-dir=$HOME/.rvm/usr
- run: |
gem install aws-sdk
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- build
ref. https://github.com/mkusaka/ruby-orb-issue-repro/blob/6f15e0fb1ec57903e211d187659f83256f1fd5fb/.circleci/config.yml
The problem with this workarond is reinstallation via rvm is very slow (about 4minutes).
B. Stop using cimg/node and change cimg/base with ubuntu 20.04
Change the configuration file as follows
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
# https://circleci.com/developer/orbs/orb/circleci/ruby
ruby: circleci/[email protected]
# https://circleci.com/developer/orbs/orb/circleci/node
node: circleci/[email protected]
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build:
docker:
- image: cimg/base:2022.10-20.04
steps:
- checkout
- node/install:
yarn-version: 1.22.19
install-yarn: true
node-version: 16.18.0
- ruby/install:
version: 2.7.6
- run: |
gem install bundler
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- build
ref. https://github.com/mkusaka/ruby-orb-issue-repro/blob/1bdb39845afe3fe799e067e3e55578b2ba3cbd3f/.circleci/config.yml
The problem with this workarond is that it requires more effort to create an environment equivalent to a convenience image such as cimg/node:16.18.0-browsers.