testcontainers/testcontainers-java · error · RuntimeException

container hasn't come up yet

Error message

container hasn't come up yet

What it means

YugabyteDBYCQLWaitStrategy polls YCQL readiness using a future whose finally block throws 'container hasn't come up yet' if the liveness status flag was never set to true by a successful probe. It signals the YCQL endpoint never became responsive within the wait period.

Solutions

  1. Increase the wait strategy timeout (withStartupTimeout / waitingFor duration)
  2. Verify the YCQL port and keyspace configuration on the container
  3. Check container logs for YCQL server startup errors
  4. Use a startup check indicator or log-based wait if cluster init is inherently slow

Example fix

// before
new YugabyteDBYCQLWaitStrategy()
// after
new YugabyteDBYCQLWaitStrategy().withStartupTimeout(Duration.ofMinutes(3))
Defensive patterns

Strategy: retry

Validate before calling

// pre-start sanity check
if (!container.isRunning()) throw new IllegalStateException("container exited before YCQL became ready");

Try / catch

try { container.start(); } catch (RuntimeException e) { if (e.getMessage().contains("hasn't come up yet")) { /* bump timeout and retry */ } }

Prevention

When it happens

Trigger: waitUntilReady runs its probe loop until the wait timeout; every probe attempt throws (caught, status.set(false)), so the finally block throws this RuntimeException when getAndSet(true) returns false.

Common situations: YCQL API (9042) not listening because cluster startup is slow; wrong keyspace/port configured; container image slow to initialize exceeding wait strategy timeout.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12). Data as JSON: /api/errors/18ef29e506eb711e. Report an issue: GitHub.

Appendix: source

Thrown at modules/yugabytedb/src/main/java/org/testcontainers/containers/strategy/YugabyteDBYCQLWaitStrategy.java:78

                                "-u",
                                container.getUsername(),
                                "-p",
                                container.getPassword(),
                                "-k",
                                container.getKeyspace(),
                                "-e",
                                YCQL_TEST_QUERY
                            );
                            if (result.getExitCode() != 0) {
                                status.set(false);
                                log.debug(result.getStderr());
                            }
                        } catch (Exception e) {
                            status.set(false);
                            log.debug(e.getMessage(), e);
                        } finally {
                            if (!status.getAndSet(true)) {
                                throw new RuntimeException("container hasn't come up yet");
                            }
                        }
                    });
                return status;
            }
        );
    }

    @Override
    public void waitUntilReady() {
        waitUntilReady(target);
    }
}

View on GitHub (pinned to 8e549514e3)