instructure/canvas-lms · warning

deprecated setting sent to IncomingMessageProcessor: #

Error message

deprecated setting sent to IncomingMessageProcessor: #{key}

What it means

IncomingMessageProcessor#configure_settings validates every settings key against IncomingMailProcessor::Settings. Keys belonging to DeprecatedSettings are still accepted but this warning is logged and the value is stored separately, so callers know the setting is on its way out. Unknown keys raise outright.

Solutions

  1. Replace the deprecated key in your configuration with its current Settings equivalent
  2. Check gem changelog/docs for the renamed setting and update all environments (config files, consul, per-account overrides)
  3. Suppress nothing — fix the config; the warning exists precisely to flag stale keys
  4. Grep deployment config repos for the deprecated key name to catch every environment

Example fix

// before
IncomingMessageProcessor.configure_settings({ legacy_auth_user: 'x' }) # warns
// after
IncomingMessageProcessor.configure_settings({ auth_user: 'x' }) # current setting name
Defensive patterns

Strategy: validation

Validate before calling

# validate config keys before calling configure_settings
bad = config.keys.map(&:to_sym) - IncomingMailProcessor::Settings.members.map(&:to_sym)
raise "unknown mail settings: #{bad}" unless (bad - IncomingMailProcessor::DeprecatedSettings.members.map(&:to_sym)).empty?

Try / catch

begin
  IncomingMessageProcessor.configure_settings(config)
rescue RuntimeError => e
  raise if e.message.start_with?('unrecognized setting')
  Rails.logger.warn(e.message)
end

Prevention

When it happens

Trigger: configure_settings (called during IncomingMessageProcessor initialization) receives a config hash containing a key listed in IncomingMailProcessor::DeprecatedSettings.members (a renamed/removed legacy option) — the warning fires for that key.

Common situations: Deploy configs (e.g., incoming_mail.yml or consul-provisioned settings) still carrying old option names after a gem upgrade; environment-specific overrides that were never migrated; copy-pasted configs between environments.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/ab6db988434bde09. Report an issue: GitHub.

Appendix: source

Thrown at gems/incoming_mail_processor/lib/incoming_mail_processor/incoming_message_processor.rb:124

      end

      def get_mailbox_class(account)
        MailboxClasses.fetch(account.protocol)
      end

      def timeout_method(&)
        Canvas.timeout_protection("incoming_message_processor", raise_on_timeout: true, &)
      end

      def configure_settings(config)
        @settings = IncomingMailProcessor::Settings.new
        @deprecated_settings = IncomingMailProcessor::DeprecatedSettings.new

        config.symbolize_keys.each do |key, value|
          if IncomingMailProcessor::Settings.members.map(&:to_sym).include?(key)
            settings.send(:"#{key}=", value)
          elsif IncomingMailProcessor::DeprecatedSettings.members.map(&:to_sym).include?(key)
            logger&.warn("deprecated setting sent to IncomingMessageProcessor: #{key}")
            deprecated_settings.send(:"#{key}=", value)
          else
            raise "unrecognized setting sent to IncomingMessageProcessor: #{key}"
          end
        end
      end

      def configure_accounts(account_configs)
        flat_account_configs = flatten_account_configs(account_configs)
        self.mailbox_accounts = flat_account_configs.map do |mailbox_protocol, mailbox_config|
          error_folder = mailbox_config.delete(:error_folder)
          address = mailbox_config[:address] || mailbox_config[:username]
          IncomingMailProcessor::MailboxAccount.new({
                                                      protocol: mailbox_protocol.to_sym,
                                                      config: mailbox_config,
                                                      address:,
                                                      error_folder:,
                                                    })

View on GitHub (pinned to 1c9f0bb801)