{"record":{"id":"24cabe0e05b368bf","repo":"quickwit-oss/quickwit","slug":"ingest-api-service-with-queues-directory-located-a","errorCode":null,"errorMessage":"ingest API service with queues directory located at `{}` is not initialized","messagePattern":"ingest API service with queues directory located at `(.+?)` is not initialized","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-ingest/src/lib.rs","lineNumber":92,"sourceCode":"        format!(\n            \"failed to open the ingest API record log located at `{}`\",\n            queues_dir_path.display()\n        )\n    })?;\n    let (ingest_api_service, _ingest_api_handle) = universe.spawn_builder().spawn(ingest_api_actor);\n    guard.insert(queues_dir_path.to_path_buf(), ingest_api_service.clone());\n    Ok(ingest_api_service)\n}\n\n/// Returns the instance of the single IngestApiService via a copy of its Mailbox.\npub async fn get_ingest_api_service(\n    queues_dir_path: &Path,\n) -> anyhow::Result<Mailbox<IngestApiService>> {\n    let guard = INGEST_API_SERVICE_MAILBOXES.lock().await;\n    if let Some(mailbox) = guard.get(queues_dir_path) {\n        return Ok(mailbox.clone());\n    }\n    bail!(\n        \"ingest API service with queues directory located at `{}` is not initialized\",\n        queues_dir_path.display()\n    )\n}\n\n/// Starts an [`IngestApiService`] instance at `<data_dir_path>/queues`.\npub async fn start_ingest_api_service(\n    universe: &Universe,\n    data_dir_path: &Path,\n    config: &IngestApiConfig,\n) -> anyhow::Result<Mailbox<IngestApiService>> {\n    let queues_dir_path = data_dir_path.join(QUEUES_DIR_NAME);\n    init_ingest_api(universe, &queues_dir_path, config).await\n}\n\n#[cfg(test)]\nmod tests {\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-ingest/src/lib.rs#L74-L110","documentation":"Ingest API service mailboxes are registered globally per queues directory path. get_ingest_api_service bails when no IngestApiService instance has been started for the given queues_dir_path — you are asking for a service lookup before (or without) the service being initialized at that data dir.","triggerScenarios":"Calling get_ingest_api_service(queues_dir_path) when start_ingest_api_service was never called for that exact path, or was called with a different data dir path string.","commonSituations":"Calling ingest/ingest-status APIs on a searcher node that does not run the ingest service; mismatched or default data dir between service startup and lookup; service crashed/stopped before the lookup.","solutions":["Start the ingest API service (start_ingest_api_service with the same data dir) before looking it up.","Ensure the querying node is configured to run the ingest service (role/config), or route ingest requests to an indexer node.","Verify queues_dir_path matches exactly (same data dir) between startup and lookup."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match get_ingest_api_service(&data_dir_path).await {\n    Ok(mailbox) => mailbox,\n    Err(_) => {\n        // service not started on this node: start it or route the request to a node that runs it\n        start_ingest_api_service(quickwit_config).await?;\n        get_ingest_api_service(&data_dir_path).await?\n    }\n}","preventionTips":["Ensure ingest APIs are only called on nodes where the ingest service is enabled.","Use a single shared data dir constant so startup and lookup paths match.","Check service health/registration before sending ingest requests."],"tags":["ingest","service-initialization","rust"],"backgroundTag":"module-init-failed","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"}