{"record":{"id":"73aba5824dbb3982","repo":"testcontainers/testcontainers-java","slug":"e-getmessage","errorCode":null,"errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"UncategorizedScriptException","httpStatus":null,"severity":"error","filePath":"modules/yugabytedb/src/main/java/org/testcontainers/containers/delegate/YugabyteDBYCQLDelegate.java","lineNumber":64,"sourceCode":"        try {\n            ExecResult result = container.execInContainer(\n                BIN_PATH,\n                containerInterfaceIP,\n                \"-u\",\n                container.getUsername(),\n                \"-p\",\n                container.getPassword(),\n                \"-k\",\n                container.getKeyspace(),\n                \"-e\",\n                StringUtils.join(statements, \";\")\n            );\n            if (result.getExitCode() != 0) {\n                throw new RuntimeException(result.getStderr());\n            }\n        } catch (Exception e) {\n            log.debug(e.getMessage(), e);\n            throw new UncategorizedScriptException(e.getMessage(), e);\n        }\n    }\n}\n","sourceCodeStart":46,"sourceCodeEnd":68,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/yugabytedb/src/main/java/org/testcontainers/containers/delegate/YugabyteDBYCQLDelegate.java#L46-L68","documentation":"The same execute() flow in YugabyteDBYCQLDelegate catches any Exception during statement execution, logs it at debug level, and rethrows it as Spring's UncategorizedScriptException with the original message. It classifies script execution failures that are not the explicit non-zero-exit-code path.","triggerScenarios":"Any Exception thrown while preparing/running the ycqlsh ExecScript (e.g. container not running, exec failures), after which the catch block wraps e.getMessage() in UncategorizedScriptException.","commonSituations":"Container stopped before init; exec API failures; combined with 241 — the RuntimeException from non-zero exit is itself re-wrapped here as UncategorizedScriptException.","solutions":["Enable debug logging for the delegate to see the original stack trace (log.debug only)","Fix the root cause shown in the wrapped message","Ensure the container is running and healthy before init scripts execute","Check that script statements are valid and semicolon-joined"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"assert container.isRunning() : \"yugabytedb container must be started before executing scripts\";","typeGuard":null,"tryCatchPattern":"catch (UncategorizedScriptException e) { /* original message is e.getCause().getMessage(); enable debug logging for the delegate */ }","preventionTips":["Enable debug logging for org.testcontainers to see the original exception","Start the container before any delegate execution","Keep scripts idempotent and syntactically valid"],"tags":["yugabytedb","cql","script-execution"],"backgroundTag":"sql-query-failed","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}