bootsnap: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found

I made sure the issue is in bootsnap

Yep (also, btw, there is a typo in the GitHub issue template which appears right after this header)

Steps to reproduce

Run any Rails command after installing bootsnap via bundler

Expected behavior

In this case: I ran rails server and expected my server to start

Actual behavior

Application crashed almost immediately, with a big error message starting with LoadError originating in bootsnap.so. I posted the full error message at the bottom of this issue.

System configuration

Bootsnap version: 1.15.0

Ruby version: 2.7.5

Rails version: 6.0.5

Full error message

Puma starting in single mode...
* Puma version: 5.6.5 (ruby 2.7.5-p203) ("Birdie's Version")
*  Min threads: 0
*  Max threads: 5
*  Environment: development
*          PID: 192898
! Unable to load application: LoadError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/bootsnap.so) - /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/bootsnap.so
Traceback (most recent call last):
	31: from /home/user/.rvm/gems/ruby-2.7.5/bin/puma:23:in `<main>'
	30: from /home/user/.rvm/gems/ruby-2.7.5/bin/puma:23:in `load'
	29: from /home/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.5/bin/puma:10:in `<top (required)>'
	28: from /home/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.5/lib/puma/cli.rb:81:in `run'
	27: from /home/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.5/lib/puma/launcher.rb:193:in `run'
	26: from /home/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.5/lib/puma/single.rb:44:in `run'
	25: from /home/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.5/lib/puma/runner.rb:150:in `load_and_bind'
	24: from /home/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.5/lib/puma/configuration.rb:270:in `app'
	23: from /home/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.5/lib/puma/configuration.rb:348:in `load_rackup'
	22: from /home/user/.rvm/gems/ruby-2.7.5/gems/rack-2.2.3.1/lib/rack/builder.rb:66:in `parse_file'
	21: from /home/user/.rvm/gems/ruby-2.7.5/gems/rack-2.2.3.1/lib/rack/builder.rb:105:in `load_file'
	20: from /home/user/.rvm/gems/ruby-2.7.5/gems/rack-2.2.3.1/lib/rack/builder.rb:116:in `new_from_string'
	19: from /home/user/.rvm/gems/ruby-2.7.5/gems/rack-2.2.3.1/lib/rack/builder.rb:116:in `eval'
	18: from config.ru:3:in `block in <main>'
	17: from /home/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	16: from /home/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	15: from /home/user/dev/core/config/environment.rb:2:in `<top (required)>'
	14: from /home/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	13: from /home/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	12: from /home/user/dev/core/config/application.rb:1:in `<top (required)>'
	11: from /home/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	10: from /home/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	 9: from /home/user/dev/core/config/boot.rb:4:in `<top (required)>'
	 8: from /home/user/dev/core/config/boot.rb:4:in `require'
	 7: from /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/setup.rb:5:in `<top (required)>'
	 6: from /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap.rb:100:in `default_setup'
	 5: from /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap.rb:57:in `setup'
	 4: from /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/compile_cache.rb:16:in `setup'
	 3: from /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/compile_cache.rb:16:in `require_relative'
	 2: from /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/compile_cache/iseq.rb:3:in `<top (required)>'
	 1: from /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/bootsnap.so) - /home/user/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.15.0/lib/bootsnap/bootsnap.so (LoadError)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 21 (9 by maintainers)

Most upvoted comments

I also encountered this problem. My problem occurred when I changed the execution image of CI/CD from ubuntu-20.04 to ubuntu-latest and the following error occurred:

Starting Rails application with RAILS_ENV = production
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/bootsnap.so) - /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/bootsnap.so (LoadError) 
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache/iseq.rb:3:in `<top (required)>' 
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache.rb:16:in `require_relative' 
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache.rb:16:in `setup' 
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap.rb:57:in `setup' 
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap.rb:100:in `default_setup' 
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.16.0/lib/bootsnap/setup.rb:5:in `<top (required)>' 
from /app/config/boot.rb:4:in `require'
from /app/config/boot.rb:4:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'

Now I solved it by adding .dockerignore, the content is as follows:

vendor/bundle
.bundle
tmp/cache

Adding .dockerignore can solve this problem normally. At present, I think it may be that when executing the CICD stage, CICD has its own vendor/bundle, and then I copied the vendor/bundle of the CICD image to my own container image in the dockerfile, which caused this error

My build-image.yaml,Other content has been deleted

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.0.6'
          bundler-cache: true
        env:
          BUNDLE_PATH: vendor/bundle

My dockerfile,Other content has been deleted

FROM ruby:3.0.6-bullseye

RUN mkdir /app/
WORKDIR /app/

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    nodejs \
    unzip \
    supervisor \
    libssl-dev \
    libjemalloc2 \
    && rm -rf /var/lib/apt/lists/*

COPY Gemfile* /app/

RUN gem install bundler:2.4.19 \
    && bundle config set deployment true  \
    && bundle config set path vendor/bundle \
    && bundle config set without 'development test'\
    && bundle install --jobs 4

ENV RAILS_ENV=production
ENV RUBYOPT='-W0'

ARG APP_VERSION
ENV APP_VERSION ${APP_VERSION}

# Here is the content of vendor/bundle in CICD ubuntu-latest copied
COPY . /app/

EXPOSE 3000

ENTRYPOINT ["/app/run.sh"]

Does ruby -e 'require "bootsnap"; require "bootsnap/bootsnap"' give you the same error? If so, something is off with the native extension. Maybe there are some hints in the output from MAKE='make V=1' gem install bootsnap --verbose --version 1.15.0 and ruby -rrbconfig -e 'pp RbConfig::CONFIG'.