{"record":{"id":"0688b168eb186f4b","repo":"clockworklabs/SpacetimeDB","slug":"unexpected-error-from-datastore-delete-by-index-s","errorCode":null,"errorMessage":"unexpected error from `datastore_delete_by_index_scan_point_bsatn`: {e}","messagePattern":"unexpected error from `datastore_delete_by_index_scan_point_bsatn`: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bindings/src/table.rs","lineNumber":647,"sourceCode":"    ///     // Delete users with exactly 25 dogs, and exactly the name \"Joseph\".\n    ///     by_dogs_and_name.delete((25u64, \"Joseph\"));\n    ///\n    ///     // You can also pass arguments by reference if desired.\n    ///     by_dogs_and_name.delete((&25u64, &\"Joseph\".to_string()));\n    /// }\n    /// # }\n    /// ```\n    ///\n    /// May panic if deleting any one of the rows would violate a constraint,\n    /// though at present no such constraints exist.\n    pub fn delete<P, K>(&self, point: P) -> u64\n    where\n        P: WithPointArg<K>,\n    {\n        let index_id = Idx::index_id();\n        point.with_point_arg(|point| {\n            sys::datastore_delete_by_index_scan_point_bsatn(index_id, point)\n                .unwrap_or_else(|e| panic!(\"unexpected error from `datastore_delete_by_index_scan_point_bsatn`: {e}\"))\n                .into()\n        })\n    }\n}\n\n/// Scans `Tbl` for `point` using the index `Idx`.\n///\n/// The type parameter `K` is either `()` or [`SingleBound`]\n/// and is used to workaround the orphan rule.\nfn filter_point<Tbl, Idx, K>(point: impl WithPointArg<K>) -> impl Iterator<Item = Tbl::Row>\nwhere\n    Tbl: Table,\n    Idx: IndexIsPointed,\n{\n    let index_id = Idx::index_id();\n    let iter = point.with_point_arg(|point| datastore_index_scan_point_bsatn(index_id, point));\n    TableIter::new(iter)\n}","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/bindings/src/table.rs#L629-L665","documentation":"IndexColumn::delete deletes all rows matching a point on an index and panics when the datastore_delete_by_index_scan_point_bsatn syscall errors. The count of deleted rows is the normal return; an Err errno means the serialized point does not decode as the index key type or the index id is stale - a schema/metadata mismatch rather than a data problem.","triggerScenarios":"Deleting via an index column (ctx.db.table().col().delete(v)) where the column's type changed since the module was built; generated index ids pointing at a different index after partial redeploys.","commonSituations":"Module refactored (column renamed/retyped) while old generated table code is still compiled in; mixed versions of the spacetimedb crate and server.","solutions":["Regenerate bindings and do a clean republish so the compiled index id matches the deployed schema.","Verify the column actually carries #[index] or #[unique] in the current module source.","Match crate and host versions; file an issue with the errno value if reproducible."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate bindings and republish after renaming or retyping indexed columns.","Confirm the column is declared #[index] or #[unique] before calling its delete API.","Treat any occurrence as version skew: rebuild clean and realign versions."],"tags":["rust","module","delete","index","schema-mismatch"],"backgroundTag":"index-delete-failed","analyzedSha":"6dee26c6efc2856793e12b148a59742964f5d783","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}