{"record":{"id":"6f8f7d60b38f4ddb","repo":"apache/cassandra","slug":"s-s-has-not-finished-building-node-status-is-be","errorCode":null,"errorMessage":"%s.%s has not finished building; node status is below.","messagePattern":"(.+?)\\.(.+?) has not finished building; node status is below\\.","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/ViewBuildStatus.java","lineNumber":91,"sourceCode":"        boolean failed = false;\n        TableBuilder builder = new TableBuilder();\n\n        builder.add(\"Host\", \"Info\");\n        for (Map.Entry<String, String> status : buildStatus.entrySet())\n        {\n            if (!status.getValue().equals(SUCCESS)) {\n                failed = true;\n            }\n            builder.add(status.getKey(), status.getValue());\n        }\n\n        if (failed)\n        {\n            String message = String.format(\"%s.%s has not finished building; node status is below.\", keyspace, view);\n            out.println(message);\n            out.println();\n            builder.printTo(out);\n            throw new RuntimeException(message);\n        }\n        else\n            out.println(String.format(\"%s.%s has finished building\", keyspace, view));\n    }\n}\n","sourceCodeStart":73,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/ViewBuildStatus.java#L73-L97","documentation":"ViewBuildStatus polls every node's view build status for a materialized view. If any node reports the view as failed or not finished building, the command prints the per-node status table and throws a RuntimeException containing '%s.%s has not finished building; node status is below.'. It signals the view build did not complete cluster-wide.","triggerScenarios":"`nodetool viewbuildstatus <keyspace> <view>` while the view build is still in progress, or after a node failed its portion of the build (e.g. errors during backfill, node restarts mid-build).","commonSituations":"Impatiently polling a large view build still in progress; view build stalled because a replica was down; view build failure due to tombstone/timeouts during backfill after heavy writes.","solutions":["Check the printed per-node status table to find which node(s) are not SUCCESS.","If still building (IN_PROGRESS), wait and re-run; builds on large tables take a long time.","Inspect system.log on failing nodes for view build errors; fix the underlying issue (restart node, repair, free disk).","If the build is permanently stuck, drop and recreate the materialized view."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// poll until build completes before treating as failure, with a deadline\nlong deadline = System.currentTimeMillis() + timeoutMs;\nwhile (System.currentTimeMillis() < deadline) {\n  if (runNodetoolCapture(\"viewbuildstatus\", ks, view).contains(\"has finished building\")) return;\n  Thread.sleep(pollIntervalMs);\n}","typeGuard":null,"tryCatchPattern":"try { runNodetool(\"viewbuildstatus\", ks, view); }\ncatch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"has not finished building\")) {\n    // inspect per-node status output; retry with backoff before escalating\n  } else throw e;\n}","preventionTips":["Treat 'not finished' as retryable; only escalate when nodes report FAILED status.","Ensure all replicas are UP before creating large materialized views.","Watch view build progress via system.log and `nodetool viewbuildstatus` with a polling schedule.","Create views during low write volume so backfill is not starved by timeouts."],"tags":["nodetool","materialized-view","build-status"],"backgroundTag":"operation-incomplete","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"}