arkmanager / ark-server-tools

Set of server tools used to manage ARK: Survival Evolved servers on Linux
MIT License
678 stars 143 forks source link

ServerAdminPassword is empty - unable to execute RCON command even though password is set #1175

Closed WTFSajuuk closed 3 years ago

WTFSajuuk commented 3 years ago

HI,

I am having an issue where "server listening" value is always no and I believe it is related to the above rcon error. I read on how the recon checks for password and set it in all the ways mentioned but I still get the error. Please se more details below:

###snipit of startup script entrypoint.sh #############################
export RCON_ENABLE=true                                     # Enable RCON Protocol
export RCON_PORT=32330   

export SERVER_PASSWORD=*****                    # ARK server password, empty: no password required to login
export ADMIN_PASSWORD=*****                 # ARK server admin password, KEEP IT SAFE!
##################################################
##snipit of instance config main.cfg#############################
ark_RCONEnabled="${RCON_ENABLE:=false}"                 # Enable RCON Protocol
ark_RCONPort="${RCON_PORT:=32330}"                       # RCON Port
ark_SessionName="${SESSION_NAME:=ARK Docker}"     # if your session name needs special characters please use the .ini instead
ark_Port="${GAME_PORT:=7778}"                                       # ARK server port (default 7777)
ark_QueryPort="${QUERY_PORT:=27015}"                                # ARK query port (default 27015)
ark_ServerPassword="${SERVER_PASSWORD}"                             # ARK server password, empty: no password required to login
ark_ServerAdminPassword="${ADMIN_PASSWORD}"                         # ARK server admin password, KEEP IT SAFE!
ark_SpectatorPassword="${SPECTATOR_PASSWORD}"                       # ARK spectator password, KEEP IT SAFE!
ark_ServerPVE="${SERVER_PVE:=false}"                                       # Enable PVE (default false)
ark_MaxPlayers="${MAX_PLAYERS:=15}"
ark_GameModIds="${ACTIVE_MODS}"                                            # Uncomment to specify additional mods by Mod Id separated by commas
arkopt_clusterid="${CLUSTER_ID}"
#ark_AltSaveDirectoryName="SotF"       
##########################################################
#########snipit of GameUserSettings.ini #############################
[ServerSettings]
ShowMapPlayerLocation=True
AllowThirdPersonPlayer=True
ServerPVE=False
ServerCrosshair=True
ServerPassword=***** #Password is the same as set abouve in SERVER_PASSWORD. I did not set this value assume it gets set at run time by comandline ?ServerPassword=
ServerAdminPassword=***** #Password is the same as set abouve in ADMIN_PASSWORD. I did not set this value assume it gets set at run time by comandline ?ServerAdminPassword=
SpectatorPassword=
RCONEnabled=True
RCONPort=32330
##########################################################
$ sudo ps -aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
steam        1  0.0  0.0   3976  2800 ?        Ss   07:33   0:00 /bin/bash /setup/run.sh
steam        9  0.0  0.0   3976  2756 ?        S    07:33   0:00 /bin/bash ./entrypoint.sh
root        64  0.0  0.0   6812  1896 ?        Ss   07:33   0:00 /usr/sbin/cron
steam       71  0.0  0.0   5956  2672 ?        S    07:33   0:00 /bin/bash /usr/local/bin/arkmanager --verbose run
steam       74  0.0  0.0   6088  2520 ?        S    07:33   0:00 /bin/bash /usr/local/bin/arkmanager --verbose run
steam       97 33.5 15.8 8850728 4163028 ?     Dl   07:33   1:59 /ark/Steam/ShooterGame/Binaries/Linux/ShooterGameServersteam     1706  0.0  0.0   2608  1640 pts/0    Ss   07:36   0:00 /bin/sh
steam     4693  0.0  0.0   2508   520 ?        S    07:39   0:00 sleep 5
root      4694  0.0  0.0   6272  4080 pts/0    S+   07:39   0:00 sudo ps -aux
root      4695  0.0  0.0   9132  3288 pts/0    R+   07:39   0:00 ps -aux
$ sudo lsof -i -P -n | grep Shooter
ShooterGa  97 steam   11u  IPv4 5191029      0t0  UDP *:27016
ShooterGa  97 steam   19u  IPv4 5199413      0t0  UDP *:7778
ShooterGa  97 steam   20u  IPv4 5199429      0t0  TCP *:32330 (LISTEN)
ShooterGa  97 steam   22u  IPv4 5198750      0t0  UDP *:7779
$ arkmanager --version
Version: 1.6
Channel: master
Commit: 5cda461
Release Tag: v1.6.57
Blob SHA: 9edb380be5abd8e1b16a26966389564a5f9c70fe
$ arkmanager status
Running command 'status' for instance 'main'
 Server running:   Yes
 Server PID:   97
 Server listening:   No
 Server build ID:   6227102
 Server version:   322.9
$ arkmanager rconcmd listplayers
Running command 'rconcmd' for instance 'main'
ServerAdminPassword is empty - unable to execute RCON command
klightspeed commented 3 years ago

Is entrypoint.sh being sourced in the shell from which you are running those commands?

What does [ -n "${ADMIN_PASSWORD}" ]; echo $? give you? If the return status is 1, assuming entrypoint.sh only has settings, and is in the current directory, then try:

. entrypoint.sh
WTFSajuuk commented 3 years ago

Short answer no.

So the setup is in a docker container that runs a script /setup/run.sh this does some checks on files and folders that needs to exist. At the end of the script it runs entrypoint.sh this script sets all then env variables and then runs the command "arkmanager run" This starts the server and everything works fine

I had this issue for weeks now but since it is not preventing me from playing I did not give it that much attention and obviously as luck would have it right after posting this I found a fix for the rcon I can just run it with "export ADMIN_PASSWORD=***** & arkmanager rconcmd ##command##" and that works

So it seams the issue is that the exported variable values was not set globally. The reason I did not consider this is because on my local pc it starts up fine and the "arkmanager status" command works perfectly after the server started however when it runs on my server pc with the exact same docker image the status command never returns a "server listening": yes

Thank you for the assistance but I think I will close this issue. I should be able to resolve it by setting the environment variables at a global level instead of a shell level