itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.55k stars 1.56k forks source link

Autopause doesn't start #1636

Closed greyhammer closed 2 years ago

greyhammer commented 2 years ago

Describe the problem

Running Paper MC in docker with docker compose using latest version 1.19.1

I have configured the various items to enable Autopause, but the server never pauses and I never see anything related to Autopause past [init] Autopause functionality enabled in the logs

Nothing like [Autopause loop] MC Server listening for connections - stopping in 600 seconds,

The server just runs forever

Server Properties

#Minecraft server properties
#Fri Jul 29 14:37:12 UTC 2022
enable-jmx-monitoring=false
level-seed=1777181425785
rcon.port=25575
enable-command-block=true
gamemode=survival
enable-query=false
generator-settings={}
enforce-secure-profile=false
level-name=world
motd=Minecraft Server
query.port=25568
texture-pack=
pvp=true
generate-structures=true
max-chained-neighbor-updates=1000000
difficulty=easy
network-compression-threshold=256
max-tick-time=-1
require-resource-pack=false
max-players=20
use-native-transport=true
online-mode=true
enable-status=true
allow-flight=false
broadcast-rcon-to-ops=true
view-distance=10
max-build-height=256
server-ip=
resource-pack-prompt=
allow-nether=true
server-port=25568
enable-rcon=true
sync-chunk-writes=true
op-permission-level=4
server-name=Dedicated Server
prevent-proxy-connections=false
hide-online-players=false
resource-pack=
entity-broadcast-range-percentage=100
simulation-distance=10
player-idle-timeout=0
rcon.password=minecraft
force-gamemode=false
debug=false
rate-limit=0
hardcore=false
white-list=false
broadcast-console-to-ops=true
spawn-npcs=true
previews-chat=false
spawn-animals=true
snooper-enabled=true
function-permission-level=2
level-type=default
text-filtering-config=
spawn-monsters=true
enforce-whitelist=false
resource-pack-sha1=
spawn-protection=16
max-world-size=29999984

Container definition

  minecraft:
    container_name: minecraft
    image: itzg/minecraft-server
    ports:
      - "25568:25568"
    restart: unless-stopped
    volumes:
      - "$DOCKER_DIR/minecraft/:/data"
    environment:
      TYPE: PAPER
      EULA: "true"
      MEMORY: "8G"
      SPIGET_RESOURCES: "274,18494"
      ENABLE_AUTOPAUSE: "TRUE"
      AUTOPAUSE_TIMEOUT_EST: "600"
      AUTOPAUSE_TIMEOUT_INIT: "600"
      AUTOPAUSE_TIMEOUT_KN: "120"
      AUTOPAUSE_PERIOD: "10"
      AUTOPAUSE_KNOCK_INTERFACE: "eth0"
      MAX_TICK_TIME: "-1"
      JVM_DD_OPTS=disable.watchdog: "true"
    command: "--noconsole"
    healthcheck:
      test: ["CMD", "mcstatus", "127.0.0.1:25568", "ping"]

