{"record":{"id":"444b5b1185a8b0f5","repo":"apache/cassandra","slug":"s-empty-keyspace-skipping-repair-s","errorCode":null,"errorMessage":"%s Empty keyspace, skipping repair: %s","messagePattern":"(.+?) Empty keyspace, skipping repair: (.+?)","errorType":"exception","errorClass":"SkipRepairException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/repair/RepairCoordinator.java","lineNumber":361,"sourceCode":"                {\n                    fail(null);\n                }\n                else\n                {\n                    success(pair.right.get());\n                    ctx.repair().cleanUp(state.id, neighborsAndRanges.participants);\n                }\n            }\n        });\n    }\n\n    private List<ColumnFamilyStore> getColumnFamilies()\n    {\n        String[] columnFamilies = state.options.getColumnFamilies().toArray(new String[state.options.getColumnFamilies().size()]);\n        Iterable<ColumnFamilyStore> validColumnFamilies = this.validColumnFamilies.apply(state.keyspace, columnFamilies);\n\n        if (Iterables.isEmpty(validColumnFamilies))\n            throw new SkipRepairException(String.format(\"%s Empty keyspace, skipping repair: %s\", state.id, state.keyspace));\n        return Lists.newArrayList(validColumnFamilies);\n    }\n\n    private TraceState maybeCreateTraceState(Iterable<ColumnFamilyStore> columnFamilyStores)\n    {\n        if (!state.options.isTraced())\n            return null;\n\n        StringBuilder cfsb = new StringBuilder();\n        for (ColumnFamilyStore cfs : columnFamilyStores)\n            cfsb.append(\", \").append(cfs.getKeyspaceName()).append(\".\").append(cfs.name);\n\n        TimeUUID sessionId = Tracing.instance.newSession(Tracing.TraceType.REPAIR);\n        TraceState traceState = Tracing.instance.begin(\"repair\", ImmutableMap.of(\"keyspace\", state.keyspace, \"columnFamilies\",\n                                                                                 cfsb.substring(2)));\n        traceState.enableActivityNotification(tag);\n        for (ProgressListener listener : listeners)\n            traceState.addProgressListener(listener);","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/repair/RepairCoordinator.java#L343-L379","documentation":"Before coordinating a repair, getColumnFamilies resolves the requested tables; if none of them exist or are valid in the keyspace, the repair is aborted via SkipRepairException with the message 'Empty keyspace, skipping repair'. This is an intentional skip, not a fault — the coordinator just has nothing to do.","triggerScenarios":"Invoking repair with a column-family list whose members all fail validColumnFamilies (typo'd or dropped tables), or repairing a keyspace with no surviving tables.","commonSituations":"Scripts referencing tables deleted by schema changes; case-sensitive table-name mistakes; repairing a keyspace before any tables are created.","solutions":["Check the keyspace/table names in the repair request with DESC KEYSPACE / nodetool cfstats and correct typos.","Drop explicit table names to repair the whole keyspace, or skip the call when the keyspace is empty.","In automation, catch SkipRepairException (it signals 'nothing to do') and treat it as a no-op."],"exampleFix":"// before\nStorageService.instance.repairAsync(ks, optionsWithTables(\"old_table\"));\n// after\nif (keyspaceHasTables(ks, \"old_table\")) StorageService.instance.repairAsync(ks, optionsWithTables(\"old_table\"));","handlingStrategy":"try-catch","validationCode":"boolean tablesExist = requestedTables.stream().allMatch(t -> Schema.instance.getCFMetaData(ks, t) != null);\n","typeGuard":null,"tryCatchPattern":"try { repairAsync(ks, opts); } catch (SkipRepairException e) { logger.info(\"Repair skipped: {}\", e.getMessage()); } // expected no-op","preventionTips":["Verify table names with cqlsh DESC KEYSPACE before scripted repairs","Re-read the schema after migrations before triggering repairs","Treat SkipRepairException as success/no-op in automation"],"tags":["repair","skip","schema"],"backgroundTag":"empty-result-set","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}