-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting via RCON has issues #19
Comments
Since you're running the server in a docker container, you probably need to expose the ports from the container to your host machine. I imagine you are already doing something like docker run -p 25565:25565 -p 25525:25525 ... If the backup script/cron is also in a docker container, then you will need to set up docker networking so that the RCON is reachable. |
(Also I recommend updating the script as the current version has better error handling for the case where we get the |
Gotcha I'll update the script, and do I need any other files from the github besides backup.sh? I'm thinking I might be supposed to download rcon.sh as well but there's other files you've included as well and I also don't know what the usage of rcon.sh would be. |
You shouldn't need any other scripts since I've included the contents of |
Ok I figured out the issue; in order for RCON to work I needed to use my internal IP instead of localhost for the parameter I set in SCREEN_NAME. Maybe my host file is messed up idk but it doesn't matter now lol. My only issue now is I get |
Which file does it say changed? If it's The |
If you like, you could edit |
So adding the sleep 30 didn't fix it, but I seem to have created another issue somehow that I don't understand. It says |
If you could provide a paste of your |
This is the file I changed the extension to .txt because github doesn't support .sh files, but another important thing to note is that for some reason it doesn't always make the error happen. It will show the error about every other time. I have another script running at the same time with the crontab, so I'm thinking it could be the other script conflicting with RCON running while this one is running. |
Thanks for that. I'm not sure why it's intermittently occurring, but my guess is that there is some issue with the RCON. In the line that's causing the error, the script expects a number but RCON gives it something else. It's supposed to respond with the previous request ID when the password is correct and -1 otherwise. I've pushed a change to handle this other case, but I do think there's some issue with the RCON connection if this error occurs. |
In my mail file, the cronjob gave this error. There are 2 servers running on this computer and they both have the same errors but just with different ports (the one I'm showing is port 25525 with Minecraft12345 as the password and the other one uses 25575 with the same password). I allowed the ports through UFW, but didn't port forward on my router since as far as I know I would only need to do that if I gave my external IP address to the script. When the server is started in the docker container, it says "RCON running on 0.0.0.0:25525". I tried making the cronjob use 0.0.0.0:25525:Minecraft12345 but it still prints out the exact same error messages as below saying it's using localhost. I was going to try without a password but I just realized RCON doesn't work without a password. My servers are running in docker containers and all required ports are exposed.
Subject: Cron wes@wgserver /var/lib/pterodactyl/volumes/backup.sh -c -s localhost:25525:Minecraft*12345 -w$
/var/lib/pterodactyl/volumes/backup.sh: connect: Connection refused
/var/lib/pterodactyl/volumes/backup.sh: line 180: /dev/tcp/localhost/25525: Connection refused
^[[0;33mWARNING:^[[0m RCON connection failed: Could not connect to localhost:25525
/var/lib/pterodactyl/volumes/backup.sh: connect: Connection refused
/var/lib/pterodactyl/volumes/backup.sh: line 180: /dev/tcp/localhost/25525: Connection refused
^[[0;33mWARNING:^[[0m RCON connection failed: Could not connect to localhost:25525
tar: .: file changed as we read it
^[[0;31mFATAL:^[[0m Archive command exited with nonzero exit code 1
/var/lib/pterodactyl/volumes/backup.sh: connect: Connection refused
/var/lib/pterodactyl/volumes/backup.sh: line 180: /dev/tcp/localhost/25525: Connection refused
^[[0;33mWARNING:^[[0m RCON connection failed: Could not connect to localhost:25525
/var/lib/pterodactyl/volumes/backup.sh: connect: Connection refused
/var/lib/pterodactyl/volumes/backup.sh: line 180: /dev/tcp/localhost/25525: Connection refused
^[[0;33mWARNING:^[[0m RCON connection failed: Could not connect to localhost:25525
/var/lib/pterodactyl/volumes/backup.sh: connect: Connection refused
/var/lib/pterodactyl/volumes/backup.sh: line 180: /dev/tcp/localhost/25525: Connection refused
^[[0;33mWARNING:^[[0m RCON connection failed: Could not connect to localhost:25525
The text was updated successfully, but these errors were encountered: