Skip to content

Adds redis-namespace as runtime dependency

Marc Saleiko requested to merge ms-make-redis-namespace-runtime-dependency into master

Remove unused redis-namespace gem (gitlab-org/gitlab!135344 - merged) removes redis-namespace from the GitLab app and starting mail_room fails with this error after that:

bundle exec mail_room -c ./config/mail_room.yml
#<Thread:0x000000010756ee30 /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/mailbox_watcher.rb:35 run> terminated with exception (report_on_exception is true):
<internal:/Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- redis/namespace (LoadError)
	from <internal:/Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/arbitration/redis.rb:49:in `client'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/arbitration/redis.rb:34:in `deliver?'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/mailbox.rb:108:in `deliver?'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `block in new_message_ids'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `select'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `new_message_ids'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:163:in `new_messages'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:135:in `process_mailbox'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:45:in `wait'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/mailbox_watcher.rb:37:in `block in run'
bundler: failed to load command: mail_room (/Users/msaleiko/.asdf/installs/ruby/3.1.4/bin/mail_room)
<internal:/Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- redis/namespace (LoadError)
	from <internal:/Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/arbitration/redis.rb:49:in `client'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/arbitration/redis.rb:34:in `deliver?'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/mailbox.rb:108:in `deliver?'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `block in new_message_ids'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `select'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:178:in `new_message_ids'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:163:in `new_messages'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:135:in `process_mailbox'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/imap/connection.rb:45:in `wait'
	from /Users/msaleiko/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/gitlab-mail_room-0.0.23/lib/mail_room/mailbox_watcher.rb:37:in `block in run'

There is a discussion about this issue available, where we identified two options:

  1. Readd the redis-namespace gem to GitLab (quick fix MR raised to revert the changes mentioned above)
  2. Make redis-namespace a (runtime). dependency for gitlab-mail_room (this MR). This would also mean to deviate from the upstream gem.
  3. From @schin1 I would add that we "could" drop namespace altogether. But perhaps 16.7 should focus on fixing the breakage.

Quick fix for this is to remove :namespace from config/mail_room.ymlin the GitLab project. Customers have already reported this issue Unable to start Gitlab Mailroom after updating ... (gitlab-org/gitlab#433493 - closed)

Edited by Marc Saleiko

Merge request reports