Skip to content

Unable to start Gitlab Mailroom after updating from the v16.5.1 to the v16.6.1

Hello,

I administrate a bunch of Gitlab installed from sources.

Last Friday, I updated my instance pool from v16.5.1 to v16.6.1.

And all gitlab-mailroom 0.0.23 service crashed.

bundle list | grep mail_room
  * gitlab-mail_room (0.0.23)

The error is

Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/arbitration/redis.rb:49:in `client'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/arbitration/redis.rb:34:in `deliver?'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/mailbox.rb:108:in `deliver?'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `block in new_message_ids'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `select'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `new_message_ids'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:163:in `new_messages'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:135:in `process_mailbox'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:45:in `wait'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]:         from /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/mailbox_watcher.rb:37:in `block in run'
Dec 04 07:47:53 gitlab gitlab-mailroom[862173]: /home/git/gitlab-ee/vendor/bundle/ruby/3.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/arbitration/redis.rb:49:in `require': cannot load such file -- redis/namespace (LoadError)

Which is triggered by

namespace = options.namespace
if namespace
   require 'redis/namespace'
   ::Redis::Namespace.new(namespace, redis: redis)
else
    redis
end

It appears that this commit, remove the required gem 561e7c4d

But this configuration defines the namespace

https://gitlab.com/gitlab-org/gitlab/-/blob/v16.6.1-ee/config/mail_room.yml?ref_type=tags#L58

I recover my mailroom service by adding the line

gem 'redis-namespace', '~> 1.9.0' 

to my Gemfile and relaunch the `bundle install`

What is the canonical way to solve this dependency problem ?

I don't see any version of the gem that doesn't use the 'redis/namespace'

https://rubygems.org/gems/gitlab-mail_room

Edited by Yannick Guern