Closed doman18 closed 1 month ago
Set the env var EXISTING_OPS_FILE
to "SYNCHRONIZE"
Unfortunately the default of "SKIP" is not immediately intuitive but was implemented as such for backward compatibility. Your issue makes me think I should change that default to improve the usability of more typical usage.
Still doesn't work. I cant use any commands.
services:
my-service:
container_name: surv-easy
# link to project
# always use versioning to be able to rollback
image: itzg/minecraft-server:${DOCKER_MINECRAFT_VERSION}
tty: true
stdin_open: true
environment:
- EULA=TRUE
- SNOOPER_ENABLED=FALSE
- ONLINE_MODE=FALSE
- DIFFICULTY=$DIFFICULTY
- OPS=$OPS
- DEBUG=TRUE
- EXISTING_OPS_FILE=SYNCHRONIZE
volumes:
- surv-easy-vol:/data
ports:
- "55555:25565"
restart: always
root@10a705adda82:/data# printenv | sort
DEBUG=TRUE
DIFFICULTY=easy
EULA=TRUE
EXISTING_OPS_FILE=SYNCHRONIZE
GID=1000
HOME=/root
HOSTNAME=10a705adda82
JAVA_HOME=/opt/java/openjdk
JAVA_VERSION=jdk-21.0.3+9
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=en_US.UTF-8
LESSCLOSE=/usr/bin/lesspipe %s %s
LESSOPEN=| /usr/bin/lesspipe %s
ONLINE_MODE=FALSE
OPS=tata
PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/data
SHLVL=0
SNOOPER_ENABLED=FALSE
TERM=xterm
TYPE=VANILLA
UID=1000
_=/usr/bin/printenv
VERSION=LATEST
Can you check the contents of ops.json
? All the container startup is doing is updating that file. Since you have debug enabled can you provide the container startup logs?
Wild guess which might be irrelevant: what's the value of op-permission-level
in your server.properties
?
I just noticed you have
ONLINE_MODE=FALSE
That might be interfering with UUID matching of the connecting player. Speaking of UUID, you might need to provide a UUID rather than username for OPS. One way to identify that user's UUID is to watch the logs.
Here are things you asked logs (last part)
Starting net.minecraft.server.Main
[17:52:11] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
[17:52:13] [ServerMain/INFO]: Loaded 1290 recipes
[17:52:13] [ServerMain/INFO]: Loaded 1399 advancements
[17:52:14] [Server thread/INFO]: Starting minecraft server version 1.21
[17:52:14] [Server thread/INFO]: Loading properties
[17:52:14] [Server thread/INFO]: Default game type: SURVIVAL
[17:52:14] [Server thread/INFO]: Generating keypair
[17:52:14] [Server thread/INFO]: Starting Minecraft server on *:25565
[17:52:14] [Server thread/INFO]: Using epoll channel type
[17:52:14] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[17:52:14] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
[17:52:14] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[17:52:14] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
[17:52:14] [Server thread/INFO]: Preparing level "world"
[17:52:23] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[17:52:24] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[17:52:24] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[17:52:24] [Server thread/INFO]: Time elapsed: 697 ms
[17:52:24] [Server thread/INFO]: Done (10.245s)! For help, type "help"
[17:52:24] [Server thread/INFO]: Starting remote control listener
[17:52:24] [Server thread/INFO]: Thread RCON Listener started
[17:52:24] [Server thread/INFO]: RCON running on 0.0.0.0:25575
[17:53:24] [Server thread/INFO]: tata[/192.168.20.46:40506] logged in with entity id 32 at (-239.10308460159555, 64.0, -1320.6409633029562)
[17:53:24] [Server thread/INFO]: tata joined the game
[17:53:29] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2015ms or 40 ticks behind
[17:54:50] [Server thread/INFO]: tata lost connection: Disconnected
[17:54:50] [Server thread/INFO]: tata left the game
[17:58:59] [Server thread/INFO]: tata[/192.168.20.46:59656] logged in with entity id 783 at (-180.26418320546216, 70.0, -1358.71058716503)
[17:58:59] [Server thread/INFO]: tata joined the game
[17:59:27] [Server thread/INFO]: tata lost connection: Disconnected
[17:59:27] [Server thread/INFO]: tata left the game
[18:07:14] [Server thread/INFO]: tata[/192.168.20.46:56844] logged in with entity id 1235 at (-180.26418320546216, 70.0, -1358.71058716503)
[18:07:14] [Server thread/INFO]: tata joined the game
[20:14:58] [Server thread/INFO]: tata lost connection: Disconnected
[20:14:58] [Server thread/INFO]: tata left the game
[21:45:51] [Server thread/WARN]: handleDisconnection() called twice
[06:16:26] [Server thread/WARN]: handleDisconnection() called twice
root@10a705adda82:/data# cat ops.json
[
{
"uuid": "c557d99e-9a65-48df-8bac-3429f592d595",
"name": "tata",
"level": 4,
"bypassesPlayerLimit": false
}
]
root@10a705adda82:/data# cat server.properties
#Minecraft server properties
#Mon Jul 01 17:52:11 UTC 2024
accepts-transfers=false
allow-flight=false
allow-nether=true
broadcast-console-to-ops=true
broadcast-rcon-to-ops=true
bug-report-link=
difficulty=easy
enable-command-block=false
enable-jmx-monitoring=false
enable-query=false
enable-rcon=true
enable-status=true
enforce-secure-profile=true
enforce-whitelist=false
entity-broadcast-range-percentage=100
force-gamemode=false
function-permission-level=2
gamemode=survival
generate-structures=true
generator-settings={}
hardcore=false
hide-online-players=false
initial-disabled-packs=
initial-enabled-packs=vanilla
level-name=world
level-seed=
level-type=minecraft\:normal
log-ips=true
max-chained-neighbor-updates=1000000
max-players=20
max-tick-time=60000
max-world-size=29999984
motd=A Minecraft Server
network-compression-threshold=256
online-mode=false
op-permission-level=4
player-idle-timeout=0
prevent-proxy-connections=false
pvp=true
query.port=25565
rate-limit=0
rcon.password=<censored>
rcon.port=25575
region-file-compression=deflate
require-resource-pack=false
resource-pack=
resource-pack-id=
resource-pack-prompt=
resource-pack-sha1=
server-ip=
server-port=25565
simulation-distance=10
snooper-enabled=false
spawn-animals=true
spawn-monsters=true
spawn-npcs=true
spawn-protection=16
sync-chunk-writes=true
text-filtering-config=
use-native-transport=true
view-distance=10
white-list=false
I just noticed you have
ONLINE_MODE=FALSE
That might be interfering with UUID matching of the connecting player. Speaking of UUID, you might need to provide a UUID rather than username for OPS. One way to identify that user's UUID is to watch the logs.
But as you see in the logs this id is changing. Few years ago i've been using this docker container and it worked with names in offline mode. I could use commands with no problem. Unfortunately i don't have that config anymore.
I'm sorry that the Minecraft server is not working the way it used to for you, but there's nothing I can do. Your ops.json has the correct content or if I'm missing something there then please point it out.
root@10a705adda82:/data# cat ops.json
[
{
"uuid": "c557d99e-9a65-48df-8bac-3429f592d595",
"name": "tata",
"level": 4,
"bypassesPlayerLimit": false
}
]
That's all the container startup is responsible for. The remainder is behavior you'll need to report with Mojang; however, since you're running offline they probably don't provide support. Can you re-enable online mode perhaps? I'm guessing with 1.21 or otherwise recently they changed the entity ID handling of offline players.
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.
Describe the problem
Im trying to execute
/gamerule keepinventory true
in my game. But it complains that command is not complete or wrong. Im in the OPS list. Ive tried to executesend-command
but it seems it is not included in java edition? Also there is nopermissions.json
file as ive read here https://github.com/itzg/docker-minecraft-bedrock-server/issues/316. Theres onlyops.json
All i want to enable keepinventory so my kid and i can play together casually.
Container definition
.env
Container logs