{"record":{"id":"40fbc97b90a140ce","repo":"clockworklabs/SpacetimeDB","slug":"system-tables-cannot-have-schedules-but-table","errorCode":null,"errorMessage":"system tables cannot have schedules, but table {}: {sch:?}","messagePattern":"system tables cannot have schedules, but table (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/datastore/src/system_tables.rs","lineNumber":855,"sourceCode":"                    constraint.constraint_name, result.table_name\n                )\n            });\n    }\n    for sequence in &mut result.sequences {\n        sequence.sequence_id = SEQUENCE_IDS\n            .get(&sequence.sequence_name[..])\n            .copied()\n            .unwrap_or_else(|| {\n                panic!(\n                    \"missing system table sequence id for sequence {} of table {}\",\n                    sequence.sequence_name, result.table_name\n                )\n            });\n        sequence.start = ST_RESERVED_SEQUENCE_RANGE as i128 + 1;\n        // sequence.allocated = ST_RESERVED_SEQUENCE_RANGE as i128;\n    }\n    if let Some(sch) = result.schedule {\n        panic!(\n            \"system tables cannot have schedules, but table {}: {sch:?}\",\n            result.table_name\n        );\n    }\n    result.normalize();\n    // Note, if we ever added system tables with schedules, we would need to set their IDs here too.\n    result\n}\n\nfn st_table_schema() -> TableSchema {\n    st_schema(ST_TABLE_NAME, ST_TABLE_ID)\n}\n\nfn st_column_schema() -> TableSchema {\n    st_schema(ST_COLUMN_NAME, ST_COLUMN_ID)\n}\n\nfn st_index_schema() -> TableSchema {","sourceCodeStart":837,"sourceCodeEnd":873,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/datastore/src/system_tables.rs#L837-L873","documentation":"While normalizing system table schemas, any attached schedule is rejected with a panic: system tables must not have scheduled reducers, and id assignment for system-table schedules is deliberately not implemented (the comment below notes IDs would need to be set if this ever changed). This runs during system schema definition at startup or in tests. It is an internal guard for core development, not a user-facing validation.","triggerScenarios":"Defining a system table schema that includes a schedule; panics in the normalizer when result.schedule is Some during construction of that schema.","commonSituations":"Core development adding scheduled reducers; forks copying user-table patterns into system tables; rebases that move schedules into system table definitions.","solutions":["Remove the schedule from the system table schema.","If schedules on system tables are genuinely needed, implement schedule id assignment for them and remove the guard, per the comment below the panic.","Keep the system-table test suite green when touching system_tables.rs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// core devs: reject schedules on system tables at definition time\ntype TableSchema = (); // placeholder\nfn assert_no_schedule(schema: &TableSchema) {\n    // if TableSchema exposes `schedule`, fail fast with a clear message here\n}","typeGuard":null,"tryCatchPattern":"let r = std::panic::catch_unwind(build_system_tables);\nif r.is_err() {\n    // a system table carries a schedule: remove it from the schema definition\n}","preventionTips":["Keep schedules out of system table definitions by convention.","Extend the system-table tests to assert schedule is None for every system table.","Review the note in system_tables.rs when adding scheduling features."],"tags":["spacetimedb","system-tables","internal","schedules","invariant"],"backgroundTag":"system-table-invariant","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"}