{"record":{"id":"1395b9bd98d39829","repo":"clockworklabs/SpacetimeDB","slug":"unknown-index-algorithm","errorCode":null,"errorMessage":"Unknown index algorithm {:?}","messagePattern":"Unknown index algorithm (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/schema/src/def/validate/v9.rs","lineNumber":1462,"sourceCode":"\n/// Concatenate a list of column names.\nfn concat_column_names(table_type: &ProductType, selected: &ColList) -> String {\n    selected.iter().map(|col| column_name(table_type, col)).join(\"_\")\n}\n\n/// All indexes have this name format.\n///\n/// Generated name should not go through case conversion.\npub fn generate_index_name(\n    table_name: &Identifier,\n    table_type: &ProductType,\n    algorithm: &RawIndexAlgorithm,\n) -> RawIdentifier {\n    let (label, columns) = match algorithm {\n        RawIndexAlgorithm::BTree { columns } => (\"btree\", columns),\n        RawIndexAlgorithm::Direct { column } => (\"direct\", &col_list![*column]),\n        RawIndexAlgorithm::Hash { columns } => (\"hash\", columns),\n        _ => unimplemented!(\"Unknown index algorithm {:?}\", algorithm),\n    };\n    let column_names = concat_column_names(table_type, columns);\n    RawIdentifier::new(format!(\"{table_name}_{column_names}_idx_{label}\"))\n}\n\n/// All sequences have this name format.\n///\n/// Generated name should not go through case conversion.\npub fn generate_sequence_name(table_name: &Identifier, table_type: &ProductType, column: ColId) -> RawIdentifier {\n    let column_name = column_name(table_type, column);\n    RawIdentifier::new(format!(\"{table_name}_{column_name}_seq\"))\n}\n\n/// All schedules have this name format.\n///\n/// Generated name should not go through case conversion.\npub fn generate_schedule_name(table_name: &Identifier) -> RawIdentifier {\n    RawIdentifier::new(format!(\"{table_name}_sched\"))","sourceCodeStart":1444,"sourceCodeEnd":1480,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/schema/src/def/validate/v9.rs#L1444-L1480","documentation":"generate_index_name (crates/schema/src/def/validate/v9.rs:1462) maps each index algorithm to a name label: btree, direct, or hash. RawIndexAlgorithm is #[non_exhaustive] with exactly those three variants (crates/lib/src/db/raw_def/v9.rs:309), so an unrecognized variant reaching this function triggers unimplemented!() — meaning the module binary carried an algorithm this host build does not know.","triggerScenarios":"Publishing a module compiled against a newer SDK that introduces an additional index algorithm variant to an older host; synthesizing a module ABI with an out-of-range index algorithm tag.","commonSituations":"cargo update bumping the spacetimedb SDK ahead of the running server; preview toolchains publishing to a stable cluster; module .wasm built on a different machine with a newer toolchain.","solutions":["Update the SpacetimeDB host/CLI to a version at or above the SDK used to build the module, then republish","Or downgrade the SDK in the module to the host's supported ABI version","Stick to #[index(btree)] / #[index(hash)] / direct indexes on unique columns, which all current hosts accept"],"exampleFix":"# before\nspacetime publish --server mainnet my-module # module built with newer SDK\n\n# after\nspacetime update   # or reinstall CLI; then rebuild and republish\nspacetime publish --server mainnet my-module","handlingStrategy":"validation","validationCode":"# Match toolchain before publish:\nspacetime version                     # host/CLI version\ncargo tree -p spacetimedb --depth 0   # SDK version used by the module\n# If SDK > host, downgrade SDK or update host before building","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lock SDK and host versions in CI (a single SPACETIMEDB_VERSION env var used by both)","Use only btree/hash/direct index kinds for portable modules","Rebuild the module .wasm after any toolchain update, never reuse stale artifacts"],"tags":["schema","index","validation","abi","version-skew","unimplemented","spacetimedb"],"backgroundTag":"abi-version-mismatch","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}