Solution: Error 111 - Connection Refused
colingoodman opened this issue ยท 5 comments
I had been having this recurring issue where mcrcon inexplicably breaks. Looking online, it appears that others have had this issue and (like me) failed to find a solution. I suspect that this fork/project is just out of date and abandoned.
For those of you using something like this guide to set up your server infrastructure, this mcrcon issue breaks a lot of stuff. The solution is to use the screen
tool to run the server instead:
screen java -Xmx1024M -Xms512M -jar server.jar nogui
You should update any systemd processes accordingly. You can find information on screen
here. The server instance thus runs in the background, and you can access the console at any point with screen -r
.
Hi I'm facing the same problem with mcrcon. When I try to execute opt/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 25575 I get the error 111: Connection refused.
But when I use the external address of the server instead of 127.0.0.1, everything is working fine. That bothers me, because I don't want to route unnecessary traffic over the internet.
@colingoodman could you please elaborate how I can use screen in my systemd service? I made some tries, but the server will not start.
Regards,
Night
Generally that is the error you get when there is nothing listening on the socket yet (for example, during startup before rcon starts). Is your server bound to a particular IP address (server-ip in server.properties is set the the external IP, for example).
Hello everyone,
@sludin is right. This error indicates that there is nothing listening the port or perhaps firewall etc. is blocking mcrcon from connecting.
I guess the first step is to check if server is really starting rcon listener.
Check if your server log has something like this: [RCON Listener #1/INFO]: RCON running on 0.0.0.0:25575
You can also use netstat to confirm that the server is really listening on rcon port: netstat -pnltu | grep 25575
Output should be something like this: tcp6 0 0 :::25575 :::* LISTEN 10584/java
Is your server bound to a particular IP address (server-ip in server.properties is set the the external IP, for example).
Check this also.
Hi everyone,
thanks a lot for you support. Yes my server is bound to a particular IP address. My thought was that if I ran mcrcon on the same OS as the minecraft server, I can reach it with 127.0.0.1. Maybe I got something wrong. If I use the external IP address, mcrcon is working fine. I hope the traffic doesn't leave the machine by using the external IP.
from my side, this topic can be closed (or marked as solved?).
Best regards,
Nils
When you explicitly bind to an IP ( setting server-ip in this case ) you are effectively saying "listen ONLY on this IP". This is useful when you have a machine with multiple interfaces (eg. a gateway box splitting a LAN/WAN or a server splitting services by IP). If you do not have one of those situations then leaving server-ip empty would be best. In that case it binds to 0.0.0.0 which means, "any interface" on the machine, including localhost (127.0.0.1). It is possible to bind a server to multiple IPs explicitly, but a quick check of the minecraft server code shows that it is not set up to do that.
If your traffic targets a local interface (ip) of the machine those packets will not leave that machine (note that this is not impossible, but I am not aware of any implementations, virtual or physical that would do that).