Closed Rumsfield closed 2 years ago
As a follow up, this is all in the effort to give myself admin on the server. One path is to run the command setaccesslevel "Rumsfield" "admin"
in the server console, which is why I made this issue.
The other path of using the environment variables ADMIN_PASSWORD
and ADMIN_USERNAME
in the docker-compose.yaml file doesn't work for me. I've tried setting it, and the console logs show the correct values, yet when I log into the server with those credentials, I don't have admin rights.
From the console log:
pz | pzexe: using jvm "/home/steam/ZomboidDedicatedServer/jre64/lib/server/libjvm.so"
pz | pzexe: arg: -cachedir=/home/steam/Zomboid
pz | pzexe: arg: -adminusername
pz | pzexe: arg: Rumsfield
pz | pzexe: arg: -adminpassword
pz | pzexe: arg: 123456
Is there some step I'm missing to get the environment variables to work?
I was able to use the rcon terminal to run console commands, but I'm still not able to set admin access for myself. From the rcon:
> players
Players connected (1):
-Rumsfield
> setaccesslevel "Rumsfield" "admin"
User "Rumsfield" is not in the whitelist, use /adduser first
> adduser "Rumsfield" "XXXXXX"
User Rumsfield created with the password $2a$12$O/XXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXX
> setaccesslevel "Rumsfield" "admin"
User "Rumsfield" is not in the whitelist, use /adduser first
And the corresponding attached container console logs:
LOG : General , 1649006318040> 392,251,502> RCON: ID=0 Type=2 Body='adduser "Rumsfield" "XXXXXX"' Socket[removed]
ERROR: General , 1649006318542> 392,252,004> org.sqlite.SQLiteException: [SQLITE_CONSTRAINT] Abort due to constraint violation (UNIQUE constraint failed: whitelist.username)
ERROR: General , 1649006318542> 392,252,004> at org.sqlite.core.DB.newSQLException(DB.java:941)
ERROR: General , 1649006318542> 392,252,004> at org.sqlite.core.DB.newSQLException(DB.java:953)
ERROR: General , 1649006318543> 392,252,005> at org.sqlite.core.DB.execute(DB.java:854)
ERROR: General , 1649006318543> 392,252,005> at org.sqlite.core.DB.executeUpdate(DB.java:895)
ERROR: General , 1649006318543> 392,252,005> at org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:102)
ERROR: General , 1649006318543> 392,252,005> at zombie.network.ServerWorldDatabase.addUser(ServerWorldDatabase.java:210)
ERROR: General , 1649006318543> 392,252,005> at zombie.commands.serverCommands.AddUserCommand.Command(AddUserCommand.java:42)
ERROR: General , 1649006318543> 392,252,005> at zombie.commands.CommandBase.Execute(CommandBase.java:131)
ERROR: General , 1649006318543> 392,252,005> at zombie.network.GameServer.handleServerCommand(GameServer.java:1165)
ERROR: General , 1649006318544> 392,252,006> at zombie.network.GameServer.rcon(GameServer.java:1136)
ERROR: General , 1649006318544> 392,252,006> at zombie.network.RCONServer$ExecCommand.update(RCONServer.java:344)
ERROR: General , 1649006318544> 392,252,006> at zombie.network.RCONServer.updateMain(RCONServer.java:386)
ERROR: General , 1649006318544> 392,252,006> at zombie.network.RCONServer.update(RCONServer.java:412)
ERROR: General , 1649006318544> 392,252,006> at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
ERROR: General , 1649006318544> 392,252,006> at zombie.network.GameServer.main(GameServer.java:916)
LOG : General , 1649006339108> 392,272,571> RCON: ID=0 Type=2 Body='setaccesslevel "Rumsfield" "admin"' Socket[removed]
ERROR: General , 1649006339153> 392,272,615> org.sqlite.SQLiteException: [SQLITE_CONSTRAINT] Abort due to constraint violation (UNIQUE constraint failed: whitelist.username)
ERROR: General , 1649006339154> 392,272,616> at org.sqlite.core.DB.newSQLException(DB.java:941)
ERROR: General , 1649006339154> 392,272,617> at org.sqlite.core.DB.newSQLException(DB.java:953)
ERROR: General , 1649006339155> 392,272,617> at org.sqlite.core.DB.execute(DB.java:854)
ERROR: General , 1649006339155> 392,272,617> at org.sqlite.core.DB.executeUpdate(DB.java:895)
ERROR: General , 1649006339159> 392,272,621> at org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:102)
ERROR: General , 1649006339159> 392,272,621> at zombie.network.ServerWorldDatabase.addUser(ServerWorldDatabase.java:210)
ERROR: General , 1649006339159> 392,272,621> at zombie.network.ServerWorldDatabase.setAccessLevel(ServerWorldDatabase.java:909)
ERROR: General , 1649006339160> 392,272,622> at zombie.commands.serverCommands.SetAccessLevelCommand.update(SetAccessLevelCommand.java:97)
ERROR: General , 1649006339160> 392,272,622> at zombie.commands.serverCommands.SetAccessLevelCommand.Command(SetAccessLevelCommand.java:40)
ERROR: General , 1649006339160> 392,272,622> at zombie.commands.CommandBase.Execute(CommandBase.java:131)
ERROR: General , 1649006339160> 392,272,622> at zombie.network.GameServer.handleServerCommand(GameServer.java:1165)
ERROR: General , 1649006339160> 392,272,622> at zombie.network.GameServer.rcon(GameServer.java:1136)
ERROR: General , 1649006339160> 392,272,622> at zombie.network.RCONServer$ExecCommand.update(RCONServer.java:344)
ERROR: General , 1649006339160> 392,272,622> at zombie.network.RCONServer.updateMain(RCONServer.java:386)
ERROR: General , 1649006339160> 392,272,623> at zombie.network.RCONServer.update(RCONServer.java:412)
ERROR: General , 1649006339161> 392,272,623> at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
ERROR: General , 1649006339161> 392,272,623> at zombie.network.GameServer.main(GameServer.java:916)
My server config INI is set to open, so there shouldn't be a whitelist. This appears to be some sort of bug with the player SQL database?
Hi!
I was going to say that the recommendation for console access is the rcon binary.
Strange that you can't set yourself as Admin. It's always worked in my experience. Normally I can just login as the Admin as you are trying to do, and I can set other people up with Admin permissions from there.
Are you certain that you have restarted the server between attempts?
And is it out of the question to delete the contents of the ZomboidConfig directory to rule out data corruption?
I do restart between attempts, and to do that I use commands docker container stop pz
to stop the container, edit config files, then start with docker-compose up -d
. I named my container "pz".
I guess I could try making a new container from scratch to see if the same admin login problem persists. One detail that may be relevant is that my server name includes spaces. Perhaps that introduces some kind of issue... I think I'll try making a new server without spaces in the name in a new container, to see if it works then.
A better way to stop them is
docker-compose down
And then to do a proper rebuild, you can do
docker-compose up --build
Also everything is quoted in the script that runs the server, so spaces shouldn't be an issue.
@Rumsfield Is this still an issue?
@Rumsfield Is this still an issue?
I remember that I was able to use rcon commands to temporarily give myself admin, but I couldn't figure out how to make it persist. That was a good enough workaround for what I needed. This is not an issue for me anymore. Feel free to close.
Thanks! It's very odd that persistence (specifically for admin status) isn't working though.
Maybe let me know if you ever figure it out, but I just can't replicate it.
I'm new to docker and I'm trying to figure out how to interact with the server console from an SSH terminal session. I'm using a VPS running Debian 10, and I've been able to run the docker compose file to bring up the container. The server works, I've played on it. But I just need to access the console.
When I run this command, I see the zomboid server print log messages during server startup.
But I'm not able to enter any commands. Sorry if I'm missing something obvious, but could you please help me understand what's wrong?
Here is the content of my docker-compose.yml: