Docker-gitlab: Backup failure due to rubygems-integration version incompatibility

Created on 22 Dec 2020  路  5Comments  路  Source: sameersbn/docker-gitlab

After upgrade from 13.5.3 to 13.6.2, backup failed.

/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /home/git/gitlab/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
    from /usr/lib/ruby/2.7.0/rubygems.rb:252:in `bin_path'
    from /usr/lib/ruby/2.7.0/bundler/rubygems_integration.rb:223:in `bin_path'
    from /usr/lib/ruby/2.7.0/bundler/shared_helpers.rb:297:in `set_bundle_variables'
    from /usr/lib/ruby/2.7.0/bundler/shared_helpers.rb:76:in `set_bundle_environment'
    from /usr/lib/ruby/2.7.0/bundler/runtime.rb:22:in `setup'
    from /usr/lib/ruby/2.7.0/bundler.rb:149:in `setup'
    from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>'
    from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level'
    from /usr/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in `silence'
    from /usr/lib/ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>'
    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
    from /home/git/gitlab/config/boot.rb:4:in `<top (required)>'
    from /home/git/gitlab/bin/rake:2:in `require_relative'
    from /home/git/gitlab/bin/rake:2:in `<main>'

Relevant Gitlab issue: https://gitlab.com/gitlab-org/gitlab-compose-kit/-/issues/24
It is discussed there as annoying warning issue, but it's actually causing failures like backup failure.

Manually running gem update --system 3.0.8 in running container fixed backup crash for me, but many warnings still persist and this can be considered only as temporary workaround. Real fix is required. For example, during backup, following warnings are printed that were not printed in 13.5.3:

/home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/acts-as-taggable-on-6.5.0/lib/acts_as_taggable_on/tagging.rb:9: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/associations.rb:1657: warning: The called method `belongs_to' is defined here
/home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/marginalia-1.9.0/lib/marginalia.rb:94: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/connection_adapters/postgresql_adapter.rb:648: warning: The called method `execute_and_clear_without_marginalia' is defined here

The issue is supposed to be fixed in rubygems-integration version 1.13, but Ubuntu Bionic (18.04) that is used as base image for this docker-gitlab project, only has version 1.11 and it seems, it won't get any backports/upgrades for this package.

https://salsa.debian.org/ruby-team/rubygems-integration/blob/19f2071a0f6e40ac04cdeae7fbcb14880aa24bf6/debian/changelog#L24

Most helpful comment

Brightbox have updated package ruby2.7 to 2.7.2p137 in their brightbox/ruby-ng-experimental repository. rubygems-integration also updated to 1:1.15.1-1 so we can use it for temporal use (because it is experimental...)

For testing, edit Dockerfile like this and build image by yourself:

- && echo "deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu bionic main" >> /etc/apt/sources.list \
+ && echo "deb http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu bionic main" >> /etc/apt/sources.list \

At least backup and restoring worked for me with patch I've wrote above + release 13.6.3. I'll try with 13.7.3 later.


Edit : 13.7.3 also works for me.


Edit : 13.8.4 with the patch is working for a week, daily backup. 2021-02-22

All 5 comments

I'm getting these messages while gitlab tries to update the db schema during startup.

Please stop ignoring this issue and upgrade base image to newer Ubuntu version that has required rubygems-integration version.

Please stop ignoring this issue and upgrade base image to newer Ubuntu version that has required rubygems-integration version.

Currently testing ubuntu:focal. Its not as easy as chaning the docker tag, a lot of dependencies changes. @vkukk you're invited to help if you want.

Brightbox have updated package ruby2.7 to 2.7.2p137 in their brightbox/ruby-ng-experimental repository. rubygems-integration also updated to 1:1.15.1-1 so we can use it for temporal use (because it is experimental...)

For testing, edit Dockerfile like this and build image by yourself:

- && echo "deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu bionic main" >> /etc/apt/sources.list \
+ && echo "deb http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu bionic main" >> /etc/apt/sources.list \

At least backup and restoring worked for me with patch I've wrote above + release 13.6.3. I'll try with 13.7.3 later.


Edit : 13.7.3 also works for me.


Edit : 13.8.4 with the patch is working for a week, daily backup. 2021-02-22

Brightbox have updated package ruby2.7 to 2.7.2p137 in their brightbox/ruby-ng-experimental repository. rubygems-integration also updated to 1:1.15.1-1 so we can use it for temporal use (because it is experimental...)

For testing, edit Dockerfile like this and build image by yourself:

- && echo "deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu bionic main" >> /etc/apt/sources.list \
+ && echo "deb http://ppa.launchpad.net/brightbox/ruby-ng-experimental/ubuntu bionic main" >> /etc/apt/sources.list \

Backup is also working for me with this change. All warnings and errors are gone. Tested with Gitlab 13.6.3.

Was this page helpful?
0 / 5 - 0 ratings