apache/cassandra · error · RuntimeException

Error starting native transport:

Error message

Error starting native transport: 

What it means

RuntimeException wrapping the message of any exception thrown by daemon.startNativeTransport(). It deliberately loses the original stack trace, surfacing only e.getMessage(), so the real cause (port bind failure, missing config, internal CQL server error) is hidden.

Source

Thrown at src/java/org/apache/cassandra/service/StorageService.java:610

        return Gossiper.instance.isEnabled();
    }

    public synchronized void startNativeTransport()
    {
        checkServiceAllowedToStart("native transport");

        if (daemon == null)
        {
            throw new IllegalStateException("No configured daemon");
        }

        try
        {
            daemon.startNativeTransport();
        }
        catch (Exception e)
        {
            throw new RuntimeException("Error starting native transport: " + e.getMessage());
        }
    }

    public void stopNativeTransport(boolean force)
    {
        if (daemon == null)
        {
            throw new IllegalStateException("No configured daemon");
        }
        daemon.stopNativeTransport(force);
    }

    public boolean isNativeTransportRunning()
    {
        if (daemon == null)
        {
            return false;
        }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Check the server log (system.log) for the original stack trace — the RuntimeException hides it.
  2. Free the native transport port: `ss -ltnp | grep 9042`, stop the conflicting process or change native_transport_port in cassandra.yaml.
  3. Fix the underlying daemon exception reported in the log, then `nodetool enablenativetransport` again.
  4. If instrumenting, preserve the cause: throw new RuntimeException(msg, e) instead of dropping the stack trace.

Example fix

// before (in StorageService)
throw new RuntimeException("Error starting native transport: " + e.getMessage());
// after
throw new RuntimeException("Error starting native transport: " + e.getMessage(), e);
Defensive patterns

Strategy: try-catch

Validate before calling

try (Socket probe = new Socket()) {
    probe.connect(new InetSocketAddress("127.0.0.1", nativeTransportPort), 500);
    warn("native transport port already in use");
} catch (IOException expectedFree) { /* port free, safe to start */ }

Try / catch

catch (RuntimeException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("Error starting native transport")) {
        // cause is hidden; read system.log for the original stack trace
        investigateServerLog();
        return;
    }
    throw e;
}

Prevention

When it happens

Trigger: Any exception inside CassandraDaemon.startNativeTransport() while enabling the CQL native protocol server — most commonly native_transport_port already bound, or an initialization error in the transport layer.

Common situations: Port 9042 already in use by another process or a second Cassandra instance; firewall/privilege issues on low ports; corrupted config causing transport init failure; enabling native transport via nodetool enablethrift-era scripts that surfaced only the wrapped message.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/1952e016115526c9. Report an issue: GitHub.