{"record":{"id":"f5148df89c8fc547","repo":"fluent/fluentd","slug":"system-is-duplicated-system-should-be-only-on","errorCode":null,"errorMessage":"<system> is duplicated. <system> should be only one","messagePattern":"<system> is duplicated\\. <system> should be only one","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/system_config.rb","lineNumber":132,"sourceCode":"\n    config_section :source_only_buffer, init: true, multi: false do\n      config_param :flush_thread_count, :integer, default: 1\n      config_param :overflow_action, :enum, list: [:throw_exception, :block, :drop_oldest_chunk], default: :drop_oldest_chunk\n      config_param :path, :string, default: nil\n      config_param :flush_interval, :time, default: nil\n      config_param :chunk_limit_size, :size, default: nil\n      config_param :total_limit_size, :size, default: nil\n      config_param :compress, :enum, list: [:text, :gzip], default: nil\n    end\n\n    def force_stacktrace_level?\n      @log.forced_stacktrace_level != :none\n    end\n\n    def self.create(conf, strict_config_value=false)\n      systems = conf.elements(name: 'system')\n      return SystemConfig.new if systems.empty?\n      raise Fluent::ConfigError, \"<system> is duplicated. <system> should be only one\" if systems.size > 1\n\n      SystemConfig.new(systems.first, strict_config_value)\n    end\n\n    def self.blank_system_config\n      Fluent::Config::Element.new('<SYSTEM>', '', {}, [])\n    end\n\n    def self.overwrite_system_config(hash)\n      older = defined?($_system_config) ? $_system_config : nil\n      begin\n        $_system_config = SystemConfig.new(Fluent::Config::Element.new('system', '', hash, []))\n        yield\n      ensure\n        $_system_config = older\n      end\n    end\n","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/system_config.rb#L114-L150","documentation":"Fluent::ConfigError raised by SystemConfig.create (lib/fluent/system_config.rb:132) when the top-level configuration contains more than one <system> element. Fluentd requires exactly zero or one <system> block because it holds global process settings (workers, root_dir, log level) that cannot be merged.","triggerScenarios":"A fluent.conf containing two or more <system>...</system> elements — commonly the result of concatenating config snippets, using @include on files that each carry their own <system> block, or pasting a second block while editing.","commonSituations":"Composing a config from multiple @include'd fragments where each fragment was self-contained with its own <system>; upgrading tutorials that append a new <system> for log settings while the old one for workers remains; config-generator tools emitting a <system> block into both the main file and an included file.","solutions":["Search the effective config for all <system> occurrences: grep -n '<system' fluent.conf and every included file (fluentd --dry-run -c fluent.conf also shows the merged config)","Merge the settings from the duplicate blocks into a single <system> element","If you use @include, ensure only one included file (or the main file) defines <system>, and keep the others free of it"],"exampleFix":"# before\n<system>\n  workers 4\n</system>\n<system>\n  log_level info\n</system>\n\n# after\n<system>\n  workers 4\n  log_level info\n</system>","handlingStrategy":"validation","validationCode":"require 'fluent/config'\n\nconf = Fluent::Config.parse(File.read('fluent.conf'), 'fluent.conf', Dir.pwd, true)\nsystems = conf.elements(name: 'system')\nraise 'multiple <system> blocks found' if systems.size > 1\n# cheaper textual check across includes:\n#   grep -c '<system>' fluent.conf included/*.conf  # each file: 0 or 1, total <= 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep <system> only in the top-level fluent.conf; never in @include fragments","Run fluentd --dry-run in CI for every config change","Lint concatenated snippets for duplicate section headers before deploy"],"tags":["fluentd","configuration","system-config","duplicate","startup"],"backgroundTag":"duplicate-config-section","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}