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.56k stars 1.56k forks source link

Invalid parameter provided for 'manage-users' command: Merging is not supported with file input #3039

Closed b-rad15 closed 3 months ago

b-rad15 commented 3 months ago

Describe the problem

Container errors during the startup process because of the manage-users merge call

Container definition

Quadlet container file:

[Unit]
Description=Minecraft Docker Server running in Podman Quadlet

[Container]
AutoUpdate=registry
ContainerName=minecraft-server
Environment=TYPE=FABRIC MOD_PLATFORM=MODRINTH MODRINTH_MODPACK=https://modrinth.com/modpack/sop MODRINTH_LOADER=fabric VERSION=1.21 EULA=TRUE MAX_MEMORY=16G TZ=America/New_York ENABLE_ROLLING_LOGS=true USE_AIKAR_FLAGS=true DIFFICULTY=hard ICON=/data/icon.jpg OVERRIDE_ICON=true EXEC_DIRECTLY=true ENABLE_WHITELIST=true WHITELIST_FILE=/data/whitelist.json MOTD=redacted_link USE_SIMD_FLAGS=true
Image=docker.io/itzg/minecraft-server:latest
PublishPort=25565:25565
PublishPort=25575:25575
Volume=/srv/minecraft-server-1.21/data:/data:Z
Volume=/srv/minecraft-server-1.21/mods:/mods:Z
Volume=/etc/localtime:/etc/localtime:ro,z

[Service]
Restart=always

[Install]
WantedBy=default.target

Container logs

