{"record":{"id":"5469b6519ac209ce","repo":"quickwit-oss/quickwit","slug":"compactor-service-enabled-but-no-compaction-client","errorCode":null,"errorMessage":"compactor service enabled but no compaction client available","messagePattern":"compactor service enabled but no compaction client available","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-serve/src/lib.rs","lineNumber":860,"sourceCode":"        )\n        .await\n        .context(\"failed to start janitor service\")?;\n        Some(janitor_service)\n    } else {\n        None\n    };\n\n    let compactor_supervisor_opt = if node_config.is_service_enabled(QuickwitService::Compactor)\n        && node_config.enable_standalone_compactors\n    {\n        let compaction_dir = node_config.data_dir_path.join(\"compaction\");\n        fs::create_dir_all(&compaction_dir)?;\n        let compaction_root_directory = quickwit_common::temp_dir::Builder::default()\n            .tempdir_in(&compaction_dir)\n            .context(\"failed to create compaction temp directory\")?;\n        let compaction_client = compaction_service_client_opt\n            .clone()\n            .expect(\"compactor service enabled but no compaction client available\");\n        let split_cache = indexing_split_cache.clone();\n        let compactor_mailbox = start_compactor_service(\n            &universe,\n            cluster.self_node_id(),\n            compaction_client,\n            &node_config.compactor_config,\n            primary_metastore_client.clone(),\n            storage_resolver.clone(),\n            split_cache,\n            event_broker.clone(),\n            compaction_root_directory,\n        )\n        .await\n        .context(\"failed to start compactor service\")?;\n        Some(compactor_mailbox)\n    } else {\n        None\n    };","sourceCodeStart":842,"sourceCodeEnd":878,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-serve/src/lib.rs#L842-L878","documentation":"When the node is configured as a compactor (compactor service enabled), serve_quickwit expects an optional compaction service client to have been created earlier. The expect enforces the invariant that an enabled compactor always has a client; None means the configuration-to-client wiring failed upstream.","triggerScenarios":"node_config.compactor_config enables the compactor but the code path that builds compaction_service_client_opt did not run or returned None (e.g. missing/garbled configuration section or a bug in client construction).","commonSituations":"Config file with compactor.enabled: true but malformed/absent compaction client settings; refactoring that reordered client initialization before the flag check.","solutions":["Review the compactor section of quickwit.yaml: it must be complete and consistent when compaction is enabled","Trace where compaction_service_client_opt is set and confirm it covers the enabled case","Validate the config with quickwit's config checker before startup","If wiring is broken after a code change, restore client construction for the enabled path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate config before starting the node:\nif node_config.compactor_config.enabled && compaction_service_client_opt.is_none() {\n    return Err(anyhow!(\"compactor enabled but compaction client missing\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the quickwit config checker on quickwit.yaml before deployment","Keep the compactor client construction adjacent to the enabled check","Add an integration test that enables compaction and asserts the client exists"],"tags":["rust","config","startup","panic","compaction"],"backgroundTag":"missing-required-config-field","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}