{"record":{"id":"a9e4ba1a204c0640","repo":"testcontainers/testcontainers-java","slug":"timeout-error","errorCode":null,"errorMessage":"TIMEOUT_ERROR","messagePattern":"TIMEOUT_ERROR","errorType":"exception","errorClass":"ContainerLaunchException","httpStatus":null,"severity":"error","filePath":"modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java","lineNumber":43,"sourceCode":"    @Override\n    protected void waitUntilReady() {\n        // execute select version query until success or timeout\n        try {\n            retryUntilSuccess(\n                (int) startupTimeout.getSeconds(),\n                TimeUnit.SECONDS,\n                () -> {\n                    getRateLimiter()\n                        .doWhenReady(() -> {\n                            try (DatabaseDelegate databaseDelegate = getDatabaseDelegate()) {\n                                databaseDelegate.execute(SELECT_VERSION_QUERY, \"\", 1, false, false);\n                            }\n                        });\n                    return true;\n                }\n            );\n        } catch (TimeoutException e) {\n            throw new ContainerLaunchException(TIMEOUT_ERROR);\n        }\n    }\n\n    private DatabaseDelegate getDatabaseDelegate() {\n        return new CassandraDatabaseDelegate(waitStrategyTarget);\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":51,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java#L25-L51","documentation":"The deprecated legacy CassandraQueryWaitStrategy (modules/cassandra/.../wait/) throws ContainerLaunchException(TIMEOUT_ERROR) when its CQL probe does not succeed before the startup timeout. Functionally identical to the modern strategy error [80]; the constant TIMEOUT_ERROR holds 'Timed out waiting for Cassandra to be accessible for query execution'.","triggerScenarios":"container.start() with waitingFor(new CassandraQueryWaitStrategy()) where no probe query succeeds within the configured timeout.","commonSituations":"Slow startup on CI, undersized Docker resources, or a Cassandra image that fails to bootstrap; also using this deprecated strategy with images requiring longer init times.","solutions":["Extend the timeout: new CassandraQueryWaitStrategy().withStartupTimeout(Duration.ofMinutes(5))","Switch to org.testcontainers.cassandra.CassandraQueryWaitStrategy (non-deprecated) and configure a longer startup timeout","Inspect container logs for Cassandra bootstrap failures and fix the image/memory configuration"],"exampleFix":"// before\ncontainer.waitingFor(new org.testcontainers.containers.wait.CassandraQueryWaitStrategy());\n// after\ncontainer.waitingFor(new org.testcontainers.cassandra.CassandraQueryWaitStrategy().withStartupTimeout(Duration.ofMinutes(5)));","handlingStrategy":"retry","validationCode":"long timeoutMs = Duration.ofMinutes(5).toMillis(); // budget Cassandra's slow bootstrap","typeGuard":null,"tryCatchPattern":"try { container.start(); } catch (ContainerLaunchException e) { /* TIMEOUT_ERROR: retry with extended startup timeout */ }","preventionTips":["Replace the deprecated strategy with org.testcontainers.cassandra.CassandraQueryWaitStrategy","Set startup timeout >= 5 minutes for Cassandra in CI","Verify image and memory headroom"],"tags":["cassandra","testcontainers","timeout","container-startup","deprecated"],"backgroundTag":"request-timeout","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"}