fluent/fluentd · error · ArgumentError

Missing arguments

Error message

Missing arguments

What it means

Raised as ArgumentError by FluentPluginGenerator#parse_options!: after option parsing, the remaining argv must contain exactly two positional arguments (plugin type and plugin name). The rescue block prints the message plus the option banner and exits false, so the user sees usage instead of a stack trace.

Source

Thrown at lib/fluent/command/plugin_generator.rb:122

Generate a project skeleton for creating a Fluentd plugin

Arguments:
\ttype: #{SUPPORTED_TYPES.join(",")}
\tname: Your plugin name (fluent-plugin- prefix will be added to <name>)

Options:
BANNER

    @parser.on("--[no-]license=NAME", "Specify license name (default: Apache-2.0)") do |v|
      @license_name = v || "no-license"
    end
    @parser
  end

  def parse_options!
    @parser.parse!(@argv)
    unless @argv.size == 2
      raise ArgumentError, "Missing arguments"
    end
    @type, @name = @argv
  rescue => e
    usage("#{e.class}:#{e.message}")
  end

  def usage(message = "")
    puts message
    puts
    puts @parser.help
    exit(false)
  end

  def user_name
    v = `git config --get user.name`.chomp
    v.empty? ? "TODO: Write your name" : v
  end

View on GitHub (pinned to dd45c6e18d)

Solutions

  1. Run fluent-plugin-generator <type> <name>, e.g. fluent-plugin-generator output my_plugin
  2. Use one of the supported types: input, output, filter, parser, formatter, storage
  3. Check fluent-plugin-generator --help for options like --[no-]license before the positional arguments

Example fix

# before
fluent-plugin-generator output

# after
fluent-plugin-generator output my_plugin
Defensive patterns

Strategy: validation

Validate before calling

usage = 'fluent-plugin-generator <type> <name>'
abort usage unless ARGV.length == 2
abort 'type must be input/output/filter/parser/formatter/storage' unless %w[input output filter parser formatter storage].include?(ARGV[0])

Prevention

When it happens

Trigger: Running fluent-plugin-generator with no arguments, only one (fluent-plugin-generator output), or three or more; quoting mistakes that split or merge the two arguments.

Common situations: First-time use of the generator; wrapper scripts passing optional/empty arguments; forgetting that --license=NAME is an option, not a positional.

Related errors


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