question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception message of 'connection refused' is confusing

See original GitHub issue

Expected 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:open
  • Created 6 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
trustincommented, Apr 19, 2017

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.

0reactions
BlessedLcommented, May 17, 2017

It is working now!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found