ryansheehan / terraria

Dockerfile for terraria
MIT License
299 stars 104 forks source link

Fatal error upon running #115

Open Spawn43 opened 2 years ago

Spawn43 commented 2 years ago

I'm trying to run this through portainer using an existing world. When i attempt to run the container i get as far as world saved before the crash.

Validating world save: 17%

Validating world save: 33%

Validating world save: 56%

Validating world save: 76%

Backing up world file

[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object

  at Terraria.Main.startDedInputCallBack () [0x00017] in <0fcd5f39a6264235b839ac215b842ba8>:0 

  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <533173d24dae460899d2b10975534bb0>:0 

  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <533173d24dae460899d2b10975534bb0>:0 

  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <533173d24dae460899d2b10975534bb0>:0 

  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <533173d24dae460899d2b10975534bb0>:0 

  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <533173d24dae460899d2b10975534bb0>:0 

To my understanding i've done everything correct I've bound the /root/.local/share/Terraria/Worlds to my worlds folder, and then put in the enviroment variable for the world name. Any idea on how to fix this would be greatly appreciated

aadityadhruv commented 2 years ago

Currently facing the same issue. This error only happens if I run the command in detached mode. If run it with interactive + tty, it works just fine. Not sure what is the reason for this.

aadityadhruv commented 2 years ago

Just figured a way around this. You can use both the -it flag and the -d flag (ie run it detached but with the tty), and the server runs fine! I am guesssing this has something to do with how the server reads input? Anyway this workaround I suggested works. Here is the command for your reference:

podman run -d -it --rm -v ./world:/root/.local/share/Terraria/Worlds:Z -p 7777:7777 ryshe/terraria -world /root/.local/share/Terraria/Worlds/<World-Name>.wld -config /root/.local/share/Terraria/Worlds/config.json