sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.87k stars 2.14k forks source link

mail_room doesn't start with Ruby 3.2.x #2981

Open ibaranov91 opened 1 month ago

ibaranov91 commented 1 month ago

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