{"record":{"id":"5b3c1d1d23b484e9","repo":"apache/cassandra","slug":"unable-to-bind-to-address-bind-set-listen-addre","errorCode":null,"errorMessage":"Unable to bind to address <bind>. Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2","messagePattern":"Unable to bind to address <bind>\\. Set listen_address in cassandra\\.yaml to an interface you can bind to, e\\.g\\., your private IP address on EC2","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/net/InboundConnectionInitiator.java","lineNumber":204,"sourceCode":"        if (!channelFuture.awaitUninterruptibly().isSuccess())\n        {\n            if (channelFuture.channel().isOpen())\n                channelFuture.channel().close();\n\n            Throwable failedChannelCause = channelFuture.cause();\n\n            String causeString = \"\";\n            if (failedChannelCause != null && failedChannelCause.getMessage() != null)\n                causeString = failedChannelCause.getMessage();\n\n            if (causeString.contains(\"in use\"))\n            {\n                throw new ConfigurationException(bind + \" is in use by another process.  Change listen_address:storage_port \" +\n                                                 \"in cassandra.yaml to values that do not conflict with other services\");\n            }\n            else if (causeString.contains(\"cannot assign requested address\"))\n            {\n                throw new ConfigurationException(\"Unable to bind to address \" + bind\n                                                 + \". Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2\");\n            }\n            else\n            {\n                throw new ConfigurationException(\"failed to bind to: \" + bind, failedChannelCause);\n            }\n        }\n\n        return channelFuture;\n    }\n\n    public static ChannelFuture bind(InboundConnectionSettings settings, ChannelGroup channelGroup,\n                                     Consumer<ChannelPipeline> pipelineInjector)\n    {\n        return bind(new Initializer(settings, channelGroup, pipelineInjector));\n    }\n\n    /**","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/net/InboundConnectionInitiator.java#L186-L222","documentation":"InboundConnectionInitiator.bind() translates Netty bind failures: when the OS reports 'cannot assign requested address', Cassandra cannot bind to the configured listen_address at all — the address is not assigned to any local interface. A ConfigurationException advising to set listen_address to a bindable interface is thrown.","triggerScenarios":"bind() called with a listen_address that does not exist on the host (typo, stale EC2 public IP, hostname resolving to a non-local IP).","commonSituations":"Setting listen_address to an EC2 public IP (not bound to the NIC); hostname resolution changes after restart; copied cassandra.yaml from another machine; interface renamed or DHCP address changed.","solutions":["Set listen_address to a local private IP or 0.0.0.0 in cassandra.yaml, or use listen_interface instead","Verify the address exists on the host (ip addr show) and pick one actually assigned","On EC2, use the private IP or listen_interface: eth0 instead of the public IP","If using a hostname, confirm it resolves to a local address (getent hosts <hostname>)"],"exampleFix":"// before (cassandra.yaml)\nlisten_address: 54.12.34.56  # EC2 public IP, not bound to NIC\n// after\nlisten_interface: eth0","handlingStrategy":"validation","validationCode":"// verify listen_address is locally bound before starting\nInetAddress addr = InetAddress.getByName(FBUtilities.getBroadcastAddressAndPort().getAddressString());\nif (!addr.isAnyLocalAddress() && NetworkInterface.getByInetAddress(addr) == null)\n    throw new IllegalStateException(\"listen_address not assigned to any local interface\");","typeGuard":null,"tryCatchPattern":"try { startCassandra(); } catch (ConfigurationException e) { if (e.getMessage().contains(\"Unable to bind to address\")) { /* fix listen_address to a local interface */ } }","preventionTips":["Never use EC2 public IPs for listen_address; use the private IP or listen_interface","Validate cassandra.yaml addresses exist on the host before deploy","Prefer listen_interface: eth0 over hardcoded IPs in cloud environments","Re-check config after host rebuilds or interface changes"],"tags":["network","bind","configuration","ec2"],"backgroundTag":"address-already-in-use","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}