aeron-io/aeron · error · AeronException
failed to send byte packet to
Error message
failed to send byte packet to
What it means
Deprecated static hook sendError in UdpChannelTransport now unconditionally throws AeronException (WARN category) to force migration to the onSendError(IOException, InetSocketAddress, ErrorHandler) API. Any code still calling sendError fails instead of just reporting the send failure.
Solutions
- Replace calls to UdpChannelTransport.sendError(...) with UdpChannelTransport.onSendError(ex, destination, errorHandler).
- Pass your ErrorHandler instance so the failure is reported as an AeronEvent instead of thrown.
- Recompile and fix the resulting deprecation warnings after upgrading to >= 1.46.6.
Example fix
// before UdpChannelTransport.sendError(bytes, ex, destination); // after UdpChannelTransport.onSendError(ex, destination, errorHandler);
Defensive patterns
Strategy: try-catch
Try / catch
// Do not call the deprecated method at all; migrate:
try {
send(...);
} catch (IOException ex) {
UdpChannelTransport.onSendError(ex, destination, errorHandler);
} Prevention
- Treat deprecation warnings as build errors (-Werror)
- Update integration code when upgrading past 1.46.6
- Grep codebase for sendError( usages after upgrades
When it happens
Trigger: Calling the static UdpChannelTransport.sendError(bytesToSend, ex, destination) method directly, typically from custom transport/destination code that has not migrated to onSendError; since 1.46.6 this throws regardless of arguments.
Common situations: Upgrading Aeron past 1.46.6 with custom send-error reporting code, IDE auto-completion picking the deprecated overload, or copy-pasted older samples.
Understand the failure class
Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.
Related errors
- channel error -
- could not resolve control address:
- could not resolve endpoint address:
- either 'endpoint' or 'control' must be specified for UDP.
- exceeded session limit, streamId=
AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12).
Data as JSON: /api/errors/149441fe8d6f4061.
Report an issue: GitHub.
Appendix: source
Thrown at aeron-driver/src/main/java/io/aeron/driver/media/UdpChannelTransport.java:179
portManager,
context,
udpChannel.socketRcvbufLengthOrDefault(context.socketRcvbufLength()),
udpChannel.socketSndbufLengthOrDefault(context.socketSndbufLength()));
}
/**
* Throw a {@link AeronException} with a message for a send error.
*
* @param bytesToSend expected to be sent to the network.
* @param ex experienced.
* @param destination to which the send operation was addressed.
* @see #onSendError(IOException, InetSocketAddress, ErrorHandler)
* @deprecated {@link #onSendError(IOException, InetSocketAddress, ErrorHandler)} is used instead.
*/
@Deprecated(forRemoval = true, since = "1.46.6")
public static void sendError(final int bytesToSend, final IOException ex, final InetSocketAddress destination)
{
throw new AeronException(
"failed to send " + bytesToSend + " byte packet to " + destination, ex, AeronException.Category.WARN);
}
/**
* Report an {@link AeronEvent} with a message for a send error.
*
* @param ex experienced.
* @param destination to which the send operation was addressed.
* @param errorHandler to report error to.
*/
public static void onSendError(
final IOException ex, final InetSocketAddress destination, final ErrorHandler errorHandler)
{
errorHandler.onError(new AeronEvent(
"failed to send datagram to " + destination + ", cause: " + ex, AeronException.Category.WARN));
}
/**View on GitHub (pinned to 6d60124e15)