{"record":{"id":"5c0d15d7daa4e580","repo":"fluent/fluentd","slug":"e-message","errorCode":null,"errorMessage":"e.message","messagePattern":"e\\.message","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/in_exec.rb","lineNumber":77,"sourceCode":"          if subsection.has_key?('time_format')\n            subsection['time_type'] ||= 'string'\n          end\n        end\n      end\n\n      super\n\n      if !@tag && (!@extract_config || !@extract_config.tag_key)\n        raise Fluent::ConfigError, \"'tag' or 'tag_key' option is required on exec input\"\n      end\n      validate_encoding(@encoding) if @encoding\n      @parser = parser_create\n    end\n\n    def validate_encoding(encoding)\n      Encoding.find(encoding)\n    rescue ArgumentError => e\n      raise Fluent::ConfigError, e.message\n    end\n\n    def multi_workers_ready?\n      true\n    end\n\n    def start\n      super\n\n      options = { mode: [@connect_mode] }\n      options[:external_encoding] = @encoding if @encoding\n\n      if @run_interval\n        child_process_execute(:exec_input, @command, interval: @run_interval, wait_timeout: @command_timeout, **options, &method(:run))\n      else\n        child_process_execute(:exec_input, @command, immediate: true, wait_timeout: @command_timeout, **options, &method(:run))\n      end\n    end","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/in_exec.rb#L59-L95","documentation":"in_exec's optional encoding param is validated by Encoding.find(encoding); Ruby raises ArgumentError for any name that does not map to a registered encoding (e.g. 'unknown encoding name - utf88'), and validate_encoding re-raises that message verbatim as Fluent::ConfigError. The value becomes the external encoding of the spawned command's stdin/stdout pipes, so it must be a real Ruby encoding name (UTF-8, EUC-JP, Windows-31J, ...).","triggerScenarios":"Setting encoding to a locale-style string ('en_US.UTF-8'), a typo ('utf8x', 'UTF--8'), or an unregistered alias in an in_exec source; the ArgumentError message from Encoding.find becomes the ConfigError text shown.","commonSituations":"Copy-pasting locale environment values into encoding; assuming iconv/codepage names ('cp1252' works but 'windows-1252x' style typos do not); command output in a legacy Japanese encoding configured with a wrong alias.","solutions":["Use a name Ruby's Encoding.find accepts: ruby -e 'puts Encoding.list.map(&:to_s)' to list valid ones.","For locale strings, strip to the encoding part only (UTF-8 out of en_US.UTF-8).","Run fluentd --dry-run to fail fast at config load rather than at runtime."],"exampleFix":"# before\n<source>\n  @type exec\n  command /opt/scripts/dump.sh\n  encoding en_US.UTF-8\n</source>\n# after\n<source>\n  @type exec\n  command /opt/scripts/dump.sh\n  encoding UTF-8\n</source>","handlingStrategy":"validation","validationCode":"# preflight: validate the encoding name exactly as in_exec will\nEncoding.find('UTF-8') # raises ArgumentError for invalid names\n# programmatic check for a config value:\nbegin\n  Encoding.find(candidate_encoding)\nrescue ArgumentError\n  abort \"invalid encoding for in_exec: #{candidate_encoding}\"\nend","typeGuard":"->(name) { name.is_a?(String) && (Encoding.find(name) rescue nil) }","tryCatchPattern":"begin\n  Fluent::Plugin.new_input('exec').configure(conf)\nrescue Fluent::ConfigError => e\n  abort \"exec input config rejected: #{e.message}\" # e.g. 'unknown encoding name - en_US.UTF-8'\nend","preventionTips":["Pick encoding names from ruby -e 'puts Encoding.list.map(&:to_s)'.","Do not paste locale strings (en_US.UTF-8) into encoding; use the encoding part only.","Dry-run the config to fail at load time instead of during pipeline start."],"tags":["fluentd","ruby","exec-input","encoding","configuration"],"backgroundTag":"invalid-encoding-name","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}