ryansheehan / terraria

Dockerfile for terraria
MIT License
291 stars 104 forks source link

vanilla-1.4.4.1-2 | Unhandled Exception #120

Closed NetoSimoes closed 1 year ago

NetoSimoes commented 1 year ago

Context:

Running docker version 20.10.18, build b40c2f6 Running docker image ryshe/terraria:vanilla-1.4.4.1-2 Run options sudo docker run -it -p 7777:7777 -v $HOME/terraria/world:/root/.local/share/Terraria/Worlds ryshe/terraria:vanilla-1.4.4.1-2

After boot, when user tries to join the server, crashes

Log

Server crash: 9/28/2022 9:02:35 PM
System.TypeLoadException: Could not set up parent class, due to: Could not set up parent class, due to: Could not set up parent class, due to: Could not load type of field 'System.Windows.Forms.Control:accessibility_object' (59) due to: Could not load file or assembly 'Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:/terraria-server/System.Windows.Forms.dll type:Control member:(null) assembly:/terraria-server/System.Windows.Forms.dll type:ScrollableControl member:(null) assembly:/terraria-server/System.Windows.Forms.dll type:ContainerControl member:(null)
  at Terraria.Main.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x00039] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at Terraria.Main.DedServ () [0x00d4f] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at Terraria.Program.LaunchGame (System.String[] args, System.Boolean monoArgs) [0x000c6] in <a7dba2c2017e482d8fabbe6729c04922>:0

Please send crashlog.txt to support@terraria.org
================
09/28/2022 21:02:36: Unhandled Exception
Thread: 12 []
Culture:
Exception: System.TypeLoadException: Could not set up parent class, due to: Could not set up parent class, due to: Could not set up parent class, due to: Could not load type of field 'System.Windows.Forms.Control:accessibility_object' (59) due to: Could not load file or assembly 'Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:/terraria-server/System.Windows.Forms.dll type:Control member:(null) assembly:/terraria-server/System.Windows.Forms.dll type:ScrollableControl member:(null) assembly:/terraria-server/System.Windows.Forms.dll type:ContainerControl member:(null)
  at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
  at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at Terraria.Program.ForceJITOnAssembly (System.Reflection.Assembly assembly) [0x00060] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at Terraria.Program.ForceLoadAssembly (System.Reflection.Assembly assembly, System.Boolean initializeStaticMembers) [0x0000d] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at Terraria.Program.ForceLoadThread (System.Object threadContext) [0x00005] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00025] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ThreadHelper.ThreadStart (System.Object obj) [0x0000f] in <a17fa1457c5d44f2885ac746c1764ea5>:0
================
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not set up parent class, due to: Could not set up parent class, due to: Could not set up parent class, due to: Could not load type of field 'System.Windows.Forms.Control:accessibility_object' (59) due to: Could not load file or assembly 'Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:/terraria-server/System.Windows.Forms.dll type:Control member:(null) assembly:/terraria-server/System.Windows.Forms.dll type:ScrollableControl member:(null) assembly:/terraria-server/System.Windows.Forms.dll type:ContainerControl member:(null)
  at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
  at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at Terraria.Program.ForceJITOnAssembly (System.Reflection.Assembly assembly) [0x00060] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at Terraria.Program.ForceLoadAssembly (System.Reflection.Assembly assembly, System.Boolean initializeStaticMembers) [0x0000d] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at Terraria.Program.ForceLoadThread (System.Object threadContext) [0x00005] in <a7dba2c2017e482d8fabbe6729c04922>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00025] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Threading.ThreadHelper.ThreadStart (System.Object obj) [0x0000f] in <a17fa1457c5d44f2885ac746c1764ea5>:0
ryansheehan commented 1 year ago

looks like the server is hanging when i generate a brand new world

ackvf commented 1 year ago

It does the same when running with existing world. Before this, I was using https://hub.docker.com/r/beardedio/terraria, but they don't have 1441 yet, so I made my own image https://hub.docker.com/repository/docker/ackvf/terraria but this also fails with similar error to the above.

ryansheehan commented 1 year ago

I just ran download directly on my linux machine. I'm suspecting the mono base image is the issue, still experimenting...

ryansheehan commented 1 year ago

I just ran download directly on my linux machine. I'm suspecting the mono base image is the issue, still experimenting...

no luck running with ubuntu:22.04

ackvf commented 1 year ago

So it fails when run in ubuntu directly too, not just in docker?

davy326 commented 1 year ago

Also running on ubuntu:22.04. It starts fine but crashes when I or someone else tries to connect.

ryansheehan commented 1 year ago

