{"record":{"id":"f110d13a148098de","repo":"quickwit-oss/quickwit","slug":"path-based-file-sources-are-limited-to-a-local-usa","errorCode":null,"errorMessage":"path based file sources are limited to a local usage, please use the CLI command `quickwit tool local-ingest` to ingest data from a specific file or setup a notification based file source","messagePattern":"path based file sources are limited to a local usage, please use the CLI command `quickwit tool local-ingest` to ingest data from a specific file or setup a notification based file source","errorType":"validation","errorClass":"IndexServiceError","httpStatus":400,"severity":"error","filePath":"quickwit/quickwit-serve/src/index_api/source_resource.rs","lineNumber":60,"sourceCode":"        .and(warp::post())\n        .and(extract_config_format())\n        .and(warp::body::content_length_limit(1024 * 1024))\n        .and(warp::filters::body::bytes())\n        .and(with_arg(index_service))\n        .then(create_source)\n        .map(log_failure(\"failed to create source\"))\n        .and(extract_format_from_qs())\n        .map(into_rest_api_response)\n        .boxed()\n}\n\n#[allow(clippy::result_large_err)]\nfn check_source_type(source_params: &SourceParams) -> Result<(), IndexServiceError> {\n    // Note: This check is performed here instead of the source config serde\n    // because many tests use the file source, and can't store that config in\n    // the metastore without going through the validation.\n    if let SourceParams::File(FileSourceParams::Filepath(_)) = source_params {\n        return Err(IndexServiceError::InvalidConfig(anyhow::anyhow!(\n            \"path based file sources are limited to a local usage, please use the CLI command \\\n             `quickwit tool local-ingest` to ingest data from a specific file or setup a \\\n             notification based file source\"\n        )));\n    }\n    Ok(())\n}\n\n#[utoipa::path(\n    post,\n    tag = \"Sources\",\n    path = \"/indexes/{index_id}/sources\",\n    request_body = VersionedSourceConfig,\n    responses(\n        // We return `VersionedSourceConfig` as it's the serialized model view.\n        (status = 200, description = \"Successfully created source.\", body = VersionedSourceConfig)\n    ),\n    params(","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-serve/src/index_api/source_resource.rs#L42-L78","documentation":"The Quickwit server rejects source configs that use the file source with a filepath parameter. Path-based file sources only work for local, single-node usage via the CLI (quickwit tool local-ingest); through the server API they are disallowed to avoid nondeterministic reads on distributed deployments. The check is applied on create and update source endpoints.","triggerScenarios":"POST /indexes/{index_id}/sources or PUT .../sources with a source config whose source_params is {file: {filepath: ...}}.","commonSituations":"Migrating a locally tested file source config to a server deployment; following older tutorials/examples that used file sources over the API; copy-pasting a CLI-only source config into an API call.","solutions":["Use `quickwit tool local-ingest` to ingest directly from the local file instead of creating a server source.","Switch to a notification-based source (e.g. Kafka, Kinesis, SNS/SQS, GCP Pub/Sub) that pushes data to Quickwit.","If files land in object storage, use an appropriate supported source or ingestion via the ingest API."],"exampleFix":"// before\nsource_params:\n  file:\n    filepath: /var/log/data.json\n// after (e.g. SQS notification source)\nsource_params:\n  sqs:\n    queue_url: https://sqs.us-east-1.amazonaws.com/123/my-queue","handlingStrategy":"validation","validationCode":"fn uses_path_file_source(source_config: &serde_yaml::Value) -> bool {\n    source_config[\"source_params\"][\"file\"][\"filepath\"].as_str().is_some()\n}","typeGuard":"fn is_api_rejected_source(params: &SourceParams) -> bool {\n    matches!(params, SourceParams::File(FileSourceParams::Filepath(_)))\n}","tryCatchPattern":"match client.create_source(index_id, source_config).await {\n    Err(e) if e.to_string().contains(\"path based file sources\") => {\n        Err(anyhow!(\"use `quickwit tool local-ingest` or a notification-based source\"))\n    }\n    r => r,\n}","preventionTips":["Never create file/filepath sources through the server API","Use local-ingest CLI for local file ingestion","Use Kafka/Kinesis/SQS/Pub/Sub sources for server deployments"],"tags":["rust","rest-api","sources","file-source","config"],"backgroundTag":"unsupported-config-value","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}