{"record":{"id":"1a504ecc5cb3d290","repo":"fluent/fluentd","slug":"unknown-feature-for-parser-plugin-feature","errorCode":null,"errorMessage":"Unknown feature for parser plugin: #{feature}","messagePattern":"Unknown feature for parser plugin: #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/parser.rb","lineNumber":169,"sourceCode":"      rescue UncatchableError\n        log.warn \"parsing timed out with #{self.class}: text = #{text}\"\n        # Return nil instead of raising error. in_tail or other plugin can emit broken line.\n        yield nil, nil\n      end\n\n      def call(*a, &b)\n        # Keep backward compatibility for existing plugins\n        # TODO: warn when deprecated\n        parse(*a, &b)\n      end\n\n      def implement?(feature)\n        methods_of_plugin = self.class.instance_methods(false)\n        case feature\n        when :parse_io then methods_of_plugin.include?(:parse_io)\n        when :parse_partial_data then methods_of_plugin.include?(:parse_partial_data)\n        else\n          raise ArgumentError, \"Unknown feature for parser plugin: #{feature}\"\n        end\n      end\n\n      def parse_io(io, &block)\n        raise NotImplementedError, \"Optional API #parse_io is not implemented\"\n      end\n\n      def parse_partial_data(data, &block)\n        raise NotImplementedError, \"Optional API #parse_partial_data is not implemented\"\n      end\n\n      def parse_time(record)\n        if @time_key && record.respond_to?(:has_key?) && record.has_key?(@time_key)\n          src = if @keep_time_key\n                  record[@time_key]\n                else\n                  record.delete(@time_key)\n                end","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/parser.rb#L151-L187","documentation":"Parser#implement?(feature) (lib/fluent/plugin/parser.rb:169) is the feature-detection API for optional parser capabilities. It only knows exactly two symbols — :parse_io and :parse_partial_data — and raises ArgumentError for anything else. Inputs like in_exec and out_exec_filter branch on these flags, so passing an unrecognized symbol is a programming error (often a typo or a feature name from a different fluentd version).","triggerScenarios":"Calling parser.implement?(:parseIO), :partial_data, :parse_stream, or any string instead of a symbol; a plugin written against a newer fluentd probing a feature name this version does not define; using the Output plugin's implement? vocabulary (:synchronous, :buffered, :delayed_commit, :custom_format) on a parser instance.","commonSituations":"Custom input plugins copying feature-detection code from other plugin helper families; typos when mirroring in_exec's dispatch pattern (case @parser.implement?(:parse_io) when ... else parse); fluentd version skew where a third-party plugin probes features added later.","solutions":["Use only :parse_io or :parse_partial_data with parser plugins.","For output plugins' capabilities, call implement? on the output instance with :synchronous/:buffered/:delayed_commit/:custom_format instead.","If you must probe arbitrary features defensively, rescue ArgumentError and treat it as false.","Upgrade fluentd to the version the plugin was written for when the feature name genuinely should exist."],"exampleFix":"# before\nif parser.implement?(:parse_stream) # ArgumentError: unknown feature\n# after\nif parser.implement?(:parse_io)\n  parser.parse_io(io, &callback)\nelsif parser.implement?(:parse_partial_data)\n  parser.parse_partial_data(io.readpartial(4096), &callback)\nend","handlingStrategy":"validation","validationCode":"PARSER_FEATURES = %i[parse_io parse_partial_data].freeze\nunless PARSER_FEATURES.include?(feature)\n  log.warn \"unknown parser feature #{feature}; skipping\"\n  return false\nend\nparser.implement?(feature)","typeGuard":"def known_parser_feature?(f)\n  %i[parse_io parse_partial_data].include?(f)\nend","tryCatchPattern":"rescue ArgumentError\n  false # unknown feature on this fluentd version; treat as unsupported\n","preventionTips":["Only probe :parse_io / :parse_partial_data on parsers.","Freeze a feature whitelist constant in your plugin and check against it.","Pin the fluentd version your plugin targets so feature vocabularies match."],"tags":["fluentd","parser-plugin","argument-validation","feature-detection"],"backgroundTag":"unsupported-feature-check","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}