Also running on ubuntu:22.04. It starts fine but crashes when I or someone else tries to connect.

is that running through the container or running directly?

ryansheehan commented 1 year ago

So it fails when run in ubuntu directly too, not just in docker

in a container

davy326 commented 1 year ago

Oh my b. On docker

kyagloski commented 1 year ago

Im getting this issue specifically when a player joins the server. When I attach a console to the server process via portainer I can see the terraria server comes up just fine, then I join with my client and the server spits out this same error message a few times then gives out. Currently still digging for a solution.

ackvf commented 1 year ago

I have a windows machine and a linux server (Synology NAS).

The dedicated server runs locally on Windows fine. So now I have just tried running it from WSL 2.0 under Windows (without docker) and I get the same error.

Ubuntu 20.04 on Windows

Log ``` Terraria Server v1.4.4.1 Listening on port 7777 Type 'help' for a list of commands. : Server started 127.0.0.1:39072 is connecting... ================ 09/29/2022 00:26:13: Unhandled Exception Thread: 13 [] Culture: Exception: System.TypeLoadException: Could not set up parent class, due to: Could not set up parent class, due to: Could not set up parent class, due to: Could not load type of field 'System.Windows.Forms.Control:accessibility_object' (59) due to: Could not load file or assembly 'Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:/mnt/c/Users/Qwerty/Downloads/terraria-server-1441/1441/Linux/System.Windows.Forms.dll type:Control member:(null) assembly:/mnt/c/Users/Qwerty/Downloads/terraria-server-1441/1441/Linux/System.Windows.Forms.dll type:ScrollableControl member:(null) assembly:/mnt/c/Users/Qwerty/Downloads/terraria-server-1441/1441/Linux/System.Windows.Forms.dll type:ContainerControl member:(null) at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr) at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in :0 at Terraria.Program.ForceJITOnAssembly (System.Reflection.Assembly assembly) [0x00060] in :0 at Terraria.Program.ForceLoadAssembly (System.Reflection.Assembly assembly, System.Boolean initializeStaticMembers) [0x0000d] in :0 at Terraria.Program.ForceLoadThread (System.Object threadContext) [0x00005] in :0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00025] in :0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in :0 at System.Threading.ThreadHelper.ThreadStart (System.Object obj) [0x0000f] in :0 ================ [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not set up parent class, due to: Could not set up parent class, due to: Could not set up parent class, due to: Could not load type of field 'System.Windows.Forms.Control:accessibility_object' (59) due to: Could not load file or assembly 'Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:/mnt/c/Users/Qwerty/Downloads/terraria-server-1441/1441/Linux/System.Windows.Forms.dll type:Control member:(null) assembly:/mnt/c/Users/Qwerty/Downloads/terraria-server-1441/1441/Linux/System.Windows.Forms.dll type:ScrollableControl member:(null) assembly:/mnt/c/Users/Qwerty/Downloads/terraria-server-1441/1441/Linux/System.Windows.Forms.dll type:ContainerControl member:(null) at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr) at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in :0 at Terraria.Program.ForceJITOnAssembly (System.Reflection.Assembly assembly) [0x00060] in :0 at Terraria.Program.ForceLoadAssembly (System.Reflection.Assembly assembly, System.Boolean initializeStaticMembers) [0x0000d] in :0 at Terraria.Program.ForceLoadThread (System.Object threadContext) [0x00005] in :0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00025] in :0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in :0 at System.Threading.ThreadHelper.ThreadStart (System.Object obj) [0x0000f] in :0 qwerty@QWERTY-XPS9310:~/Qwerty/Downloads/terraria-server-1441/1441/Linux$ ```
ryansheehan commented 1 year ago

I will need some help testing, but i switched the bootstrap to use the TerrariaServer.bin.x86_64 wrapper. The world seems to be generating and running fine, but i dont have a client to use to connect with

NetoSimoes commented 1 year ago

Latest image from terraria api: https://terraria.org/api/download/pc-dedicated-server/terraria-server-1441-fixed.zip

ryansheehan commented 1 year ago

Anyone try this pr source out to help me? I dont have a client ready to use. https://github.com/ryansheehan/terraria/pull/121

NetoSimoes commented 1 year ago

122

ryansheehan commented 1 year ago

122

running the deployment now

NetoSimoes commented 1 year ago

Fixed

ackvf commented 1 year ago

OMG, Terraria team fixed it on their end. 🎉🎉🎉🥂🥳

ryansheehan commented 1 year ago

Thanks for the help Neto

davy326 commented 1 year ago

This was resolved very quickly! Nice Job!