nathanmarz/storm · error · RuntimeException
Server connection should not send any messages
Error message
Server connection should not send any messages
What it means
Like the Client, the messaging layer is unidirectional: a Server only receives from clients and never sends. Server.send is implemented as an unconditional throw at Server.java:135 to catch any attempt to push messages out on a server-side connection.
Solutions
- Send only via Client connections; use Server solely for receiving.
- In generic IConnection code, branch on instanceof Client before calling send.
- Create a Client that connects to the target address if bidirectional communication is needed.
Example fix
// before server.send(task, bytes); // always throws // after client.connect(remoteAddr); client.send(task, bytes);
Defensive patterns
Strategy: type-guard
Validate before calling
if (conn instanceof backtype.storm.messaging.netty.Server) { /* do not call send */ } Type guard
boolean isSendingConnection(IConnection c) {
return c instanceof backtype.storm.messaging.netty.Client;
} Try / catch
// send on Server is guaranteed to throw; guard with instanceof instead of catching
Prevention
- Route all outgoing traffic through Client connections.
- In IConnection-generic code, assert direction before send/recv.
- Keep server and client connection usage in separate code paths.
When it happens
Trigger: Any call to server.send(task, message) on a backtype.storm.messaging.netty.Server instance — usually generic IConnection-handling code or tests treating a server like a client.
Common situations: Shared transport abstraction code that sends on every IConnection regardless of direction; worker code accidentally holding the server-side connection and emitting tuples through it; tests exercising send on a listening socket.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Client connection should not receive any messages
- Client is being closed, and does not take requests any more
- null object forbidded in message batch
- Unsuppoted object type
- Task ID should not exceed
AI-assisted analysis of nathanmarz/storm@cdb116e942 (2026-09-12).
Data as JSON: /api/errors/14bf5409062b356a.
Report an issue: GitHub.
Appendix: source
Thrown at storm-netty/src/jvm/backtype/storm/messaging/netty/Server.java:135
*/
protected void closeChannel(Channel channel) {
channel.close().awaitUninterruptibly();
allChannels.remove(channel);
}
/**
* close all channels, and release resources
*/
public synchronized void close() {
if (allChannels != null) {
allChannels.close().awaitUninterruptibly();
factory.releaseExternalResources();
allChannels = null;
}
}
public void send(int task, byte[] message) {
throw new RuntimeException("Server connection should not send any messages");
}
}
View on GitHub (pinned to cdb116e942)