Container logs

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 11 1000 1000 4096 Jul 29 02:14 /data'
[init] Resolved version given LATEST into 1.19.1 and major version 1.19
[init] Autopause functionality enabled
[init] Resolving type given PAPER
[init] Removing old PaperMC versions ...
[init] Downloading PaperMC 1.19.1 (build 87) ...
[init] Getting plugins via Spiget
[init] Downloading resource 274 ...
[init] resource '274' not downloaded because installed version 'v3.4-beta-5' already up to date ('v3.4-beta-5')
[init] Downloading resource 18494 ...
[init] resource '18494' not downloaded because installed version '1.25.1' already up to date ('1.25.1')
[init] server.properties already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 8G and max to 8G
[init] Starting the Minecraft server...
Applying patches
Starting org.bukkit.craftbukkit.Main
System Info: Java 17 (OpenJDK 64-Bit Server VM 17.0.3+7) Host: Linux 5.4.0-122-generic (amd64)
Loading libraries, please wait...
[14:37:12 INFO]: Building unoptimized datafixer
[14:37:12 INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[14:37:13 INFO]: Loaded 7 recipes
[14:37:14 INFO]: Starting minecraft server version 1.19.1
[14:37:14 INFO]: Loading properties
[14:37:14 INFO]: This server is running Paper version git-Paper-87 (MC: 1.19.1) (Implementing API version 1.19.1-R0.1-SNAPSHOT) (Git: 3b895f3)
[14:37:14 INFO]: Console input is disabled due to --noconsole command argument
[14:37:14 INFO]: Server Ping Player Sample Count: 12
[14:37:14 INFO]: Using 4 threads for Netty based IO
[14:37:15 INFO]: Default game type: SURVIVAL
[14:37:15 INFO]: Generating keypair
[14:37:15 INFO]: Starting Minecraft server on *:25568
[14:37:15 INFO]: Using epoll channel type
[14:37:15 INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity.
[14:37:15 INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity.
[14:37:15 INFO]: [dynmap] Loading dynmap v3.4-beta-5-806
[14:37:15 INFO]: [dynmap] version=git-Paper-87 (MC: 1.19.1)
[14:37:15 INFO]: [dynmap] Mod Support API available
[14:37:15 INFO]: [ClickSort] Loading ClickSort v1.6.0
[14:37:15 INFO]: [DiscordSRV] Loading DiscordSRV v1.25.1
[14:37:15 INFO]: [ActionHealth] Loading ActionHealth v3.5.6
[14:37:15 INFO]: Server permissions file permissions.yml is empty, ignoring it
[14:37:15 INFO]: Preparing level "world"
[14:37:16 INFO]: Preparing start region for dimension minecraft:overworld
[14:37:16 INFO]: Time elapsed: 196 ms
[14:37:16 INFO]: Preparing start region for dimension minecraft:the_nether
[14:37:16 INFO]: Time elapsed: 78 ms
[14:37:16 INFO]: Preparing start region for dimension minecraft:the_end
[14:37:16 INFO]: Time elapsed: 81 ms
[14:37:16 INFO]: [dynmap] Enabling dynmap v3.4-beta-5-806
[14:37:16 INFO]: [dynmap] Added 20 custom biome mappings
[14:37:16 INFO]: [dynmap] Using Bukkit Permissions (superperms) for access control
[14:37:16 INFO]: [dynmap] Web interface permissions only available for online users
[14:37:17 INFO]: [dynmap] Mod Support processing completed
[14:37:19 INFO]: [dynmap] Loaded 27 shaders.
[14:37:19 INFO]: [dynmap] Loaded 83 perspectives.
[14:37:19 INFO]: [dynmap] Loaded 22 lightings.
[14:37:19 INFO]: [dynmap] Starting enter/exit processing
[14:37:19 INFO]: [dynmap] Finish marker initialization
[14:37:19 INFO]: [dynmap] Web server started on address 0.0.0.0:8123
[14:37:19 INFO]: [dynmap] version 3.4-beta-5-806 is enabled - core version 3.4-beta-5-806
[14:37:19 INFO]: [dynmap] For support, visit our Discord at https://discord.gg/s3rd5qn
[14:37:19 INFO]: [dynmap] For news, visit https://reddit.com/r/Dynmap or follow https://twitter.com/Dynmap
[14:37:19 INFO]: [dynmap] To report or track bugs, visit https://github.com/webbukkit/dynmap/issues
[14:37:19 INFO]: [dynmap] If you'd like to donate, please visit https://www.patreon.com/dynmap or https://ko-fi.com/michaelprimm
[14:37:19 INFO]: [dynmap] Loaded 3 maps of world 'world'.
[14:37:19 INFO]: [dynmap] Loaded 2 maps of world 'world_nether'.
[14:37:19 INFO]: [dynmap] Loaded 2 maps of world 'world_the_end'.
[14:37:19 INFO]: [dynmap] Enabled
[14:37:19 INFO]: [ClickSort] Enabling ClickSort v1.6.0
[14:37:19 INFO]: [DiscordSRV] Enabling DiscordSRV v1.25.1
[14:37:19 INFO]: [ActionHealth] Enabling ActionHealth v3.5.6
[14:37:19 INFO]: Starting remote control listener
[14:37:19 INFO]: Thread RCON Listener started
[14:37:19 INFO]: RCON running on 0.0.0.0:25575
[14:37:19 INFO]: Running delayed init tasks
[14:37:19 INFO]: Done (4.778s)! For help, type "help"
[14:37:19 INFO]: Timings Reset
[14:37:20 INFO]: [DiscordSRV] [JDA] Login Successful!
[14:37:20 INFO]: [DiscordSRV] DiscordSRV is up-to-date.
[14:37:20 INFO]: [DiscordSRV] [JDA] Connected to WebSocket
[14:37:21 INFO]: [DiscordSRV] [JDA] Finished Loading!
[14:37:21 INFO]: [DiscordSRV] Found server G:REDACTED)
[14:37:21 INFO]: [DiscordSRV] - TC:REDACTED)
[14:37:21 INFO]: [DiscordSRV] - TC:REDACTED)
[14:37:21 INFO]: [DiscordSRV] - TC:REDACTED)
[14:37:21 INFO]: [DiscordSRV] - TC:REDACTED)
[14:37:21 INFO]: [DiscordSRV] Console forwarding assigned to channel TC:REDACTED)
[14:37:21 INFO]: [DiscordSRV] Enabling dynmap hook
itzg commented 2 years ago

You need to set SERVER_PORT to match the properties value of 25568 (or let the container manage the properties entirely) since that's the port knockd is checking.

greyhammer commented 2 years ago

Great, that worked. IT paused .. and then cam back when I opened the server browser as expected.

Should the server release the memory used by the server? That's the whole reason I tried to set this up. I didn't notice any more available RAM after the server autopaused

itzg commented 2 years ago

No, autopause does not help to release memory, only CPU usage. It sends a SIGSTOP to the process to pause it. Modern linux kernels swap out inactive memory pages, so it may not be worth worrying about.

greyhammer commented 2 years ago

Ok, cool.
Thanks for the timly response and all your work on this wonderful Repo Closing