{"record":{"id":"8a6ff026b44c2946","repo":"quickwit-oss/quickwit","slug":"source-type-cannot-be-updated","errorCode":null,"errorMessage":"source type {} cannot be updated","messagePattern":"source type (.+?) cannot be updated","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/source_config/mod.rs","lineNumber":294,"sourceCode":"                SourceParams::File(FileSourceParams::Notifications(new)),\n            ) => current.validate_update(new),\n            (SourceParams::Kafka(current), SourceParams::Kafka(new)) => {\n                current.validate_update(new)\n            }\n            (SourceParams::Kinesis(current), SourceParams::Kinesis(new)) => {\n                current.validate_update(new)\n            }\n            (SourceParams::PubSub(current), SourceParams::PubSub(new)) => {\n                current.validate_update(new)\n            }\n            (SourceParams::Pulsar(current), SourceParams::Pulsar(new)) => {\n                current.validate_update(new)\n            }\n            (current, new) if current.source_type() != new.source_type() => Err(anyhow::anyhow!(\n                \"source type cannot be changed, current type {}\",\n                current.source_type(),\n            )),\n            _ => Err(anyhow::anyhow!(\n                \"source type {} cannot be updated\",\n                self.source_type(),\n            )),\n        }\n    }\n}\n\n#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize, utoipa::ToSchema)]\n#[serde(rename_all = \"snake_case\")]\npub enum FileSourceMessageType {\n    /// See <https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-content-structure.html>\n    S3Notification,\n    /// A string with the URI of the file (e.g `s3://bucket/key`)\n    RawUri,\n}\n\n#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize, Deserialize, utoipa::ToSchema)]\npub struct FileSourceSqs {","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/source_config/mod.rs#L276-L312","documentation":"SourceConfig::validate_update's catch-all arm: when source types match but the specific SourceParams variant has no dedicated update validator (e.g. file, ingest, or void sources whose params are not updatable), the update is rejected with this message naming the current source type.","triggerScenarios":"Calling the source update API/CLI on a source whose type does not support parameter updates (its SourceParams variant has no validate_update implementation, falling to `_ =>`), even with the same type on both sides.","commonSituations":"Trying to edit an ingest or file source's params via `quickwit source update`; automation that regenerates source configs and pushes updates for every source type; assuming all source types are mutable like kafka/pulsar.","solutions":["Delete and recreate the source with the desired parameters (`quickwit source delete` then `quickwit source create`).","Only update source types that support in-place updates — kafka and pulsar sources validate param diffs; other types are effectively immutable.","If the parameters truly did not change, skip the update call in your automation (compare configs before pushing)."],"exampleFix":"# before (attempting update on an 'ingest' source)\nquickwit source update --index my-index --source my-source --source-config cfg.yaml\n# after\nquickwit source delete --index my-index --source my-source\nquickwit source create --index my-index --source-config cfg.yaml","handlingStrategy":"validation","validationCode":"const UPDATABLE_TYPES = new Set(['kafka', 'pulsar']);\nif (!UPDATABLE_TYPES.has(sourceType)) {\n  throw new Error(`source type ${sourceType} does not support updates; delete and recreate`);\n}","typeGuard":"const isUpdatableSourceType = (t) => ['kafka', 'pulsar'].includes(t);","tryCatchPattern":"try {\n  await updateSource(indexId, sourceId, cfg);\n} catch (e) {\n  if (String(e).includes('cannot be updated')) {\n    await deleteSource(indexId, sourceId);\n    await createSource(indexId, sourceId, cfg);\n  } else throw e;\n}","preventionTips":["Only call the update API for kafka/pulsar sources; recreate others when params change.","Diff the new config against the current one in automation and skip no-op updates.","Document per-type mutability in your source management tooling.","When in doubt, delete + create is always safe for source parameter changes."],"tags":["config","sources","validation","immutable-field"],"backgroundTag":"unsupported-operation","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"}