escapingnetwork / core-keeper-dedicated

Dockerfile for automated build of a Core Keeper Dedicated Server
https://hub.docker.com/r/escaping/core-keeper-dedicated
MIT License
93 stars 26 forks source link

Unraid: Server isn't starting after downloading (FIX PROPOSED) #42

Open 825i opened 5 months ago

825i commented 5 months ago

Any ideas what is going on? It should just deploy the container, download the files and make the necessary folders and logs etc. However it's not starting and not making any logs etc either. So I cannot even see what is going on.

Both the DIRs are just empty.

steamcmd.sh[8]: Restarting steamcmd by request...
tid(13) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/home/steam/Steam/logs/stderr.txt'
Logging directory: '/home/steam/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
UpdateUI: skip show logotid(26) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/home/steam/Steam/logs/stderr.txt'
Logging directory: '/home/steam/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x61) downloading, progress: 0.00 (0 / 73781292)
 Update state (0x61) downloading, progress: 92.89 (68538412 / 73781292)
Success! App '1007' fully installed.
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x61) downloading, progress: 10.84 (50712620 / 467785005)
 Update state (0x61) downloading, progress: 15.77 (73781292 / 467785005)
 Update state (0x61) downloading, progress: 69.11 (323268613 / 467785005)
 Update state (0x61) downloading, progress: 97.58 (456468989 / 467785005)
Success! App '1963720' fully installed.
tid(108) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/home/steam/Steam/logs/stderr.txt'
Logging directory: '/home/steam/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
Success! App '1007' already up to date.
Success! App '1963720' already up to date.
xvinfo:  Unable to open display :99
Failed to start Xvfb, retry: 1
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
X-Video Extension version 2.2
screen #0
 no adaptors present
chmod: cannot access './CoreKeeperServer': No such file or directory
-batchmode -logfile CoreKeeperServerLog.txt -world 0 -worldname Babs World -worldseed 0 -worldmode 0 -gameid 1q2w3e4r5t6y7u8i9o0pzxc -maxplayers 10 -season -1
Started server process with pid 137
./launch.sh: line 72: ./CoreKeeperServer: No such file or directory
825i commented 5 months ago

I used another Docker container and this one works flawlessly, here's the readout, it's similar but no issues.

It would seem that a crucial step of the container is that it should take ownership of the directories.

steamcmd.sh[33]: Restarting steamcmd by request...
[ 90%] Downloading update (54,489 of 59,594 KB)...
[ 91%] Downloading update (55,371 of 59,594 KB)...
[ 92%] Downloading update (55,835 of 59,594 KB)...
[ 93%] Downloading update (56,209 of 59,594 KB)...
[ 94%] Downloading update (57,092 of 59,594 KB)...
[ 95%] Downloading update (57,895 of 59,594 KB)...
[ 97%] Downloading update (58,760 of 59,594 KB)...
[ 98%] Downloading update (59,574 of 59,594 KB)...
[ 99%] Downloading update (59,594 of 59,594 KB)...
[100%] Download Complete.
[----] Applying update...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching...
tid(50) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/serverdata/Steam/logs/stderr.txt'
Logging directory: '/serverdata/Steam/logs'
/tmp/dumps: insufficient permissions - delete and recreate
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
UpdateUI: skip show logotid(63) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/serverdata/Steam/logs/stderr.txt'
Logging directory: '/serverdata/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
---Update Server---
---Validating installation---
tid(88) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/serverdata/Steam/logs/stderr.txt'
Logging directory: '/serverdata/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x61) downloading, progress: 15.77 (73781292 / 467785005)
 Update state (0x61) downloading, progress: 86.86 (406312684 / 467785005)
Success! App '1963720' fully installed.
---Prepare Server---
---Checking for old display lock files---
---Checking for old logfiles---
---Server ready---
---Starting Xvfb server---
---Start Server---
Server Game ID: [REDACTED BY USER]
825i commented 5 months ago

Tried to fix this myself and propose a pull request but you've blocked contributions:

 /mnt/c/U/d/Doc/r/8/h/core-keeper-dedicated  on fix-issue-42 !1  git push --set-upstream origin fix-issue-42                                                            128 ✘  at 20:26:16  
ERROR: Permission to escapingnetwork/core-keeper-dedicated.git denied to 825i.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I'm pretty sure all you need to do is just add this to line 4 of entry.sh

# Fix ownership issue on Unraid
echo "---Taking ownership of data...---"
chown -R root:${GID} /opt/scripts
chmod -R 750 /opt/scripts
chown -R ${UID}:${GID} ${STEAMAPPDIR}
RandomLegend commented 5 months ago

I have the exact same issue.

Can you help me to get this running either way? I have no idea on how to apply your fix locally for me, or how to use the SteamCMD Docker you linked to for this.

arguser commented 5 months ago

