sameersbn / sameersbn/docker-gitlab

mail_room doesn't start with Ruby 3.2.x

Open
#2,981 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8.1k
Forks
2.1k
Avg merge
17h 47m
Merged PRs (30d)
7

Description

Hello, I've recenly had some issue with mail_room which I solved by fixing mail_room.rb.

Version: 17.2.1

Issue: Mail_room doesn't start

Errors in docker log

2024-08-06 20:20:00,274 INFO success: mail_room entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-06 20:20:00,368 INFO exited: mail_room (exit status 1; not expected)
2024-08-06 20:20:00,588 INFO spawned: 'mail_room' with pid 9838
2024-08-06 20:20:01,685 INFO success: mail_room entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-06 20:20:01,740 INFO exited: mail_room (exit status 1; not expected)
2024-08-06 20:20:02,304 INFO spawned: 'mail_room' with pid 9839
2024-08-06 20:20:03,519 INFO success: mail_room entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-08-06 20:20:03,524 INFO exited: mail_room (exit status 1; not expected)
2024-08-06 20:20:03,599 INFO spawned: 'mail_room' with pid 9841

Errors in mail_room.log

bundler: failed to load command: mail_room (/home/git/gitlab/vendor/bundle/ruby/3.2.0/bin/mail_room)
/usr/local/lib/ruby/3.2.0/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Symbol (Psych::DisallowedClass)
        from /usr/local/lib/ruby/3.2.0/psych/class_loader.rb:28:in `load'
        from (eval):2:in `symbol'
        from /usr/local/lib/ruby/3.2.0/psych/class_loader.rb:32:in `symbolize'
        from /usr/local/lib/ruby/3.2.0/psych/class_loader.rb:84:in `symbolize'

Solution was to update one line in mail_room.rb

      def load_yaml
        #@yaml ||= YAML.safe_load_file(config_file, aliases: true)[rails_env].deep_symbolize_keys
        @yaml ||= YAML.safe_load_file(config_file, aliases: true, permitted_classes: [Symbol])[rails_env].deep_symbolize_keys
      end

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open mail_room.rb and inspect load_yaml, where YAML.safe_load_file is used. Compare the Ruby 3.2 Psych::DisallowedClass error with the reported permitted_classes change. Confirm that mail_room starts successfully under Ruby 3.2 and no longer exits with the logged error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ruby
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.