{"record":{"id":"439861a0746c16bd","repo":"fluent/fluentd","slug":"missing-match-sections-in-label-context-se","errorCode":null,"errorMessage":"Missing <match> sections in <label #{@context}> section","messagePattern":"Missing <match> sections in <label #(.+?)> section","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/label.rb","lineNumber":34,"sourceCode":"\nrequire 'fluent/agent'\n\nmodule Fluent\n  class Label < Agent\n    def initialize(name, log:)\n      super(log: log)\n\n      @context = name\n      @root_agent = nil\n    end\n\n    attr_accessor :root_agent\n\n    def configure(conf)\n      super\n\n      if conf.elements('match').size == 0\n        raise ConfigError, \"Missing <match> sections in <label #{@context}> section\"\n      end\n    end\n\n    def emit_error_event(tag, time, record, e)\n      @root_agent.emit_error_event(tag, time, record, e)\n    end\n\n    def handle_emits_error(tag, es, e)\n      @root_agent.handle_emits_error(tag, es, e)\n    end\n  end\nend\n","sourceCodeStart":16,"sourceCodeEnd":47,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/label.rb#L16-L47","documentation":"A <label NAME> section is an isolated routing namespace: events enter via <filter> chains and must exit through at least one <match> output owned by the label. Label#configure counts conf.elements('match') and raises this ConfigError when the label contains none (e.g. only filters, or is empty). Fluentd rejects the config at startup rather than silently dropping the label's events.","triggerScenarios":"<label @ERROR> holding only a <filter> for error-event rewriting with no output; refactoring that moved the <match> out of a label; a label added as a placeholder without content.","commonSituations":"Building error-handling pipelines (@ERROR, @ROOT labels) and forgetting the terminal output; splitting large configs into snippets where the match lands in the wrong file; copy-paste of a filter-only label template.","solutions":["Add a <match **> (or a narrower pattern) with an output plugin inside the label","For @ERROR labels, terminate with a stdout/file/forward output so errors are visible","Remove the label entirely if you no longer route events into it","Verify label nesting: matches must be direct children of the <label>, not of a nested section"],"exampleFix":"# before\n<label @ERROR>\n  <filter **>\n    @type record_transformer\n    <record>\n      hostname ${hostname}\n    </record>\n  </filter>\n</label>\n\n# after\n<label @ERROR>\n  <filter **>\n    @type record_transformer\n    <record>\n      hostname ${hostname}\n    </record>\n  </filter>\n  <match **>\n    @type stdout\n  </match>\n</label>","handlingStrategy":"validation","validationCode":"# Static config check before deploy\nrequire 'fluent/config/parser'\nconf = Fluent::Config.parse(path, 'fluent.conf', Dir.pwd, true)\nconf.elements('label').each do |l|\n  abort \"label #{l.arg} has no <match>\" if l.elements('match').empty?\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["End every <label> with a catch-all <match **> output","Lint label sections in CI with a config dry-run (fluentd --dry-run -c)","Keep each label's filters and its terminal match in the same config snippet"],"tags":["fluentd","config","label","routing"],"backgroundTag":"missing-config-section","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}