Exception message of 'connection refused' is confusing
See original GitHub issueExpected behavior
syscall:getsockopt(...) failed:
does not appear in the exception message or something more helpful appears.
Actual behavior
syscall:getsockopt(...) failed:
appears in the exception message.
Steps to reproduce
Attempt to connect to a unbound port, then you’ll get the following exception:
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: square.lineapi.line-apps-beta.com/10.127.103.71:34773
at io.netty.channel.unix.Socket.finishConnect(..)(Unknown Source)
Caused by: io.netty.channel.unix.Errors$NativeConnectException: syscall:getsockopt(..) failed: Connection refused
... 1 more
This gives a user an impression that the connection attempt failed while trying to get some socket option, which doesn’t sound right, given that the exception occurred during finishConnect()
.
Netty version
4.1.9
OS version (e.g. uname -a
)
Linux infinity 4.9.0-0.bpo.2-amd64 #1 SMP Debian 4.9.13-1~bpo8+1 (2017-02-27) x86_64 GNU/Linux
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
How to Fix the ERR_CONNECTION_REFUSED Error in Chrome
The ERR_CONNECTION_REFUSED error is sometimes caused by a server-side problem, rather than an issue with your individual attempt at connection.
Read more >What causes the 'Connection Refused' message? - Server Fault
The message 'Connection Refused' has two main causes: Nothing is listening on the IP:Port you are trying to connect to. The port is...
Read more >What can be the reasons of connection refused errors?
Firewalls would normally give timeout errors, as the connect (SYN) packet is just discarded. Connection refused is because the server has received and...
Read more >How to Resolve Java.net.Connectexception: connection refused
The Java.net.ConnectException: Connection refused error comes when you try to make a TCP connection from the client to the server. A similar ...
Read more >How to Fix java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused Error – Possible reasons · 1) Client and Server, either or both of them are not in the network. ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m saying the fact that syscall getsocketopt() has been failed is an implementation detail and AnnotatedConnectException doesn’t need to show it to a user to misunderstand.
It is working now!