itzg / minecraft-server-charts

MIT License
278 stars 143 forks source link

Really odd issue with the whitelist entries in the minecraft chart #190

Closed bhechinger closed 8 months ago

bhechinger commented 8 months ago

I have the following whitelist block:

    whitelist:
      - BlockyJackBauer
      - io42
      - SuperSammyDino
      - BennyPlayerX

io42 and SuperSammyDino both get looked up and added to the whitelist json file:

alexs-world-minecraft-5798b94dd7-ckthl:/data$ cat whitelist.json 
[
  {
    "uuid": "9c1b56c6-d2e0-4479-9437-84c609f51f02",
    "name": "SuperSammyDino"
  },
  {
    "uuid": "e1a5cd65-eb7f-4d55-952b-c9812bc72b86",
    "name": "io42"
  }
]

It's adding square brackets around the names when looking up the other two for some reason. Extracted from the logs:

Failed to download https://playerdb.co/api/player/minecraft/%5BBlockyJackBauer%5D
Failed to download https://playerdb.co/api/player/minecraft/%5BBlockyJackBauer
https://playerdb.co/api/player/minecraft/BennyPlayerX%5D

None of those are valid, but you can find they do exist without the square brackets.

bhechinger commented 8 months ago

Just noticed this right above that part in the logs:

[init] Updating whitelist
grep: Unmatched [, [^, [:, [., or [=
itzg commented 8 months ago

You seem to be running an old version. Please re-pull the image and see if that helps.

bhechinger commented 8 months ago

Ok, forcing pull policy to always got the new image and I no longer get the original error. I do now get this, however, and it refuses to update it:

[mc-image-helper] 13:45:23.293 INFO  : The file /data/ops.json already exists, so no changes will be made
[mc-image-helper] 13:45:23.947 INFO  : The file /data/whitelist.json already exists, so no changes will be made
itzg commented 8 months ago

Please refer to EXISTING_OPS_FILE and EXISTING_WHITELIST_FILE. You're observing the default behavior which had to be retained for backward compatibility.

bhechinger commented 8 months ago

Ok, so I set those:

      EXISTING_OPS_FILE:              SYNCHRONIZE
      EXISTING_WHITELIST_FILE:        SYNCHRONIZE

Now I get this:

[mc-image-helper] 22:24:47.929 ERROR : Invalid parameter provided for 'manage-users' command: Could not resolve user from Playerdb: [BlockyJackBauer]
itzg commented 8 months ago

Thanks for the update. I'll have to investigate that since calling the API manually returns that player

https://playerdb.co/api/player/minecraft/BlockyJackBauer

itzg commented 8 months ago

...hmm, those square brackets in [BlockyJackBauer] are not supposed to be there. What does your whitelist.json look like? Also, the .minecraftServer.whitelist value is supposed to be a comma or whitelist delimited string rather than a list value. I'm wondering if Helm/Yaml has converted that into an array ([...]) as the string input.

bhechinger commented 8 months ago

So that makes perfect sense. A list would typically render to [...] so [BlockyJackBauer and BennyPlayerX] make sense as they are the first and last elements of the list respectively.

FYI whitespace (I'm assuming this is actually what you meant by whitelist) delimited doesn't work, only comma.

Sorry for the noise. I copied this values file from an older version of the helm chart which seems to work with a yaml list just fine.