{"record":{"id":"193d05d7c677918b","repo":"apache/cassandra","slug":"error-while-rebuilding-node-e-getcause-getmes","errorCode":null,"errorMessage":"Error while rebuilding node: ${e.getCause().getMessage()}","messagePattern":"Error while rebuilding node: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/Rebuild.java","lineNumber":180,"sourceCode":"            }\n\n            StreamResultFuture streamResult = streamer.fetchAsync();\n\n            Future<?> accordReady = AccordService.instance().epochReadyFor(metadata, EpochReady::reads);\n            Future<?> ready = FutureCombiner.allOf(streamResult, accordReady);\n\n            // wait for result\n            ready.get();\n        }\n        catch (InterruptedException e)\n        {\n            throw new UncheckedInterruptedException(e);\n        }\n        catch (ExecutionException e)\n        {\n            // This is used exclusively through JMX, so log the full trace but only throw a simple RTE\n            logger.error(\"Error while rebuilding node\", e.getCause());\n            throw new RuntimeException(\"Error while rebuilding node: \" + e.getCause().getMessage());\n        }\n        finally\n        {\n            // rebuild is done (successfully or not)\n            isRebuilding.set(false);\n        }\n    }\n\n\n    private static RangesAtEndpoint rangesForRebuildWithTokens(String tokens, String keyspace)\n    {\n        Token.TokenFactory factory = StorageService.instance.getTokenFactory();\n        List<Range<Token>> ranges = new ArrayList<>();\n        Pattern rangePattern = Pattern.compile(\"\\\\(\\\\s*(-?\\\\w+)\\\\s*,\\\\s*(-?\\\\w+)\\\\s*\\\\]\");\n        try (Scanner tokenScanner = new Scanner(tokens))\n        {\n            while (tokenScanner.findInLine(rangePattern) != null)\n            {","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/Rebuild.java#L162-L198","documentation":"When rebuild is invoked via JMX, the streaming future's ExecutionException is logged with full trace but rethrown as a simple RuntimeException carrying only the root cause's message, so the operator gets a one-line reason (e.g. a stream failure) without a stack.","triggerScenarios":"Underlying StreamPlan/stream session fails during rebuild (node down, network partition, hinted-handoff issues) and the rebuild() call surfaces the failure asynchronously via Future.get().","commonSituations":"Source node crashed mid-stream; network interruption between DCs; TLS or internode auth failures during streaming; disk failure on the rebuilding node.","solutions":["Read the full 'Error while rebuilding node' stack trace in the node's log to find the root cause","Fix the underlying stream failure (restart dead peer, restore network, correct auth) and rerun `nodetool rebuild`","Check `nodetool netstats` and system.log/systemd journal for StreamSession errors before retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check peers are up before rebuild\nif (!StreamsCoordinator healthy || peerDown(sourceDcNodes)) postponeRebuild();","typeGuard":null,"tryCatchPattern":"try { rebuild(...); }\ncatch (RuntimeException e) {\n    logger.error(\"rebuild failed: {}\", e.getMessage(), e);\n    // full cause is in the server log under 'Error while rebuilding node'\n    alertOpsAndRetryAfterFix(e);\n}","preventionTips":["Confirm all source-DC nodes are UP before starting rebuild","Monitor streaming with `nodetool netstats` and system.log during rebuild","Check internode TLS/encryption settings match across DCs"],"tags":["streaming","jmx","runtime","rebuild"],"backgroundTag":"http-error-response","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}