Rake task gitlab:incoming_email:check fails after 13.12.0 upgrade

Summary

Upon upgrade to 13.12, the change made by !58042 (merged) to the YAML loader in https://gitlab.com/gitlab-org/gitlab/blob/master/lib/system_check/incoming_email/imap_authentication_check.rb causes it to fail with the following error:

Exception: Tried to load unspecified class: Symbol

Full output:

# sudo gitlab-rake gitlab:incoming_email:check
Checking Incoming Email ...
Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... Exception: Tried to load unspecified class: Symbol

Init.d configured correctly? ... skipped
MailRoom running? ... skipped

Checking Reply by email ... Finished
Checking Incoming Email ... Finished

Discovered during customer support ticket: https://gitlab.zendesk.com/agent/tickets/214235 (internal link, only for GitLab Team Members)

(https://about.gitlab.com/handbook/support/internal-support/#viewing-support-tickets)

Steps to reproduce

Example Project

This is an instance level check/feature/config not applicable to a single project.

What is the current bug behavior?

Rake task gitlab-rake gitlab:incoming_email:check fails

What is the expected correct behavior?

Rake task gitlab-rake gitlab:incoming_email:check passes, and presents a valid output

Relevant logs and/or screenshots

# sudo gitlab-rake gitlab:incoming_email:check
Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... Exception: Tried to load unspecified class: Symbol
Init.d configured correctly? ... skipped
MailRoom running? ... skipped

Checking Reply by email ... Finished


Checking Incoming Email ... Finished

Output of checks

GitLab 13.12.0 (Omnibus packages)

Results of GitLab environment info

Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Change line in https://gitlab.com/gitlab-org/gitlab/blob/master/lib/system_check/incoming_email/imap_authentication_check.rb from:

config_file = YAML.safe_load(erb.result)

To:

config_file = YAML.safe_load(erb.result, [Symbol])

(Or another current equivalent, similar to !60251 (merged))

Edited by Harsh Chouraria