fluent/fluentd · warning

There is no discovery_manager. skip start them

Error message

There is no discovery_manager. skip start them

What it means

The service_discovery plugin helper's start checks @discovery_manager, which is built during configure when the plugin actually set up service discovery (service_discovery_configure). If it is nil — the plugin included the helper but never configured a discovery manager (no <service_discovery> sections and no explicit configure call) — start warns, calls super, and returns without starting discovery or its refresh timer. The plugin continues without dynamic service discovery.

Source

Thrown at lib/fluent/plugin_helper/service_discovery.rb:40

    module ServiceDiscovery
      include Fluent::PluginHelper::Timer

      # For the compatibility with older versions without `param_name: :service_discovery_configs`
      attr_reader :service_discovery

      def self.included(mod)
        mod.include ServiceDiscoveryParams
      end

      def configure(conf)
        super
        # For the compatibility with older versions without `param_name: :service_discovery_configs`
        @service_discovery = @service_discovery_configs
      end

      def start
        unless @discovery_manager
          log.warn('There is no discovery_manager. skip start them')
          super
          return
        end

        @discovery_manager.start
        unless @discovery_manager.static_config?
          timer_execute(@_plugin_helper_service_discovery_title, @_plugin_helper_service_discovery_interval) do
            @discovery_manager.run_once
          end
        end

        super
      end

      %i[after_start stop before_shutdown shutdown after_shutdown close terminate].each do |mth|
        define_method(mth) do
          @discovery_manager&.__send__(mth)
          super()

View on GitHub (pinned to dd45c6e18d)

Solutions

  1. If dynamic discovery is not used, remove the include of the ServiceDiscovery helper (or accept the harmless warning).
  2. If discovery is expected, ensure service_discovery_configure(...) is called in the plugin's configure and that <service_discovery> sections are present in the config.
  3. For out_forward users, provide at least one <server> or <service_discovery> block so configuration is complete.

Example fix

# before (helper included but never configured -> warning on start)
class MyOutput < Fluent::Plugin::Output
  Fluent::Plugin.register_output('my_out', self)
  helpers :service_discovery
  # configure never calls service_discovery_configure
end

# after
class MyOutput < Fluent::Plugin::Output
  Fluent::Plugin.register_output('my_out', self)
  helpers :service_discovery

  def configure(conf)
    super
    service_discovery_configure(:my_out_service_discovery) do
      # discovery entries...
    end
  end
end
Defensive patterns

Strategy: validation

Validate before calling

# In plugin tests: assert the discovery manager was built before start runs
plugin.configure(conf)
raise 'service discovery configured but manager missing' if conf.has_key?('service_discovery') && plugin.instance_variable_get(:@discovery_manager).nil?

Prevention

When it happens

Trigger: A custom plugin includes Fluent::PluginHelper::ServiceDiscovery but its configure phase never calls service_discovery_configure / defines service_discovery_sections, so @discovery_manager stays nil when start runs.

Common situations: Plugin authors including every helper by habit; plugins where service discovery is optional and only configured via <service_discovery> blocks that the user omitted.

Related errors


AI-assisted analysis of fluent/fluentd@dd45c6e18d (2026-08-21). Data as JSON: /api/errors/0740396441f4deb8. Report an issue: GitHub.