Skip to content

Fix crash when LDAP CA file set outside tls_options

What does this MR do and why?

This backports !127290 (merged) to 16-2-stable-ee.

Previously if ldap_servers.ca_file were set instead of ldap_servers.tls_options.ca_file, the changes in !122888 (merged) would flag the call to Gitlab::Options#delete.

Unfortunately, the introduction of Gitlab::ErrorTracking.track_and_raise_for_dev_exception in !124396 (merged) caused the process to crash with an undefined devise method in the User module. This happened because the method attempted to load the User for the application context, but since Devise is initialized in 8_devise.rb, this came too late for the LDAP config parsing in 1_settings.rb.

To avoid this error, avoid loading the ApplicationContext by using Gitlab::AppJsonLogger.

Relates to #419485 (closed)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The original MR has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • This MR has a severity label assigned (if applicable).
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:package-and-test-ee job has either succeeded or been approved by a Software Engineer in Test.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Stan Hu

Merge request reports

Loading