{"record":{"id":"a82283f23a84fe91","repo":"fluent/fluentd","slug":"unknown-key","errorCode":"unknown_key","errorMessage":"`#{key}` doesn't exist in counter","messagePattern":"`#(.+?)` doesn't exist in counter","errorType":"exception","errorClass":"Fluent::Counter::UnknownKey","httpStatus":null,"severity":"warning","filePath":"lib/fluent/counter/store.rb","lineNumber":87,"sourceCode":"\n      def stop\n        @storage.save\n      end\n\n      def init(key, data, ignore: false)\n        ret = if v = get(key)\n                raise InvalidParams.new(\"#{key} already exists in counter\") unless ignore\n                v\n              else\n                @storage.put(key, build_value(data))\n              end\n\n        build_response(ret)\n      end\n\n      def get(key, raise_error: false, raw: false)\n        ret = if raise_error\n                @storage.get(key) or raise UnknownKey.new(\"`#{key}` doesn't exist in counter\")\n              else\n                @storage.get(key)\n              end\n        if raw\n          ret\n        else\n          ret && build_response(ret)\n        end\n      end\n\n      def key?(key)\n        !!@storage.get(key)\n      end\n\n      def delete(key)\n        ret = @storage.delete(key) or raise UnknownKey.new(\"`#{key}` doesn't exist in counter\")\n        build_response(ret)\n      end","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/counter/store.rb#L69-L105","documentation":"When fluentd starts, Supervisor#configure (lib/fluent/supervisor.rb:804) checks the --inline-config/-i option: the special value '-' means 'read the extra config directives from STDIN'. This usage is deprecated (fluentd issue #2711) because STDIN is not reliably available - Windows services, daemonized processes, and process supervisors detach or redirect stdin, so config silently comes back empty and startup breaks. The warning is emitted before Fluent::Config.build merges @inline_config as additional_config on top of the main config file.","triggerScenarios":"Starting fluentd with `-i -` (or `--inline-config -`, or `--inline-config=-`) and piping config text on stdin, e.g. `fluentd -c fluent.conf -i - < extra.conf`. Any wrapper/launcher that sets inline_config to the literal string '-' hits the branch at supervisor.rb:804-807.","commonSituations":"Legacy deployment scripts or CI pipelines that pipe an extra config snippet into fluentd; migrating a setup to td-agent running as a Windows service (where stdin is detached and STDIN.read returns nothing); container init scripts that worked with old fluentd versions.","solutions":["Stop piping config via stdin: concatenate the snippets into a real file and start with it, e.g. `cat fluent.conf extra.conf > merged.conf && fluentd -c merged.conf`.","Pass the inline config text directly in the option value instead of '-', e.g. `fluentd -c fluent.conf -i '<match **>@type null</match>'`.","If you really need stdin for the whole config, use `fluentd -c /dev/stdin < full.conf` (on Unix-like systems) instead of `-i -`.","Remove any '-' default for inline_config in wrapper scripts/service definitions (td-agent.conf / systemd unit / NSSM arguments)."],"exampleFix":"# before\nfluentd -c fluent.conf -i - < extra.conf\n\n# after\ncat fluent.conf extra.conf > /tmp/merged.conf && fluentd -c /tmp/merged.conf","handlingStrategy":"validation","validationCode":"# launcher script: reject the deprecated stdin form before invoking fluentd\nif printf '%s\\n' \"$@\" | grep -qE '(^|[ =])(-i|--inline-config)(=|-)$'; then\n  echo \"ERROR: inline_config '-' is deprecated; use -c <file> or pass config text to -i\" >&2\n  exit 1\nfi\nexec fluentd \"$@\"","typeGuard":"def fluentd_inline_config?(value)\n  value.is_a?(String) && !value.strip.empty? && value.strip != '-'\nend\n\nraise ArgumentError, \"inline_config '-' is deprecated (fluentd#2711)\" unless fluentd_inline_config?(inline_config)","tryCatchPattern":"# Not an exception - it is a $log.warn during configure; nothing to rescue.\n# Guard at the process boundary instead: detect '-' before launch and fail fast with a clear message.","preventionTips":["Never pipe config into fluentd via stdin; keep config in files under version control.","When embedding small snippets, pass them directly: -i '<match **>@type null</match>'.","Lint deployment scripts / service definitions for `-i -` and `-i-` patterns in CI.","For full-config stdin scenarios prefer `fluentd -c /dev/stdin`."],"tags":["deprecation","configuration","stdin","cli","fluentd"],"backgroundTag":"deprecated-cli-option","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}