{"record":{"id":"eedc0b93ba98da97","repo":"fluent/fluentd","slug":"invalid-number-of-workers-must-be-1-or-unspecifie","errorCode":null,"errorMessage":"invalid number of workers (must be 1 or unspecified) with --no-supervisor: #{@system_config.workers}","messagePattern":"invalid number of workers \\(must be 1 or unspecified\\) with --no-supervisor: #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/supervisor.rb","lineNumber":769,"sourceCode":"        supervise\n      end\n    end\n\n    def options\n      {\n        'config_path' => @config_path,\n        'pid_file' => @daemonize,\n        'plugin_dirs' => @plugin_dirs,\n        'log_path' => @log_path,\n        'root_dir' => @system_config.root_dir,\n      }\n    end\n\n    def run_worker\n      Process.setproctitle(\"worker:#{@system_config.process_name}\") if @process_name\n\n      if @standalone_worker && @system_config.workers != 1\n        raise Fluent::ConfigError, \"invalid number of workers (must be 1 or unspecified) with --no-supervisor: #{@system_config.workers}\"\n      end\n\n      if Fluent.windows? && @system_config.with_source_only\n        raise Fluent::ConfigError, \"with-source-only is not supported on Windows\"\n      end\n\n      install_main_process_signal_handlers\n\n      # This is the only log message for @standalone_worker\n      $log.info \"starting fluentd-#{Fluent::VERSION} without supervision\", pid: Process.pid, ruby: RUBY_VERSION if @standalone_worker\n\n      main_process do\n        create_socket_manager if @standalone_worker\n        if @standalone_worker\n          ServerEngine::Privilege.change(@chuser, @chgroup)\n          File.umask(@chumask.to_i(8))\n        end\n        MessagePackFactory.init(enable_time_support: @system_config.enable_msgpack_time_support)","sourceCodeStart":751,"sourceCodeEnd":787,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/supervisor.rb#L751-L787","documentation":"Fluent::ConfigError raised in Supervisor#run_worker (lib/fluent/supervisor.rb:769) when fluentd is started with --no-supervisor (standalone worker mode) while workers is configured to anything other than 1. Standalone mode has no supervisor to spawn and manage multiple worker processes, so multi-worker configuration is incompatible with it.","triggerScenarios":"Starting fluentd with the --no-supervisor command-line flag together with --workers 2 (or <system> workers 4 in the config file). Any workers value != 1 (including nil-defaulted 1 is fine) triggers the error at run_worker time, right after process title setup.","commonSituations":"Copying a production multi-worker config into a systemd unit or Docker CMD that includes --no-supervisor; migrating from supervisord-style deployment where users add --no-supervisor to avoid ServerEngine supervision but forget to remove the workers setting.","solutions":["Remove --no-supervisor from the command line if you really need multiple workers","Or set workers to 1 (or delete the workers setting) in <system> or via --workers when keeping --no-supervisor","If you intended supervised multi-process operation, drop the flag and let the supervisor manage workers"],"exampleFix":"# before\n$ fluentd --no-supervisor -c fluent.conf   # fluent.conf contains: <system> workers 4 </system>\n\n# after (option 1)\n$ fluentd -c fluent.conf                     # keep workers 4, supervised\n# after (option 2)\n$ fluentd --no-supervisor -c fluent.conf     # and change config to: <system> workers 1 </system>","handlingStrategy":"validation","validationCode":"# before launching:\nworkers = 4                      # parsed from your config <system> workers\nno_supervisor = true             # from CLI flags\nif no_supervisor && workers != 1\n  abort '--no-supervisor requires workers == 1 (remove --no-supervisor or set workers 1)'\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep deployment flags and config in one reviewed unit (systemd template / Helm values) so --no-supervisor and workers cannot drift apart","Add a CI config check: fluentd --dry-run -c fluent.conf with the production command line","Document that standalone mode is single-process by design"],"tags":["fluentd","configuration","workers","no-supervisor","startup"],"backgroundTag":"invalid-configuration","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}