Tried to fix this myself and propose a pull request but you've blocked contributions:

 /mnt/c/U/d/Doc/r/8/h/core-keeper-dedicated  on fix-issue-42 !1  git push --set-upstream origin fix-issue-42                                                            128 ✘  at 20:26:16  
ERROR: Permission to escapingnetwork/core-keeper-dedicated.git denied to 825i.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I'm pretty sure all you need to do is just add this to line 4 of entry.sh

# Fix ownership issue on Unraid
echo "---Taking ownership of data...---"
chown -R root:${GID} /opt/scripts
chmod -R 750 /opt/scripts
chown -R ${UID}:${GID} ${STEAMAPPDIR}

Hey @825i thanks for the proposed fix. Would you be so kind to make a PR with the suggested changes?

johnsonvu commented 5 months ago

I'm getting the same error still after adding the proposed fix by @825i to the entry.sh

ubuntu@corekeeper:~/core-keeper-dedicated$ sudo docker compose up
[+] Running 2/2
 ✔ Network core-keeper-dedicated_default          Created                                                                                                                             0.1s
 ✔ Container core-keeper-dedicated-core-keeper-1  Created                                                                                                                             0.0s
Attaching to core-keeper-dedicated-core-keeper-1
core-keeper-dedicated-core-keeper-1  | /home/steam/steamcmd/steamcmd.sh: line 76:    25 Segmentation fault      (core dumped) $DEBUGGER "$STEAMEXE" "$@"
core-keeper-dedicated-core-keeper-1  | /home/steam/steamcmd/steamcmd.sh: line 76:    44 Segmentation fault      (core dumped) $DEBUGGER "$STEAMEXE" "$@"
core-keeper-dedicated-core-keeper-1  | /usr/bin/xvinfo:  Unable to open display :99
core-keeper-dedicated-core-keeper-1  | _XSERVTrans
core-keeper-dedicated-core-keeper-1  | mkdir: Owner of /tmp/.X11-unix should be set to root
core-keeper-dedicated-core-keeper-1  | Failed to start Xvfb, retry: 1
core-keeper-dedicated-core-keeper-1  | X-Video Extension version 2.2
core-keeper-dedicated-core-keeper-1  | screen #0
core-keeper-dedicated-core-keeper-1  |  no adaptors present
core-keeper-dedicated-core-keeper-1  | /usr/bin/chmod:
core-keeper-dedicated-core-keeper-1  | cannot access './CoreKeeperServer'
core-keeper-dedicated-core-keeper-1  | : No such file or directory
core-keeper-dedicated-core-keeper-1  |
core-keeper-dedicated-core-keeper-1  |
core-keeper-dedicated-core-keeper-1  | -batchmode -logfile CoreKeeperServerLog.txt -world 0 -worldname Core Keeper Server -worldseed 0 -worldmode 0 -datapath /home/steam/core-keeper-data -maxplayers 10 -season 0
core-keeper-dedicated-core-keeper-1  | Started server process with pid 83
core-keeper-dedicated-core-keeper-1  | ./launch.sh: line 72: ./CoreKeeperServer: No such file or directory

Here's my entry.sh for reference:

#!/bin/bash
mkdir -p "${STEAMAPPDIR}" || true

# Fix ownership issue on Unraid
echo "---Taking ownership of data...---"
chown -R root:${GID} /opt/scripts
chmod -R 750 /opt/scripts
chown -R ${UID}:${GID} ${STEAMAPPDIR}

# Override SteamCMD launch arguments if necessary
# Used for subscribing to betas or for testing
if [ -z "$STEAMCMD_UPDATE_ARGS" ]; then
        bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "$STEAMAPPDIR" +login anonymous +app_update "$STEAMAPPID" +app_update "$STEAMAPPID_TOOL" +quit
else
        steamcmd_update_args=($STEAMCMD_UPDATE_ARGS)
        bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "$STEAMAPPDIR" +login anonymous +app_update "$STEAMAPPID" +app_update "$STEAMAPPID_TOOL" "${steamcmd_update_args[@]}" +quit
fi

bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "$STEAMAPPDIR" +login anonymous +app_update "$STEAMAPPID" +app_update "$STEAMAPPID_TOOL" +quit

bash "./launch.sh"

Any ideas?

Micke90s commented 2 weeks ago

The error chmod: cannot access './CoreKeeperServer': No such file or directory may occurs if the docker system is not allowed to write on the hosts files system.

e.g. my docker-compose includes the following lines:

    volumes:
      - /srv/core-keeper/files:/home/steam/core-keeper-dedicated
      - /srv/core-keeper/data:/home/steam/core-keeper-data

This means, that the path /home/steam/core-keeper-dedicated is mapped to my hosts path /srv/core-keeper/files. As the Linux file authorisation is based on user and group you have to set the authorisation of the folder for the service user.

chown docker:docker /srv/core-keeper/ -R
chmod g+rwx /srv/core-keeper/ -R

See also Manage Docker as a non-root user

Or the easy (only recommended for test sytems) way: chmod 777 /srv/core-keeper/ -R