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
- Check the server log (system.log) for the original stack trace — the RuntimeException hides it.
- Free the native transport port: `ss -ltnp | grep 9042`, stop the conflicting process or change native_transport_port in cassandra.yaml.
- Fix the underlying daemon exception reported in the log, then `nodetool enablenativetransport` again.
- 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
- Reserve/verify port 9042 (or configured native_transport_port) is free before startup.
- Always correlate this wrapper message with the server log — it hides the stack trace.
- Wrap causes when rethrowing: new RuntimeException(msg, e).
- Alert on native transport startup failures during rolling restarts.
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
- No configured daemon
- Configured ${configName} "${intf}" could not be found
- Configured ${configName} "${intf}" was found, but had no add
- Missing required directive CommitLogSync
- memtable_cleanup_threshold must be >= 0.01, but was ${conf.m
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/1952e016115526c9.
Report an issue: GitHub.