How to Fix io.netty.channel.AbstractChannel Error
AnnotatedConnectException means the game couldn't open a connection to the server's address and port. How to read refused and timed out, and what to check.
Quick Fix
Check the address and port, make sure the server is running, and read the words after the exception: Connection refused and Connection timed out point to different problems.
Error Message
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt: mc.example.com/203.0.113.10:25565How to Fix
Read the end of the message. After the error text it shows the host name, IP address and port the game tried.
For Connection refused, start the server, wait for Done in the console, and check server-port in server.properties.
For Connection timed out, allow TCP on the server port in the server's firewall and check the router's port forwarding.
Type the port after a colon, such as play.example.com:25566, when the server doesn't use 25565 and has no SRV record.
Test from inside the server's own network first. If that works and outside connections don't, the problem is forwarding or a firewall.
Common Causes
- Nothing accepts connections on that address and port, because the server is offline, still starting or on another port. The message then says Connection refused.
- No answer comes back, for example because a firewall drops the packets or the address points to the wrong machine. The message then says Connection timed out.
- The port is wrong. Without a port the game tries the server's SRV record and otherwise uses 25565, so a server on another port needs the port after a colon.
- Port forwarding or a firewall on the server side doesn't allow TCP on the game port, so only players on the same network can connect.
Diagnostic Steps
- Check the address and port at the end of the message.
- Confirm the server is running on that port.
- Check the firewall and port forwarding for TCP.
- Try again with the numeric IP and port.
FAQ
What is Netty?
The networking library Minecraft uses for its connections. AnnotatedConnectException is Netty's copy of Java's ConnectException with the address and port added to the message.
What do getsockopt and no further information mean?
They come from Java on Windows. Java 8 adds no further information when there is no extra detail, while Java 21 and Java 25 name the call that reported the error, getsockopt. The part that matters is Connection refused or Connection timed out.
Will reinstalling Minecraft fix it?
No. It's a network error between you and the server, so check the server, the port and the network instead.
Related Errors
How to Fix Connection Refused
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused
How to Fix Connection Timed Out
io.netty.channel.ConnectTimeoutException: connection timed out
How to Fix java.net.ConnectException
java.net.ConnectException: Connection refused: no further information
How to Fix Unable to Resolve Hostname
Can't resolve hostname / Unknown host