docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

Autopause & playitgg: not resuming when trying to connect via playitgg

Open DerRockWolf opened this issue 7 months ago • 7 comments

Describe the problem

I'm using the autopause feature:

ENABLE_AUTOPAUSE="true"
AUTOPAUSE_TIMEOUT_EST="900"
AUTOPAUSE_TIMEOUT_INIT="300"

Players can connect via playit.gg just fine, but if the server got paused knockd does not seem to notice connection attempts. Connection attempts from my local network are able to wake up the server just fine.

I'm not sure if the issue is with the knockd config or with how playit.gg does things. Any ideas how I could investigate would be great.

Container definition

No response

Container logs

DerRockWolf avatar May 01 '25 16:05 DerRockWolf

Auto-pause and knockd was a contributed feature so I can't offer much advice myself. All of the logic is in

https://github.com/itzg/docker-minecraft-server/blob/master/files/auto/autopause-daemon.sh

My only suggestion is to consider different values for AUTOPAUSE_KNOCK_INTERFACE.

itzg avatar May 01 '25 16:05 itzg

I've tried setting AUTOPAUSE_KNOCK_INTERFACE to lo as this is the only other interface and from what I could find the playit.gg agent forwards requests to 127.0.0.1.

I've used a patched image that adds --include-loopback to the mc-image-helper network-interfaces calls in files/auto/autopause-daemon.sh:

Patch

diff --git a/files/auto/autopause-daemon.sh b/files/auto/autopause-daemon.sh
index 6bb0233..b614abd 100644
--- a/files/auto/autopause-daemon.sh
+++ b/files/auto/autopause-daemon.sh
@@ -10,7 +10,7 @@ fi

 autopause_error_loop() {
   logAutopause "Available interfaces within the docker container:"
-  logAutopause "  $(mc-image-helper network-interfaces)"
+  logAutopause "  $(mc-image-helper network-interfaces --include-loopback)"
   logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
   logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
   logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
@@ -35,7 +35,7 @@ if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
   logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
   autopause_error_loop
 fi
-if ! mc-image-helper network-interfaces --check="$AUTOPAUSE_KNOCK_INTERFACE" ; then
+if ! mc-image-helper network-interfaces --include-loopback --check="$AUTOPAUSE_KNOCK_INTERFACE" ; then
   logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
   autopause_error_loop
 fi

This fixed the issue I had, but now I can only knock the server via playit.gg 😅

Do you think it would make sense to allow passing multiple interfaces to AUTOPAUSE_KNOCK_INTERFACE and start one daemon per interface or do you want to deprecate the autopause feature anyway because of the "new" pause-when-empty-seconds server property.

DerRockWolf avatar May 02 '25 17:05 DerRockWolf

Great research.

I would really like to deprecate this image's auto pause support in favor of the new native capability of Minecraft itself...however users of older Minecraft versions won't get that benefit.

So, perhaps both options are good.

itzg avatar May 03 '25 02:05 itzg

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.

github-actions[bot] avatar Jun 03 '25 02:06 github-actions[bot]

@itzg how do you deal with such issues? Should we (re)open it until someone has the time to implement it? 🤔

DerRockWolf avatar Jun 15 '25 10:06 DerRockWolf

It would have been best if you commented before the bot closed it.

itzg avatar Jun 15 '25 11:06 itzg

And I'll convert to a discussion since there's nothing this I image can do to fix this.

itzg avatar Jun 15 '25 11:06 itzg

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.

github-actions[bot] avatar Jul 16 '25 02:07 github-actions[bot]