{"record":{"id":"778e9632bd04e86f","repo":"fluent/fluentd","slug":"in-chunk-keys-e-message","errorCode":null,"errorMessage":"in chunk_keys: #{e.message}","messagePattern":"in chunk_keys: #(.+?)","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":321,"sourceCode":"          # When @buffering.nil?, @buffer_config was initialized with default value for all parameters.\n          # If so, this configuration MUST success.\n          @chunk_keys = @buffer_config.chunk_keys.dup\n          @chunk_key_time = !!@chunk_keys.delete('time')\n          @chunk_key_tag = !!@chunk_keys.delete('tag')\n          if @chunk_keys.any? { |key|\n              begin\n                k = Fluent::PluginHelper::RecordAccessor::Accessor.parse_parameter(key)\n                if k.is_a?(String)\n                  k !~ CHUNK_KEY_PATTERN\n                else\n                  if key.start_with?('$[')\n                    raise Fluent::ConfigError, \"in chunk_keys: bracket notation is not allowed\"\n                  else\n                    false\n                  end\n                end\n              rescue => e\n                raise Fluent::ConfigError, \"in chunk_keys: #{e.message}\"\n              end\n            }\n            raise Fluent::ConfigError, \"chunk_keys specification includes invalid char\"\n          else\n            @chunk_key_accessors = Hash[@chunk_keys.map { |key| [key.to_sym, Fluent::PluginHelper::RecordAccessor::Accessor.new(key)] }]\n          end\n\n          if @chunk_key_time\n            raise Fluent::ConfigError, \"<buffer ...> argument includes 'time', but timekey is not configured\" unless @buffer_config.timekey\n            Fluent::Timezone.validate!(@buffer_config.timekey_zone)\n            @timekey_zone = @buffer_config.timekey_use_utc ? '+0000' : @buffer_config.timekey_zone\n            @timekey = @buffer_config.timekey\n            if @timekey <= 0\n              raise Fluent::ConfigError, \"timekey should be greater than 0. current timekey: #{@timekey}\"\n            end\n            @timekey_use_utc = @buffer_config.timekey_use_utc\n            @offset = Fluent::Timezone.utc_offset(@timekey_zone)\n            @calculate_offset = @offset.respond_to?(:call) ? @offset : nil","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L303-L339","documentation":"This is a wrapper error: while validating chunk keys, `Fluent::PluginHelper::RecordAccessor::Accessor.parse_parameter(key)` raised an exception, and output.rb re-raises it prefixed with `in chunk_keys:`. It means the chunk key is not valid record-accessor syntax at all (malformed dot notation, dangling separators, stray characters).","triggerScenarios":"Chunk keys like `$.` (dangling dot), `$.foo..bar`, `$.foo[` (unbalanced bracket), or any key string that `parse_parameter` cannot tokenize — the rescue at output.rb:320 catches the parse exception and re-raises its message with the prefix.","commonSituations":"Hand-written buffer sections with typos; keys generated from templates or environment variables that leave artifacts (`.`, `$`, empty segments); copy/paste from docs where a placeholder was only partially replaced.","solutions":["Fix the accessor syntax: `$.field` or `$.nested.field` for nested keys, plain `field` for top-level keys","Use a plain top-level key name when the value is not nested","Verify the exact key string with `fluentd --dry-run` before deploying"],"exampleFix":"# before\n<buffer $.logs..app_id>\n  @type file\n</buffer>\n\n# after\n<buffer $.logs.app_id>\n  @type file\n</buffer>","handlingStrategy":"validation","validationCode":"fluentd --dry-run -c /etc/fluent/fluent.conf\n# Optionally pre-validate keys in Ruby:\n# Fluent::PluginHelper::RecordAccessor::Accessor.parse_parameter('$.a.b') rescue puts 'bad key'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid hand-typing accessors; generate them from field paths","Check for dangling dots (`$.`, `..`) and unbalanced brackets when templating keys","Keep chunk keys as simple top-level field names where possible"],"tags":["fluentd","buffer","chunk-keys","record-accessor"],"backgroundTag":"config-validation-failed","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}