GLIBC_2.29 not found error when using GRPC gem in a linux environment

78 views Asked by At

Im running an amazonlinux 2 docker container, in which I'm running a simple ruby script.

Got this error running a simple script, invoking GRPC methods:

/vendor/bundle/ruby/3.2.0/gems/grpc-1.60.0-aarch64-linux/src/ruby/lib/grpc/grpc.rb:20:in `require': /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /vendor/bundle/ruby/3.2.0/gems/grpc-1.60.0-aarch64-linux/src/ruby/lib/grpc/3.2/grpc_c.so) - /vendor/bundle/ruby/3.2.0/gems/grpc-1.60.0-aarch64-linux/src/ruby/lib/grpc/3.2/grpc_c.so (LoadError)
    from /vendor/bundle/ruby/3.2.0/gems/grpc-1.60.0-aarch64-linux/src/ruby/lib/grpc/grpc.rb:20:in `<top (required)>'
    from /vendor/bundle/ruby/3.2.0/gems/grpc-1.60.0-aarch64-linux/src/ruby/lib/grpc.rb:19:in `require_relative'
    from /vendor/bundle/ruby/3.2.0/gems/grpc-1.60.0-aarch64-linux/src/ruby/lib/grpc.rb:19:in `<top (required)>'
    from /vendor/bundle/ruby/3.2.0/gems/gapic-common-0.21.1/lib/gapic/grpc.rb:15:in `require'
    from /vendor/bundle/ruby/3.2.0/gems/gapic-common-0.21.1/lib/gapic/grpc.rb:15:in `<top (required)>'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-v1-0.10.0/lib/google/cloud/firestore/v1/firestore/client.rb:196:in `require'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-v1-0.10.0/lib/google/cloud/firestore/v1/firestore/client.rb:196:in `initialize'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-2.13.1/lib/google/cloud/firestore/service.rb:49:in `new'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-2.13.1/lib/google/cloud/firestore/service.rb:49:in `firestore'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-2.13.1/lib/google/cloud/firestore/service.rb:176:in `commit'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-2.13.1/lib/google/cloud/firestore/batch.rb:402:in `commit'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-2.13.1/lib/google/cloud/firestore/client.rb:655:in `batch'
    from /vendor/bundle/ruby/3.2.0/gems/google-cloud-firestore-2.13.1/lib/google/cloud/firestore/document_reference.rb:339:in `set'
    from firebaseTest.rb:30:in `perform_firestore_operations'
    from firebaseTest.rb:57:in `<main>'
bash-4.2# 

Turns out amazon linux 2 only has GLIBC_2.26, I need my package to conform to this.

I tried using this Dockerfile:

FROM amazonlinux:2

RUN yum install -y \
    shadow-utils \
    gcc \
    gcc-c++ \
    make \
    openssl-devel \
    readline-devel \
    zlib-devel \
    libyaml-devel \
    libffi-devel \
    autoconf \
    automake \
    libtool \
    bison \
    sqlite-devel \
    git \
    tar \
    gzip \
    which

# Install rbenv and ruby-build
RUN git clone https://github.com/rbenv/rbenv.git /root/.rbenv
RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> /root/.bashrc
RUN echo 'eval "$(rbenv init --no-rehash -)"' >> /root/.bashrc
RUN git clone https://github.com/rbenv/ruby-build.git /root/.rbenv/plugins/ruby-build

# rbenv env variables
ENV PATH /root/.rbenv/bin:$PATH
ENV RBENV_ROOT /root/.rbenv
ENV PATH /root/.rbenv/shims:$PATH

# Install Ruby 3.2.0
RUN rbenv install 3.2.0
RUN rbenv global 3.2.0

# Install Bundler
RUN gem install bundler

RUN yum clean all && rm -rf /var/cache/yum


COPY Gemfile Gemfile.lock firebaseTest.rb ServiceAccount.json ./


RUN bundle install --deployment --path vendor/bundle

I figured this would be installing the gems into an environment with GLIBC_2.26, not 2.29, so I thought bundler would fix up discrepancies with regards to these dependencies. Not sure if grpc has no versions that can use 2.26, documentation online didn't point in any direction.

Any help is appreciated,

0

There are 0 answers