core-keeper-dedicated icon indicating copy to clipboard operation
core-keeper-dedicated copied to clipboard

Server crashes before starting with Segmentation fault

Open Azmaeus opened this issue 1 year ago • 5 comments

I hope I didn't just miss something simple. I followed the instructions, but when I try run docker compose up -d it takes a minute but then when I check docker compose logs I see at the end that CoreKeeperServer experienced a Segmentation fault.

I've attached my compose.yaml, core.env, and the output of docker compose logs. I couldn't find the CoreKeeperServerLog.txt.

I entered the container and tried to tinker myself. I tried running without DISPLAY=:99 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../Steamworks SDK Redist/linux64/" (I searched a bit and couldn't find any Steamworks SDK Redist directory), and I also noticed -logfile is in the command twice, once with and once without the filename, so I skipped the one without a filename. When I did that, the server ran without a Segmentation fault, however it never seemed to actually load, and I couldn't connect to the game id. I did however notice the CoreKeeperServerLog.txt did get generated, so I've attached that as well.

compose.yaml.txt core.env.txt docker compose logs.txt CoreKeeperServerLog.txt

Azmaeus avatar Jun 07 '23 04:06 Azmaeus

@Azmaeus have you tried the latest version? does the issue persist?

arguser avatar Aug 10 '23 13:08 arguser

To get the latest version, I just need to not specify a tag in my docker compose file, then docker compose down and then docker compose up, right? If so, I did that just now to verify and I am still getting the error. It's been a while since I looked at this, but I noticed I commented-out mapping my /tmp/.X11-unix - I suspect the last time I was researching someone said this was no longer necessary, but just to be sure I uncommented it and brought docker compose down and back up again still to no avail. This system does not have a GPU in it, if that changes what I should be doing (or if there's no way around it I can buy a cheap GPU to put in there).

Azmaeus avatar Aug 11 '23 18:08 Azmaeus

You should specify :latest and perform a docker-compose pull just to be sure. I've setup a server on an old T410i without GPU with success.

arguser avatar Aug 12 '23 12:08 arguser

I updated my compose.yaml to include :latest, and did a docker compose down, docker compose pull, and then docker compose up -d, and I'm no longer getting the same error, but a new one. I was previously getting something like ./launch.sh: line 46: 70 Segmentation fault (core dumped) DISPLAY=:99 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../Steamworks SDK Redist/linux64/" ./CoreKeeperServer -batchmode -logfile -world "${WORLD_INDEX}" -worldname "${WORLD_NAME}" -worldseed "${WORLD_SEED}" -gameid "${GAME_ID}" -datapath "${STEAMAPPDATADIR}" -maxplayers "${MAX_PLAYERS}" -logfile CoreKeeperServerLog.txt but now I'm getting ./launch.sh: line 80: 105 Segmentation fault (core dumped) DISPLAY=:99 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../Steamworks SDK Redist/linux64/" ./CoreKeeperServer "${params[@]}"

Azmaeus avatar Jan 21 '24 20:01 Azmaeus

@Azmaeus Segmentation fault is the most common problem. It can be caused by missing dependencies, old Linux kernels or by problems within the dedicated server itself.

On which kernel your host system is running? Does the host have graphics hardware?

Micke90s avatar Mar 08 '24 21:03 Micke90s

I had the same issue, until I deleted the server-files and server-data directories. Then I ran into #42 and followed the instruction to properly chown these directories (I run docker as a user). The segmentation fault did not reappear

martijnende avatar Sep 06 '24 17:09 martijnende

Thanks for the suggestion, @Micke90s , and sorry for not responding sooner; I had shelved this at the time. I performed an upgrade today, I am now at kernel version 6.1.0-23-amd64, running Debian 12 (bookworm). Currently the host does not have any graphics hardware that I'm aware of. It definitely doesn't have a card in it, I don't know if it has any built-in graphics.

@martijnende thanks for suggesting what worked for you! That very well could be the solution. I had my server-files in a docker volume, so I changed that to use a local directory instead, and deleted that docker volume. I also deleted the server-data folder. I then updated core-keeper and started it up. It created those two directories with root:root as the owner:group. I changed it to root:docker and changed the permission to g+x (775) as I have done with other docker compose services, but when I start the service those folders both remain empty, and the server doesn't start because "./CoreKeeperServer: No such file or directory". I've done a docker compose down and up to see if rebuilding the container populates those directories, but it doesn't seem to.

Azmaeus avatar Sep 08 '24 01:09 Azmaeus

@Azmaeus do you run docker as root or non-root user? As a non-root user, you typically set ownership to your user instead of root (e.g chown -R user:group server-files/). Since you set the permissions to 775 and set the group to docker, I suspect that your user is not in the docker group, hence you (= the container) have no write permissions. You can check this with id user (replace user with your user name); if the docker group doesn't show up, you either need to change the group with chown, or add your user to the docker group with sudo usermod -a -G docker user (replace user with your user name; the -a is important).

If you're not sure, set the permissions to 777 for testing. This is probably the easiest way to check that your problem is caused by the permissions.

martijnende avatar Sep 08 '24 08:09 martijnende

Posted in #53 too,

The user inside the container, by default, is steam with the UID and GUID of 1000. In my case, I had to

chown 1000:1000 /var/game-data/corekeeper

in order to run the container with

docker run ... -v /var/game-data/corekeeper:/home/steam/core-keeper-data ...

sdedovic avatar Sep 19 '24 03:09 sdedovic

Thank you, @martijnende and @sdedovic ! I changed the permissions to 777 to test and it worked! So I just need to fix the permissions

Azmaeus avatar Sep 29 '24 01:09 Azmaeus