-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Autopause not resuming #555
Comments
@Oekn5w do you have any thoughts on how to investigate further? |
@michaelwijnands-zuyd in the meantime, if you can provide your compose file, that might help. |
Here's my compose file:
I use traefik-public as network but Traefik actually isn't handling the requests because the game didn't connect at all, so I just manually forwarded my port. I did this because I read in the readme that network mode 'host' isn't supported for autopause. |
Hmm, I think the network is important in this, with the compose I can't recreate it though (definition is external). I haven't worked with Traefik, I'm afraid. Two things that I would have tested if it worked:
|
How does Knocking work? Tried to knock through /bin/bash through the container of mc itself first:
Also tried |
knocking doesn't work from inside the container, because, as far as I understood, knockd latches itself to the interface, it doesn't listen on ports. The rcon port should be accessible from the traefik network, even when it is not directed from the host. knockd isn't started as service, it's started in
killall -SIGTERM knockd and running the above line (you're root in bash) without daemon. This should (a) print the interface it is attaching to in this configuration and (b) print some line when it is successfully knocked.
Running the rcon client from within the container does not knock the interface. Before it was merged we had the docker health command spawning healthchecks that tried to interact with the paused process and didn't time out (same scenario, accessing the MC port from within). Also host_network was declared unsupported because knockd couldn't attach to the host eth0. Can you provide the container's |
Hmm, maybe we should spawn a daemon for each interface, if that's what is causing problems |
I have the same issue with bridge network. Startring docker:
After 2 minutes server goes to sleep:
docker inspect mc-spigot:
|
FYI, latest image (and tagged at 1.8.0) includes knock 0.8.1-r0 |
i mean its the same thing with my server also, and now my minecraft altogether is autopausing |
@dnib1 can you please elaborate? What is your setup (which tag), how are you running the container? Keep in mind, that since the comments above I've added the ability to select the interface to listen to, so the information above might be outdated. |
I'm having the same issue, here is my docker-compose.yml
My server crashes everyday after some hours of pausing. It seems that the minecraft watchdog kills the server, cause the ticks took way to long. |
I believe I'm experiencing the same issue. The Java process autopauses, but it never wakes up. Is there something specific that I have to do to wake it up other than launch Minecraft and have it ping the server? |
@tekook from the readme in autopause:
I've just created a Forge server with your versions (and current java8 tag, one commit after @mcblum same as above (my previous comment), I need more information on this. What is your setup (which tag), how are you running the container? Can you provide a compose file and the relevant log entries? (Edited:) And no, the mere pinging from the Multiplayer tab in the client is sufficient to wake the process, if set correctly. |
@Oekn5w thanks for the info. |
appears to be the oldest open issue for this (#555, #651, and #744 that I have found). The short version seems to be that when AutoPause is enabled, the server eventually exits (gracefully) as the tick time exceeds the maximum allowed. per the linked issues, it does not seem that any other config setting affects it, just autopause. this is a server log file from a Paper minecraft server that was launched and no one ever logged on before it crashed. launch command: note that I have since removed autopause and have not been having the issue since. |
FYI, max-tick-time to -1 worked like a charm. |
@finndo77 it doesn't look like you disabled the watchdog by setting https://github.com/itzg/docker-minecraft-server#max-tick-time which is mentioned here https://github.com/itzg/docker-minecraft-server#autopause however, I do see now that it could be more explicit in how to disable the watchdog in the common case. |
...I have added more emphasis and details to https://github.com/itzg/docker-minecraft-server#autopause |
I'm seeing a similar issue to @finndo77. When the server starts from being paused it throws the same errors in his logs and causes the container to restart. I have max-tick-time=-1 and running the latest image. docker-compose.yaml
server.properties
Seems like it may be Spigot related but not sure what the resolution for this ticket was: https://hub.spigotmc.org/jira/browse/SPIGOT-6306 |
Hmm, that's weird it's trying a
In this image there's @mafiaboy01 did you make sure disable any watchdog Spigot is doing? You only showed the vanilla properties. |
It seems to be related to Spigot because I switched to Forge (I'm new to Minecraft so figuring out what type of server to run) which doesn't have this issue. From what I read seems like the max-tick-time paremeter in the spigot.yml needs to be set to 1000 do disable it.
But I haven't tested this myself. |
I have the same issue with a fabric server. Set max-tick-time to -1 and it never unpauses. I don't get anything in the log after |
For me the issue I think this line in /autopause/knockd-config.cfg: sudo /sbin/su-exec minecraft:minecraft /autopause/resume.sh I am not running as UID/GID 1000 .. if I manually run this with the correct user and group it resumes but not if I manually run the line above. |
Confirmed, see linked issue. Edit: Not confirmed, I didn't have the port forwarding set. Let's discuss in the issue I opened. |
I'm seeing something similar. I'm curious if it has to do with https://github.com/itzg/docker-minecraft-server/blob/master/files/autopause/autopause-daemon.sh#L98 The only way I've been able to get autopause to resume is to manually exec an rcon-cli connection like Snippet of output:
Command: I've disabled the max tick, overriding the server properties, and set a non-standard rcon port and password. Things look to work if an rcon-cli connection is made, but that's the only way. |
rcon is the only way to resume from inside the container. knockd handles the resuming independent from the autopause daemon. Are you sure that the tap0 interface is the correct one? Which other interfaces do you see in the container ( |
I went with |
Might there be a problem with me running the container with podman as a user vs docker as root? Podman with |
You could try --cap-add=NET_ADMIN instead of priveledged |
It needs privileged or to be ran as root. I might have some more time tomorrow to try root. Without privileged :
|
podmon runs the containers as non-root, correct? In that case, docker really might solve the issue, or something to have access to the interfaces |
It can and I am running it as a separate user just for security because the
server will be exposed to the internet. Tomorrow I might get a chance to
test a local one as root and will report back.
…On Sat, Jun 12, 2021 at 3:47 PM Michael Kirsch ***@***.***> wrote:
podmon runs the containers as non-root, correct? In that case, docker
really might solve the issue, or something to have access to the interfaces
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#555 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADANPQLD34A55D5UDDMJLTTSPPZXANCNFSM4N2NTRRQ>
.
|
I noticed that knockd is on version 0.7 in the current "latest" image. Can you update that to 0.8 as well? 0.7 lacks IPv6 support and i had to mount knockd 0.8 myself to resume it via IPv6 |
Forgot about this thread! Thanks for the bump. I should maybe just create a separate issue, but updating here because there's already history here. Tested out with podman as root like was suggested above. That works for autopause. I noticed as a rootfull container, it had eth0 for it's interface. All settings for the container that I tried as root worked with autopause! Still required some capabilities for autopause to work, but I didn't have time to narrow that down and just ran with I tried updating the network for the rootless container to have eth0 as well, but that did not change anything. I did this with FYI
My guess is the rootless user is missing some permissions that are required for knockd to work properly. |
I am pulling knockd via the base image distro release, so it is constrained to 0.7.0: docker-minecraft-server/Dockerfile Line 22 in f97cea4
|
I'm having this problem with only one of my servers. I have 2 containers running at the same time, 1 vanilla and 1 modded. I've noticed the vanilla server gets "knocked" every 5 minutes or so while the modded server does not. EDIT : I've figured out that it seems to only be servers not on the default minecraft port on my side.
EDIT2: I've been trying to find a way to listen to the port and have a script send a rcon command to the server to wake it up. |
I've been trying to figure out how to make this work all week and finally got it. I tested on vanilla servers on a docker swarm and on 2 modded servers with docker-compose, the only ones that do not get out of autopause are the servers that do not have the default minecraft port. Compose file important parts :
Autopause logs :
Doing I added :
And voila! I was not thinking I was using any special server configuration (ubuntu cli), so I did not expect to have to set the knock interface. As an FYI : vanilla minecraft works A+ on a docker swarm. |
@NotFluffy that's great you figured out your scenario! I'm not sure what would lead to a container having two interfaces other than maybe the networks config. Can you provide the rest of your compose file? |
Here are the 2 vanilla server compose files. I tried to keep them as close as possible to each other to make sure nothing else could explain the problem.
Creation of networks : And just for anyone who wants to make this on a docker swarm, you have to create the volumes from the shared storage on each workers (do not prune volumes, it will delete these and you don't want that) :
|
what is the correct syntax to add |
This issue is stale because it has been open 30 days with no activity. Please add a comment describing the reason to keep this issue open. |
Additional related info: Using the |
Since I came across my OWN question 2 years later while setting this up, the correct format for a paper docker-compose.yml is |
Running Docker with docker-minecraft through Docker-compose. Running with portforwarding on port 25565. MC version 15.5.2
I've enabled autopause on my server with Watchdog disabled.
The server pause starts as it should when a user has been disconnected for 15 minutes.
However when entering the game (and letting it ping) the server doesn't wake up. When trying to connect to the server this doesn't work.
The only thing that made my server awake again was by manually starting the RCON connection.
What's going wrong?
The text was updated successfully, but these errors were encountered: