{"record":{"id":"8905206868eeee81","repo":"fluent/fluentd","slug":"i-th-element-of-sample-e-is-not-a-hash","errorCode":null,"errorMessage":"#{i}th element of sample, #{e}, is not a hash","messagePattern":"#(.+?)th element of sample, #(.+?), is not a hash","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/in_sample.rb","lineNumber":57,"sourceCode":"    desc \"If specified, each generated event has an auto-incremented key field.\"\n    config_param :auto_increment_key, :string, default: nil\n    desc \"The boolean to suspend-and-resume incremental value after restart\"\n    config_param :suspend, :bool, default: false,deprecated: 'This parameters is ignored'\n    desc \"Reuse the sample data to reduce the load when sending large amounts of data. You can enable it if filter does not do destructive change\"\n    config_param :reuse_record, :bool, default: false\n    desc \"The sample data to be generated. An array of JSON hashes or a single JSON hash.\"\n    config_param :sample, alias: :dummy, default: [{\"message\" => \"sample\"}] do |val|\n      begin\n        parsed = JSON.parse(val, Fluent::DEFAULT_JSON_PARSE_OPTIONS)\n      rescue JSON::ParserError => ex\n        # Fluent::ConfigParseError, \"got incomplete JSON\" will be raised\n        # at literal_parser.rb with --use-v1-config, but I had to\n        # take care at here for the case of --use-v0-config.\n        raise Fluent::ConfigError, \"#{ex.class}: #{ex.message}\"\n      end\n      sample = parsed.is_a?(Array) ? parsed : [parsed]\n      sample.each_with_index do |e, i|\n        raise Fluent::ConfigError, \"#{i}th element of sample, #{e}, is not a hash\" unless e.is_a?(Hash)\n      end\n      sample\n    end\n\n    def initialize\n      super\n      @storage = nil\n    end\n\n    def configure(conf)\n      super\n      @sample_index = 0\n      config = conf.elements.find{|e| e.name == 'storage' }\n      @storage = storage_create(usage: 'suspend', conf: config, default_type: DEFAULT_STORAGE_TYPE)\n    end\n\n    def multi_workers_ready?\n      true","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/in_sample.rb#L39-L75","documentation":"Error \"#{i}th element of sample, #{e}, is not a hash\" thrown in fluent/fluentd.","triggerScenarios":"Thrown at lib/fluent/plugin/in_sample.rb:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}