D12-Dev / OpenWorld

A Free Multiplayer Mod For Rimworld
Other
96 stars 17 forks source link

LinuxX64 - NullReferenceException #15

Closed tofi92 closed 2 years ago

tofi92 commented 2 years ago

Hi, I'm trying to dockerize this server and on startup I get a NullReferenceException:

[3/22/2022 8:07:40 AM] │ Using Culture Info: [en-US]
[3/22/2022 8:07:40 AM] │ Base Directory At: [/app/]
[3/22/2022 8:07:40 AM] │ Generating Settings File...
[3/22/2022 8:07:40 AM] │ Loading Settings File...
[3/22/2022 8:07:40 AM] │ No Mods Folder Found, Generating...
[3/22/2022 8:07:40 AM] │ No Whitelisted Mods Folder Found, Generating...
[3/22/2022 8:07:40 AM] │ No Players Folder Found, Generating...
[3/22/2022 8:07:40 AM] │ No Bans File Found, Ignoring...
[3/22/2022 8:07:40 AM] │ Generating World File...
[3/22/2022 8:07:40 AM] │ Loading World File...
Unhandled exception. [3/22/2022 8:07:40 AM] │ Server Started
[3/22/2022 8:07:40 AM] │ Type 'Help' To See Available Commands
[3/22/2022 8:07:40 AM] │ Checking Thread Started

System.NullReferenceException: Object reference not set to an instance of an object.
   at Open_World_Server.MainProgram.ListenForCommands()
   at Open_World_Server.MainProgram.Main()

Dockerfile:

# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/runtime AS base
WORKDIR /app
RUN /bin/bash -c 'apt-get update'
RUN /bin/bash -c 'apt-get install -y curl wget unzip'
RUN /bin/bash -c 'curl -s https://api.github.com/repos/TastyLollipop/OpenWorld/releases/latest \
| grep "browser_download_url.*linuxX64.zip" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -'
RUN /bin/bash -c 'unzip linuxX64.zip'

ENTRYPOINT ["dotnet", "Open World Server.dll"]

The linuxX64.zip does not contain a "Server Settings.txt" and no "World Settings.txt" - should I include/generate those?

ghost commented 2 years ago

Those two files do get generated by the program when It boots. Following what the console log says, those two files should have been generated at startup. Can you verify that's the case? If It is, please check that the file formatting is correctly applied. Could you also tell what distro are you using for the host? And If you have managed to create a server in the past?

tofi92 commented 2 years ago

I included both files (from the windows download) and added them to the container - no difference. Host OS is Debian 10. Starting a server on the host works fine.

f0rkz commented 2 years ago

Yeah... so this isn't going to work unless you launch it with an active tty. The app runs an interactive cli.

Use docker run -itd

Edit your entrypoint to launch in screen (gross):

screen -S openworld /root/.dotnet/dotnet /openworld/Open\ World\ Server.dll