[init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x. 11 1000 1000 4096 Aug 12 00:48 /data'
[mc-image-helper] 00:49:34.065 INFO  : Modpack sop version 1.21-4.3 is already installed
[init] Copying any mods from /mods to /data/mods
[init] Enabling whitelist functionality
[mc-image-helper] 00:49:36.483 INFO  : Created/updated 1 property in /data/server.properties
[mc-image-helper] 00:49:37.436 ERROR : Invalid parameter provided for 'manage-users' command: Merging is not supported with file input
itzg commented 3 months ago

I'll look into fixing this.

For now, set EXISTING_WHITELIST_FILE to SYNCHRONIZE or one of the other options here

https://docker-minecraft-server.readthedocs.io/en/latest/configuration/server-properties/#whitelist-players

sprjr commented 3 months ago

I'm having the same issue, but setting the EXISTING_WHITELIST_FILE to SYNCHRONIZE didn't resolve it. I'm happy to provide logs or my compose file or whatever else may be useful.

b-rad15 commented 3 months ago

I'm having the same issue, but setting the EXISTING_WHITELIST_FILE to SYNCHRONIZE didn't resolve it. I'm happy to provide logs or my compose file or whatever else may be useful.

You likely need both EXISTING_WHITELIST_FILE=SYNCHRONIZE and EXISTING_OPS_FILE=SYNCHRONIZE, that worked for me

sprjr commented 3 months ago

I'm having the same issue, but setting the EXISTING_WHITELIST_FILE to SYNCHRONIZE didn't resolve it. I'm happy to provide logs or my compose file or whatever else may be useful.

You likely need both EXISTING_WHITELIST_FILE=SYNCHRONIZE and EXISTING_OPS_FILE=SYNCHRONIZE, that worked for me

Thank you, I'll give that a try and update here.

electralake commented 3 months ago

Thank you! I added to my yaml file and it works now. EXISTING_WHITELIST_FILE: SYNCHRONIZE EXISTING_OPS_FILE: SYNCHRONIZE

sprjr commented 3 months ago

I've got this, and it's not working. Can someone tell me where I've goofed it?

services:
  mc:
    container_name: minecraft0
    image: itzg/minecraft-server
    tty: true
    stdin_open: true
    ports:
      - "25565:25565"
    environment:
      EULA: "TRUE"
      WHITE_LIST: "TRUE"
      WHITELIST_FILE: "./data/whitelist.json"
      EXISTING_WHITELIST_FILE: SYNCHRONIZE
      EXISTING_OPS_FILE: SYNCHRONIZE
    volumes:
      - ./data:/data
itzg commented 3 months ago

FYI latest image now defaults to SYNC_FILE_MERGE_LIST for those variables. It's what I should have done in the first place since it accommodates both file input and container env var listing of users.

sprjr commented 3 months ago

I'm still seeing the same issue, even after pulling the new image. docker-compose.yml:

services:
  mc:
    container_name: minecraft0
    image: itzg/minecraft-server
    tty: true
    stdin_open: true
    ports:
      - "25565:25565"
    environment:
      EULA: "TRUE"
      WHITE_LIST: "TRUE"
      WHITELIST_FILE: "./data/whitelist.json"
      EXISTING_WHITELIST_FILE: SYNCHRONIZE
    volumes:
      - ./data:/data

Logs:

minecraft0  | [init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x 7 1000 1000 4096 Aug 12 15:31 /data'
minecraft0  | [init] Resolving type given VANILLA
minecraft0  | [init] Resolved version given LATEST into 1.21.1
minecraft0  | [init] Enabling whitelist functionality
minecraft0  | [mc-image-helper] 15:20:44.355 INFO  : Created/updated 1 property in /data/server.properties
minecraft0  | [mc-image-helper] 15:20:46.407 ERROR : 'manage-users' command failed. Version is 1.39.9
minecraft0  | java.nio.file.NoSuchFileException: ./data/whitelist.json
minecraft0  |   at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
minecraft0  |   at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
minecraft0  |   at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
minecraft0  |   at java.base/sun.nio.fs.UnixFileSystem.copy(Unknown Source)
minecraft0  |   at java.base/sun.nio.fs.UnixFileSystemProvider.copy(Unknown Source)
minecraft0  |   at java.base/java.nio.file.Files.copy(Unknown Source)
minecraft0  |   at me.itzg.helpers.users.ManageUsersCommand.processInputAsFile(ManageUsersCommand.java:318)
minecraft0  |   at me.itzg.helpers.users.ManageUsersCommand.call(ManageUsersCommand.java:98)
minecraft0  |   at me.itzg.helpers.users.ManageUsersCommand.call(ManageUsersCommand.java:35)
minecraft0  |   at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
minecraft0  |   at picocli.CommandLine.access$1500(CommandLine.java:148)
minecraft0  |   at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
minecraft0  |   at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
minecraft0  |   at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
minecraft0  |   at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
minecraft0  |   at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
minecraft0  |   at picocli.CommandLine.execute(CommandLine.java:2174)
minecraft0  |   at me.itzg.helpers.McImageHelper.main(McImageHelper.java:159)
minecraft0 exited with code 1
itzg commented 3 months ago

@sprjr you need to remove or fix

EXISTING_WHITELIST_FILE: SYNCHRONIZE
sprjr commented 3 months ago

@sprjr you need to remove or fix

EXISTING_WHITELIST_FILE: SYNCHRONIZE

If I comment out the line EXISTING_WHITELIST_FILE: SYNCHRONIZE (or delete it), I still get the same log output as my previous comment.

itzg commented 3 months ago

@sprjr did you make sure to re-apply the change with docker compose up -d?

I'm actually quite confused about your usage in general. Given your configuration of

      WHITELIST_FILE: "./data/whitelist.json"
      EXISTING_WHITELIST_FILE: SYNCHRONIZE

...you're pointing to the resulting whitelist.json file used by the server. You didn't need to even declare WHITELIST_FILE in that case.

I am now realizing I should enhance the software to either disallow what you're attempting or quietly skip the whole thing when one is referring to a source whitelist file that is actually the resulting whitelist file.

sprjr commented 3 months ago

Ah, so it's working now. Previous to pulling the update a couple of days ago, I didn't have the EXISTING_WHITELIST_FILE variable in my config at all, it's been added per the advice of this thread. I just removed WHITELIST_FILE now and it's all working as it was previously.

Thank you.