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
97 stars 26 forks source link

Server crashes before starting with Segmentation fault #20

Open Azmaeus opened 1 year ago

Azmaeus commented 1 year ago

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

arguser commented 1 year ago

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

Azmaeus commented 1 year ago

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).

arguser commented 1 year ago

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.

Azmaeus commented 8 months ago

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[@]}"

Micke90s commented 6 months ago

@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?

martijnende commented 1 week ago

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

Azmaeus commented 1 week ago

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.

martijnende commented 1 week ago

@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.