arkmanager / ark-server-tools

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

Invalid steamcmd_user in config file #1255

Closed ilmal closed 1 year ago

ilmal commented 1 year ago

I'm running an ark server with docker using: https://hub.docker.com/r/hermsi/ark-server/

The server starts and is successful, but arkmanager doesn't work. When trying to connect to arkmanager I get the err message:

root@35e1af01f70a:/app# arkmanager 
Invalid steamcmd_user in config file

This is my config file:

root@35e1af01f70a:/app# cat arkmanager/arkmanager.cfg
# --- SYSTEM CONFIG - DO NOT TOUCH ---#

arkstChannel=${BRANCH}                                              # change it to a different branch to get non-stable versions
install_bindir="/usr/bin"
install_libexecdir="/usr/libexec/arkmanager"
install_datadir="/usr/share/arkmanager"

# config SteamCMD
steamcmdroot="${STEAM_HOME}/steamcmd"                               # path of your steamcmd instance
steamcmdexec="steamcmd.sh"                                          # name of steamcmd executable
steamcmd_user="${STEAM_USER}"                                       # name of the system user who own steamcmd folder
steamcmd_appinfocache="${STEAM_HOME}/Steam/appcache/appinfo.vdf"    # cache of the appinfo command
steamcmd_workshoplog="${STEAM_HOME}/Steam/logs/workshop_log.txt"    # Steam workshop log - change this to "/home/steam/.steam/logs/workshop_log.txt" on Debian/Ubuntu/CentOS if you have the steamcmd package installed
#steamlogin="${STEAM_LOGIN}"                                         # Uncomment this to specify steam login instead of using anonymous login
#steamcmdhome="${STEAM_HOME}"                                        # Uncomment this to override steamcmd home directory

# config environment
arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer"        # name of ARK server executable
arkbackupdir="${ARK_SERVER_VOLUME}/backup"                          # path to backup directory
arkbackupcompress="true"                                            # Enable/Disable backup compression
arkwarnminutes="60"                                                 # number of minutes to warn players when using update --warn
arkprecisewarn="false"                                              # set this to true to obey warnminutes even if no players are connected (recommended for clusters)
arkNoPortDecrement="true"                                           # unset this to use the old Port - 1 behaviour
arkautorestartfile="ShooterGame/Saved/.autorestart"                 # path to autorestart file
arkAutoUpdateOnStart=${UPDATE_ON_START}                             # set this to true if you want to always update before startup
arkBackupPreUpdate=${PRE_UPDATE_BACKUP}                             # set this to true if you want to perform a backup before updating
arkStagingDir="${ARK_SERVER_VOLUME}/staging"

# config Service
servicename="arkserv"                                               # Name of the service (don't change if you don't know what are you doing)
logdir="${ARK_SERVER_VOLUME}/log/"                                  # Logs path (default /var/log/arktools)

# Port config
ark_Port=${GAME_CLIENT_PORT}                                        # ARK server port (default 7778)
ark_QueryPort=${SERVER_LIST_PORT}                                   # ARK query port (default 27015)
ark_RCONEnabled="True"                                              # Enable RCON Protocol
ark_RCONPort=${RCON_PORT}                                           # RCON Port

# steamdb specific
appid=376030                                                        # Linux server App ID
mod_appid=346110                                                    # App ID for mods

defaultinstance="main"                                              # See /etc/arkmanager/instances/main.cfg - Instance config options will overide the Global option in this file.

# We don't use the dots because it doesn't show.
progressDisplayType=spinner

#broadcastcmd="serverchat"                                          # Uncomment to use serverchat instead of broadcast

# Notifications
# discordWebhookURL="https://discordapp.com/api/webhooks/{webhook.id}/{webhook.token}"
# notifyMsgShuttingDown="Shutting down"
# notifyMsgStarting="Starting"
# notifyMsgServerUp="Server is up"
# notifyMsgStoppedListening="Server has stopped listening - restarting"
# notifyMsgServerTerminated="Server exited - restarting"
# notifyTemplate="Message from instance {instance} on server {server}: {msg}"
# noNotifyWarning=true
# notifyCommand='echo "$msg" | mailx -s "Message from instance ${instance} on server ${HOSTNAME}" "email@domain.com"'

# Restart cancel chat command
#chatCommandRestartCancel="/cancelupdate"

# ARK server flags - use arkflag_<optionname>=true
#arkflag_OnlyAdminRejoinAsSpectator=true                            # Uncomment to only allow admins to rejoin as spectator
#arkflag_DisableDeathSpectator=true                                 # Uncomment to disable players from becoming spectators when they die

# ARK server options - i.e. for -optname=val, use arkopt_optname=val
#arkopt_StructureDestructionTag=DestroySwampSnowStructures

# alternate configs
# example for config name "ark1":
#configfile_ark1="/path/to/config/file"

Where the steamcmd_user is defined as "${STEAM_USER}" which if i echo I get the user steam. Which is also the user that is the owner of the steamcmd files:

root@35e1af01f70a:/app# echo ${STEAM_HOME}
/home/steam
root@35e1af01f70a:/app# echo ${STEAM_USER}
steam
root@35e1af01f70a:/app# ls -l /home/steam/
total 16
drwxrwxr-x 2 steam steam 4096 Jun 21 19:11 ARK-Backups
drwxr-xr-x 1 steam steam 4096 Jun 20 05:01 Steam
drwxr-xr-x 1 steam steam 4096 Jun 20 05:01 steamcmd

For me, everything seems to be correctly set up, but I'm still getting the err. Why?

Thank you for any help!

klightspeed commented 1 year ago

Invalid steamcmd_user in config file in this context means that the user doesn't exist in /etc/passwd in the docker container, and so as you are running the script as root, it cannot drop privileges to the given user.

ilmal commented 1 year ago

Thanks for response!

This is my passwd file:

root@35e1af01f70a:/app# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
steam:x:1000:1000::/home/steam:/bin/sh
Debian-exim:x:101:101::/var/spool/exim4:/usr/sbin/nologin

where the "steam" user seems to exist? Or how should I run the arkmanager script to make it work?

klightspeed commented 1 year ago

What happens when you su steam, then try running arkmanager? Alternatively, what happens when you try running your docker exec to get a shell as the user you originally set the container to run as?

ilmal commented 1 year ago

That worked! I can get arkmanager to run when switching over to steam user. This workes:

sudo docker exec --user steam ark_server arkmanager status

Thank you so much for the help!