What causes the 'Connection Refused' message? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Come Celebrate our 10 Year Anniversary!Connection Refused for Apache 2.4 Virtual HostPort 80: connection refused. How to fix on Mac OSX?Installing gitosis and closed port?502 Bad Gateway/ failed (111: Connection refused) while connecting to upstreamCentOS server refusing all connections except for ssh telnet and httpfailed (111: Connection refused) while connecting to upstream pythonWhat is stopping my Visual JVM remote connection?Port is listening but cannot connect from remoteUnable to SSH into EC2 Ubuntu Instance port 22:Connection RefusedUnable to connect to remote host: Connection refusedHow does IPv4 Subnetting Work?I've inherited a rat's nest of cabling. What now?Yum fails with [Errno 4] IOError: <urlopen error (111, 'Connection refused')> but TCP traceroute worksOpenShift: MySQL PDO 'connection refused', works locallyConnection refused on RHEL localhost with running serverdebugging “connection refused” in AWS EC2 ubuntu serverWin 2012 R2 / IIS 8.5 intermittent Connection RefusedError 10061: No connection could be made because the target machine actively refused itunix:////tmp/supervisor.sock refused connectionConnection refused when accessing container from local network through reverse proxy
What exactly is a "Meth" in Altered Carbon?
Are two submodules (where one is contained in the other) isomorphic if their quotientmodules are isomorphic?
Echoing a tail command produces unexpected output?
Should I use a zero-interest credit card for a large one-time purchase?
Using audio cues to encourage good posture
How to find all the available tools in macOS terminal?
What does an IRS interview request entail when called in to verify expenses for a sole proprietor small business?
English words in a non-english sci-fi novel
Output the ŋarâþ crîþ alphabet song without using (m)any letters
Fundamental Solution of the Pell Equation
What causes the vertical darker bands in my photo?
String `!23` is replaced with `docker` in command line
Why is "Consequences inflicted." not a sentence?
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
What are the pros and cons of Aerospike nosecones?
Is it true that "carbohydrates are of no use for the basal metabolic need"?
How do I stop a creek from eroding my steep embankment?
What would be the ideal power source for a cybernetic eye?
How to tell that you are a giant?
How to call a function with default parameter through a pointer to function that is the return of another function?
Single word antonym of "flightless"
Do I really need recursive chmod to restrict access to a folder?
3 doors, three guards, one stone
What does this icon in iOS Stardew Valley mean?
What causes the 'Connection Refused' message?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Come Celebrate our 10 Year Anniversary!Connection Refused for Apache 2.4 Virtual HostPort 80: connection refused. How to fix on Mac OSX?Installing gitosis and closed port?502 Bad Gateway/ failed (111: Connection refused) while connecting to upstreamCentOS server refusing all connections except for ssh telnet and httpfailed (111: Connection refused) while connecting to upstream pythonWhat is stopping my Visual JVM remote connection?Port is listening but cannot connect from remoteUnable to SSH into EC2 Ubuntu Instance port 22:Connection RefusedUnable to connect to remote host: Connection refusedHow does IPv4 Subnetting Work?I've inherited a rat's nest of cabling. What now?Yum fails with [Errno 4] IOError: <urlopen error (111, 'Connection refused')> but TCP traceroute worksOpenShift: MySQL PDO 'connection refused', works locallyConnection refused on RHEL localhost with running serverdebugging “connection refused” in AWS EC2 ubuntu serverWin 2012 R2 / IIS 8.5 intermittent Connection RefusedError 10061: No connection could be made because the target machine actively refused itunix:////tmp/supervisor.sock refused connectionConnection refused when accessing container from local network through reverse proxy
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
This is a Canonical Question about Connection Refused
We see a lot of questions to the effect
When I try to connect to a system I get a message
Connection refused
Why is this ?
networking connection-refused
|
show 1 more comment
This is a Canonical Question about Connection Refused
We see a lot of questions to the effect
When I try to connect to a system I get a message
Connection refused
Why is this ?
networking connection-refused
2
We get this a lot in Apache Hadoop, where it is often caused by configuration errors in the client: which host to talk to, what their DNS or /etc/host tables are set up to, or a mismatch between the ports used by a service and that the clients thinks it should use. Accordingly, we have a dedicated wiki entry on the topic. Many of the problems are likely elsewhere, albeit (hopefuily) on a smaller scale. Debugging connection problems in a 1000 node cluster is not fun.
– Steve Loughran
Jan 3 '17 at 12:28
Your dedicated wiki entry link points to this question ;)
– Iain
Jan 3 '17 at 12:46
1
good catch. Here is the official link: wiki.apache.org/hadoop/ConnectionRefused. I'll add a cross reference back from there to here for that full loop though.
– Steve Loughran
Jan 6 '17 at 14:19
@SteveLoughran Cool article - one comment - the link back says Stack Overflow and we're Server Fault ;)
– Iain
Jan 6 '17 at 14:27
done. FWIW, that wiki link is added to ConnectionRefused exceptions passed up in the Hadoop stack, along with the extra info (hosts, ports) needed to work out what is going wrong. We still get lots of bug reports from people who see the stack trace and don't follow the link to the wiki
– Steve Loughran
Jan 6 '17 at 14:39
|
show 1 more comment
This is a Canonical Question about Connection Refused
We see a lot of questions to the effect
When I try to connect to a system I get a message
Connection refused
Why is this ?
networking connection-refused
This is a Canonical Question about Connection Refused
We see a lot of questions to the effect
When I try to connect to a system I get a message
Connection refused
Why is this ?
networking connection-refused
networking connection-refused
edited Sep 28 '15 at 16:54
HBruijn
56.5k1190150
56.5k1190150
asked Sep 28 '15 at 12:13
IainIain
105k14164258
105k14164258
2
We get this a lot in Apache Hadoop, where it is often caused by configuration errors in the client: which host to talk to, what their DNS or /etc/host tables are set up to, or a mismatch between the ports used by a service and that the clients thinks it should use. Accordingly, we have a dedicated wiki entry on the topic. Many of the problems are likely elsewhere, albeit (hopefuily) on a smaller scale. Debugging connection problems in a 1000 node cluster is not fun.
– Steve Loughran
Jan 3 '17 at 12:28
Your dedicated wiki entry link points to this question ;)
– Iain
Jan 3 '17 at 12:46
1
good catch. Here is the official link: wiki.apache.org/hadoop/ConnectionRefused. I'll add a cross reference back from there to here for that full loop though.
– Steve Loughran
Jan 6 '17 at 14:19
@SteveLoughran Cool article - one comment - the link back says Stack Overflow and we're Server Fault ;)
– Iain
Jan 6 '17 at 14:27
done. FWIW, that wiki link is added to ConnectionRefused exceptions passed up in the Hadoop stack, along with the extra info (hosts, ports) needed to work out what is going wrong. We still get lots of bug reports from people who see the stack trace and don't follow the link to the wiki
– Steve Loughran
Jan 6 '17 at 14:39
|
show 1 more comment
2
We get this a lot in Apache Hadoop, where it is often caused by configuration errors in the client: which host to talk to, what their DNS or /etc/host tables are set up to, or a mismatch between the ports used by a service and that the clients thinks it should use. Accordingly, we have a dedicated wiki entry on the topic. Many of the problems are likely elsewhere, albeit (hopefuily) on a smaller scale. Debugging connection problems in a 1000 node cluster is not fun.
– Steve Loughran
Jan 3 '17 at 12:28
Your dedicated wiki entry link points to this question ;)
– Iain
Jan 3 '17 at 12:46
1
good catch. Here is the official link: wiki.apache.org/hadoop/ConnectionRefused. I'll add a cross reference back from there to here for that full loop though.
– Steve Loughran
Jan 6 '17 at 14:19
@SteveLoughran Cool article - one comment - the link back says Stack Overflow and we're Server Fault ;)
– Iain
Jan 6 '17 at 14:27
done. FWIW, that wiki link is added to ConnectionRefused exceptions passed up in the Hadoop stack, along with the extra info (hosts, ports) needed to work out what is going wrong. We still get lots of bug reports from people who see the stack trace and don't follow the link to the wiki
– Steve Loughran
Jan 6 '17 at 14:39
2
2
We get this a lot in Apache Hadoop, where it is often caused by configuration errors in the client: which host to talk to, what their DNS or /etc/host tables are set up to, or a mismatch between the ports used by a service and that the clients thinks it should use. Accordingly, we have a dedicated wiki entry on the topic. Many of the problems are likely elsewhere, albeit (hopefuily) on a smaller scale. Debugging connection problems in a 1000 node cluster is not fun.
– Steve Loughran
Jan 3 '17 at 12:28
We get this a lot in Apache Hadoop, where it is often caused by configuration errors in the client: which host to talk to, what their DNS or /etc/host tables are set up to, or a mismatch between the ports used by a service and that the clients thinks it should use. Accordingly, we have a dedicated wiki entry on the topic. Many of the problems are likely elsewhere, albeit (hopefuily) on a smaller scale. Debugging connection problems in a 1000 node cluster is not fun.
– Steve Loughran
Jan 3 '17 at 12:28
Your dedicated wiki entry link points to this question ;)
– Iain
Jan 3 '17 at 12:46
Your dedicated wiki entry link points to this question ;)
– Iain
Jan 3 '17 at 12:46
1
1
good catch. Here is the official link: wiki.apache.org/hadoop/ConnectionRefused. I'll add a cross reference back from there to here for that full loop though.
– Steve Loughran
Jan 6 '17 at 14:19
good catch. Here is the official link: wiki.apache.org/hadoop/ConnectionRefused. I'll add a cross reference back from there to here for that full loop though.
– Steve Loughran
Jan 6 '17 at 14:19
@SteveLoughran Cool article - one comment - the link back says Stack Overflow and we're Server Fault ;)
– Iain
Jan 6 '17 at 14:27
@SteveLoughran Cool article - one comment - the link back says Stack Overflow and we're Server Fault ;)
– Iain
Jan 6 '17 at 14:27
done. FWIW, that wiki link is added to ConnectionRefused exceptions passed up in the Hadoop stack, along with the extra info (hosts, ports) needed to work out what is going wrong. We still get lots of bug reports from people who see the stack trace and don't follow the link to the wiki
– Steve Loughran
Jan 6 '17 at 14:39
done. FWIW, that wiki link is added to ConnectionRefused exceptions passed up in the Hadoop stack, along with the extra info (hosts, ports) needed to work out what is going wrong. We still get lots of bug reports from people who see the stack trace and don't follow the link to the wiki
– Steve Loughran
Jan 6 '17 at 14:39
|
show 1 more comment
3 Answers
3
active
oldest
votes
Note: This message is a symptom of the problem you are trying to solve. Understanding the cause of the message will ultimately lead you to solving your problem.
The message 'Connection Refused' has two main causes:
- Nothing is listening on the IP:Port you are trying to connect to.
- The port is blocked by a firewall.
No process is listening.
This is by far the most common reason for the message. First ensure that you are trying to connect to the correct system. If you are then to determine if this is the problem, on the remote system run netstat or ss1 e.g. if you are expecting a process to be listening on port 22222
sudo netstat -tnlp | grep :22222
or
ss -tnlp | grep :22222
For OSX a suitable command is
sudo netstat -tnlp tcp | grep '.80 '
If nothing is listening then the above will produce no output. If you see some output then confirm that it's what you expect then see the firewall section below.
If you don't have access to the remote system and want to confirm the problem before reporting it to the relevant administrators you can use tcpdump (wireshark or similar).
When a connection is attempted to an IP:port where nothing is listening, the response from the remote system to the initial SYN packet is a packet with the flags RST,ACK set. This closes the connection and causes the Connection Refused message e.g.
$ sudo tcpdump -n host 192.0.2.1 and port 22222
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
12:31:27.013976 IP 192.0.2.2.34390 > 192.0.2.1.22222: Flags [S], seq 1207858804, win 29200, options [mss 1460,sackOK,TS val 15306344 ecr 0,nop,wscale 7], length 0
12:31:27.020162 IP 192.0.2.1.22222 > 192.0.2.2.34390: Flags [R.], seq 0, ack 1207858805, win 0, length 0
Note that tcpdump uses a . to represent the ACK flag.
Port is blocked by a firewall
If the port is blocked by a firewall and the firewall has been configured to respond with icmp-port-unreachable this will also cause a connection refused message. Again you can see this with tcpdump (or similar)
$ sudo tcpdump -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:03:24.149897 IP 192.0.2.1 > 192.0.2.2: ICMP 192.0.2.1 tcp port 22222 unreachable, length 68
Note that this also tells us where the blocking firewall is.
So now you know what's causing the Connection refused message you should take appropriate action e.g. contact the firewall administrator or investigate the reason for the process not listening.
1 Other tools are likely available.
1
ELI5 version: it means the connection request got to the other computer, and the other computer had no clue what you were talking about.
– immibis
Sep 29 '15 at 1:56
"No process is listening." The major reason ..!
– Samitha Chathuranga
Dec 11 '17 at 13:11
In my case, something was listening… but on a different node that the one I was attempting to connect to. Oops.
– ijoseph
Sep 7 '18 at 21:05
1
@ijoseph So nothing was listening then.
– Iain
Sep 30 '18 at 12:21
@Iain if a tree doesn't fall in the forest and the forest is completely quiet, are the other trees listening?
– ijoseph
Sep 30 '18 at 23:44
|
show 2 more comments
For me on Debian 6 squeeze it was as simple as checking the SSH service:
sudo service ssh status
And finding nothing existed (with the message ssh: unrecognized service) just installing the service:
sudo apt-get install openssh-server
This also works if you're not getting an SFTP connection, as SFTP is a subset of SSH (whereas FTPS is a subset of FTP).
add a comment |
My Centos Shorewall firewall had run out of disk space. confusingly, some sites, like youtube and MS worked. Others like cnn.com failed. Clearing some space and restarting the server fixed the issue for me.
add a comment |
protected by Michael Hampton♦ Nov 3 '16 at 15:06
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Note: This message is a symptom of the problem you are trying to solve. Understanding the cause of the message will ultimately lead you to solving your problem.
The message 'Connection Refused' has two main causes:
- Nothing is listening on the IP:Port you are trying to connect to.
- The port is blocked by a firewall.
No process is listening.
This is by far the most common reason for the message. First ensure that you are trying to connect to the correct system. If you are then to determine if this is the problem, on the remote system run netstat or ss1 e.g. if you are expecting a process to be listening on port 22222
sudo netstat -tnlp | grep :22222
or
ss -tnlp | grep :22222
For OSX a suitable command is
sudo netstat -tnlp tcp | grep '.80 '
If nothing is listening then the above will produce no output. If you see some output then confirm that it's what you expect then see the firewall section below.
If you don't have access to the remote system and want to confirm the problem before reporting it to the relevant administrators you can use tcpdump (wireshark or similar).
When a connection is attempted to an IP:port where nothing is listening, the response from the remote system to the initial SYN packet is a packet with the flags RST,ACK set. This closes the connection and causes the Connection Refused message e.g.
$ sudo tcpdump -n host 192.0.2.1 and port 22222
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
12:31:27.013976 IP 192.0.2.2.34390 > 192.0.2.1.22222: Flags [S], seq 1207858804, win 29200, options [mss 1460,sackOK,TS val 15306344 ecr 0,nop,wscale 7], length 0
12:31:27.020162 IP 192.0.2.1.22222 > 192.0.2.2.34390: Flags [R.], seq 0, ack 1207858805, win 0, length 0
Note that tcpdump uses a . to represent the ACK flag.
Port is blocked by a firewall
If the port is blocked by a firewall and the firewall has been configured to respond with icmp-port-unreachable this will also cause a connection refused message. Again you can see this with tcpdump (or similar)
$ sudo tcpdump -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:03:24.149897 IP 192.0.2.1 > 192.0.2.2: ICMP 192.0.2.1 tcp port 22222 unreachable, length 68
Note that this also tells us where the blocking firewall is.
So now you know what's causing the Connection refused message you should take appropriate action e.g. contact the firewall administrator or investigate the reason for the process not listening.
1 Other tools are likely available.
1
ELI5 version: it means the connection request got to the other computer, and the other computer had no clue what you were talking about.
– immibis
Sep 29 '15 at 1:56
"No process is listening." The major reason ..!
– Samitha Chathuranga
Dec 11 '17 at 13:11
In my case, something was listening… but on a different node that the one I was attempting to connect to. Oops.
– ijoseph
Sep 7 '18 at 21:05
1
@ijoseph So nothing was listening then.
– Iain
Sep 30 '18 at 12:21
@Iain if a tree doesn't fall in the forest and the forest is completely quiet, are the other trees listening?
– ijoseph
Sep 30 '18 at 23:44
|
show 2 more comments
Note: This message is a symptom of the problem you are trying to solve. Understanding the cause of the message will ultimately lead you to solving your problem.
The message 'Connection Refused' has two main causes:
- Nothing is listening on the IP:Port you are trying to connect to.
- The port is blocked by a firewall.
No process is listening.
This is by far the most common reason for the message. First ensure that you are trying to connect to the correct system. If you are then to determine if this is the problem, on the remote system run netstat or ss1 e.g. if you are expecting a process to be listening on port 22222
sudo netstat -tnlp | grep :22222
or
ss -tnlp | grep :22222
For OSX a suitable command is
sudo netstat -tnlp tcp | grep '.80 '
If nothing is listening then the above will produce no output. If you see some output then confirm that it's what you expect then see the firewall section below.
If you don't have access to the remote system and want to confirm the problem before reporting it to the relevant administrators you can use tcpdump (wireshark or similar).
When a connection is attempted to an IP:port where nothing is listening, the response from the remote system to the initial SYN packet is a packet with the flags RST,ACK set. This closes the connection and causes the Connection Refused message e.g.
$ sudo tcpdump -n host 192.0.2.1 and port 22222
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
12:31:27.013976 IP 192.0.2.2.34390 > 192.0.2.1.22222: Flags [S], seq 1207858804, win 29200, options [mss 1460,sackOK,TS val 15306344 ecr 0,nop,wscale 7], length 0
12:31:27.020162 IP 192.0.2.1.22222 > 192.0.2.2.34390: Flags [R.], seq 0, ack 1207858805, win 0, length 0
Note that tcpdump uses a . to represent the ACK flag.
Port is blocked by a firewall
If the port is blocked by a firewall and the firewall has been configured to respond with icmp-port-unreachable this will also cause a connection refused message. Again you can see this with tcpdump (or similar)
$ sudo tcpdump -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:03:24.149897 IP 192.0.2.1 > 192.0.2.2: ICMP 192.0.2.1 tcp port 22222 unreachable, length 68
Note that this also tells us where the blocking firewall is.
So now you know what's causing the Connection refused message you should take appropriate action e.g. contact the firewall administrator or investigate the reason for the process not listening.
1 Other tools are likely available.
1
ELI5 version: it means the connection request got to the other computer, and the other computer had no clue what you were talking about.
– immibis
Sep 29 '15 at 1:56
"No process is listening." The major reason ..!
– Samitha Chathuranga
Dec 11 '17 at 13:11
In my case, something was listening… but on a different node that the one I was attempting to connect to. Oops.
– ijoseph
Sep 7 '18 at 21:05
1
@ijoseph So nothing was listening then.
– Iain
Sep 30 '18 at 12:21
@Iain if a tree doesn't fall in the forest and the forest is completely quiet, are the other trees listening?
– ijoseph
Sep 30 '18 at 23:44
|
show 2 more comments
Note: This message is a symptom of the problem you are trying to solve. Understanding the cause of the message will ultimately lead you to solving your problem.
The message 'Connection Refused' has two main causes:
- Nothing is listening on the IP:Port you are trying to connect to.
- The port is blocked by a firewall.
No process is listening.
This is by far the most common reason for the message. First ensure that you are trying to connect to the correct system. If you are then to determine if this is the problem, on the remote system run netstat or ss1 e.g. if you are expecting a process to be listening on port 22222
sudo netstat -tnlp | grep :22222
or
ss -tnlp | grep :22222
For OSX a suitable command is
sudo netstat -tnlp tcp | grep '.80 '
If nothing is listening then the above will produce no output. If you see some output then confirm that it's what you expect then see the firewall section below.
If you don't have access to the remote system and want to confirm the problem before reporting it to the relevant administrators you can use tcpdump (wireshark or similar).
When a connection is attempted to an IP:port where nothing is listening, the response from the remote system to the initial SYN packet is a packet with the flags RST,ACK set. This closes the connection and causes the Connection Refused message e.g.
$ sudo tcpdump -n host 192.0.2.1 and port 22222
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
12:31:27.013976 IP 192.0.2.2.34390 > 192.0.2.1.22222: Flags [S], seq 1207858804, win 29200, options [mss 1460,sackOK,TS val 15306344 ecr 0,nop,wscale 7], length 0
12:31:27.020162 IP 192.0.2.1.22222 > 192.0.2.2.34390: Flags [R.], seq 0, ack 1207858805, win 0, length 0
Note that tcpdump uses a . to represent the ACK flag.
Port is blocked by a firewall
If the port is blocked by a firewall and the firewall has been configured to respond with icmp-port-unreachable this will also cause a connection refused message. Again you can see this with tcpdump (or similar)
$ sudo tcpdump -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:03:24.149897 IP 192.0.2.1 > 192.0.2.2: ICMP 192.0.2.1 tcp port 22222 unreachable, length 68
Note that this also tells us where the blocking firewall is.
So now you know what's causing the Connection refused message you should take appropriate action e.g. contact the firewall administrator or investigate the reason for the process not listening.
1 Other tools are likely available.
Note: This message is a symptom of the problem you are trying to solve. Understanding the cause of the message will ultimately lead you to solving your problem.
The message 'Connection Refused' has two main causes:
- Nothing is listening on the IP:Port you are trying to connect to.
- The port is blocked by a firewall.
No process is listening.
This is by far the most common reason for the message. First ensure that you are trying to connect to the correct system. If you are then to determine if this is the problem, on the remote system run netstat or ss1 e.g. if you are expecting a process to be listening on port 22222
sudo netstat -tnlp | grep :22222
or
ss -tnlp | grep :22222
For OSX a suitable command is
sudo netstat -tnlp tcp | grep '.80 '
If nothing is listening then the above will produce no output. If you see some output then confirm that it's what you expect then see the firewall section below.
If you don't have access to the remote system and want to confirm the problem before reporting it to the relevant administrators you can use tcpdump (wireshark or similar).
When a connection is attempted to an IP:port where nothing is listening, the response from the remote system to the initial SYN packet is a packet with the flags RST,ACK set. This closes the connection and causes the Connection Refused message e.g.
$ sudo tcpdump -n host 192.0.2.1 and port 22222
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
12:31:27.013976 IP 192.0.2.2.34390 > 192.0.2.1.22222: Flags [S], seq 1207858804, win 29200, options [mss 1460,sackOK,TS val 15306344 ecr 0,nop,wscale 7], length 0
12:31:27.020162 IP 192.0.2.1.22222 > 192.0.2.2.34390: Flags [R.], seq 0, ack 1207858805, win 0, length 0
Note that tcpdump uses a . to represent the ACK flag.
Port is blocked by a firewall
If the port is blocked by a firewall and the firewall has been configured to respond with icmp-port-unreachable this will also cause a connection refused message. Again you can see this with tcpdump (or similar)
$ sudo tcpdump -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp14s0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:03:24.149897 IP 192.0.2.1 > 192.0.2.2: ICMP 192.0.2.1 tcp port 22222 unreachable, length 68
Note that this also tells us where the blocking firewall is.
So now you know what's causing the Connection refused message you should take appropriate action e.g. contact the firewall administrator or investigate the reason for the process not listening.
1 Other tools are likely available.
edited Feb 7 '17 at 9:57
HBruijn
56.5k1190150
56.5k1190150
answered Sep 28 '15 at 12:13
IainIain
105k14164258
105k14164258
1
ELI5 version: it means the connection request got to the other computer, and the other computer had no clue what you were talking about.
– immibis
Sep 29 '15 at 1:56
"No process is listening." The major reason ..!
– Samitha Chathuranga
Dec 11 '17 at 13:11
In my case, something was listening… but on a different node that the one I was attempting to connect to. Oops.
– ijoseph
Sep 7 '18 at 21:05
1
@ijoseph So nothing was listening then.
– Iain
Sep 30 '18 at 12:21
@Iain if a tree doesn't fall in the forest and the forest is completely quiet, are the other trees listening?
– ijoseph
Sep 30 '18 at 23:44
|
show 2 more comments
1
ELI5 version: it means the connection request got to the other computer, and the other computer had no clue what you were talking about.
– immibis
Sep 29 '15 at 1:56
"No process is listening." The major reason ..!
– Samitha Chathuranga
Dec 11 '17 at 13:11
In my case, something was listening… but on a different node that the one I was attempting to connect to. Oops.
– ijoseph
Sep 7 '18 at 21:05
1
@ijoseph So nothing was listening then.
– Iain
Sep 30 '18 at 12:21
@Iain if a tree doesn't fall in the forest and the forest is completely quiet, are the other trees listening?
– ijoseph
Sep 30 '18 at 23:44
1
1
ELI5 version: it means the connection request got to the other computer, and the other computer had no clue what you were talking about.
– immibis
Sep 29 '15 at 1:56
ELI5 version: it means the connection request got to the other computer, and the other computer had no clue what you were talking about.
– immibis
Sep 29 '15 at 1:56
"No process is listening." The major reason ..!
– Samitha Chathuranga
Dec 11 '17 at 13:11
"No process is listening." The major reason ..!
– Samitha Chathuranga
Dec 11 '17 at 13:11
In my case, something was listening… but on a different node that the one I was attempting to connect to. Oops.
– ijoseph
Sep 7 '18 at 21:05
In my case, something was listening… but on a different node that the one I was attempting to connect to. Oops.
– ijoseph
Sep 7 '18 at 21:05
1
1
@ijoseph So nothing was listening then.
– Iain
Sep 30 '18 at 12:21
@ijoseph So nothing was listening then.
– Iain
Sep 30 '18 at 12:21
@Iain if a tree doesn't fall in the forest and the forest is completely quiet, are the other trees listening?
– ijoseph
Sep 30 '18 at 23:44
@Iain if a tree doesn't fall in the forest and the forest is completely quiet, are the other trees listening?
– ijoseph
Sep 30 '18 at 23:44
|
show 2 more comments
For me on Debian 6 squeeze it was as simple as checking the SSH service:
sudo service ssh status
And finding nothing existed (with the message ssh: unrecognized service) just installing the service:
sudo apt-get install openssh-server
This also works if you're not getting an SFTP connection, as SFTP is a subset of SSH (whereas FTPS is a subset of FTP).
add a comment |
For me on Debian 6 squeeze it was as simple as checking the SSH service:
sudo service ssh status
And finding nothing existed (with the message ssh: unrecognized service) just installing the service:
sudo apt-get install openssh-server
This also works if you're not getting an SFTP connection, as SFTP is a subset of SSH (whereas FTPS is a subset of FTP).
add a comment |
For me on Debian 6 squeeze it was as simple as checking the SSH service:
sudo service ssh status
And finding nothing existed (with the message ssh: unrecognized service) just installing the service:
sudo apt-get install openssh-server
This also works if you're not getting an SFTP connection, as SFTP is a subset of SSH (whereas FTPS is a subset of FTP).
For me on Debian 6 squeeze it was as simple as checking the SSH service:
sudo service ssh status
And finding nothing existed (with the message ssh: unrecognized service) just installing the service:
sudo apt-get install openssh-server
This also works if you're not getting an SFTP connection, as SFTP is a subset of SSH (whereas FTPS is a subset of FTP).
answered May 16 '16 at 9:39
SharpCSharpC
1652
1652
add a comment |
add a comment |
My Centos Shorewall firewall had run out of disk space. confusingly, some sites, like youtube and MS worked. Others like cnn.com failed. Clearing some space and restarting the server fixed the issue for me.
add a comment |
My Centos Shorewall firewall had run out of disk space. confusingly, some sites, like youtube and MS worked. Others like cnn.com failed. Clearing some space and restarting the server fixed the issue for me.
add a comment |
My Centos Shorewall firewall had run out of disk space. confusingly, some sites, like youtube and MS worked. Others like cnn.com failed. Clearing some space and restarting the server fixed the issue for me.
My Centos Shorewall firewall had run out of disk space. confusingly, some sites, like youtube and MS worked. Others like cnn.com failed. Clearing some space and restarting the server fixed the issue for me.
answered Nov 3 '16 at 13:19
Mike RossMike Ross
11
11
add a comment |
add a comment |
protected by Michael Hampton♦ Nov 3 '16 at 15:06
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
2
We get this a lot in Apache Hadoop, where it is often caused by configuration errors in the client: which host to talk to, what their DNS or /etc/host tables are set up to, or a mismatch between the ports used by a service and that the clients thinks it should use. Accordingly, we have a dedicated wiki entry on the topic. Many of the problems are likely elsewhere, albeit (hopefuily) on a smaller scale. Debugging connection problems in a 1000 node cluster is not fun.
– Steve Loughran
Jan 3 '17 at 12:28
Your dedicated wiki entry link points to this question ;)
– Iain
Jan 3 '17 at 12:46
1
good catch. Here is the official link: wiki.apache.org/hadoop/ConnectionRefused. I'll add a cross reference back from there to here for that full loop though.
– Steve Loughran
Jan 6 '17 at 14:19
@SteveLoughran Cool article - one comment - the link back says Stack Overflow and we're Server Fault ;)
– Iain
Jan 6 '17 at 14:27
done. FWIW, that wiki link is added to ConnectionRefused exceptions passed up in the Hadoop stack, along with the extra info (hosts, ports) needed to work out what is going wrong. We still get lots of bug reports from people who see the stack trace and don't follow the link to the wiki
– Steve Loughran
Jan 6 '17 at 14:39