JACOBSMILE / tmodloader1.4

An easy to configure Docker Image for tModLoader 1.4 servers.
Other
120 stars 29 forks source link

Can't start the server / Can't access the files #21

Closed SeppiDamgaard closed 1 year ago

SeppiDamgaard commented 1 year ago

Downloaded the container from the Unraid appstore, and I got some issues regarding the container seems to be missing access to files.

My other containers are working fine, and I've tried reinstalling this a couple of times.

The 'Worlds' and 'Workshop' folders are created like they should, but empty.

This is the error part of the console:

The original Error below
System.UnauthorizedAccessException: Access to the path '/home/terraria/.local/share/Terraria/tModLoader/Worlds/World.wld' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at [Microsoft.Win32.SafeHandles.SafeFileHandle.Open](http://microsoft.win32.safehandles.safefilehandle.open/)(String path, OpenFlags flags, Int32 mode)
   at [Microsoft.Win32.SafeHandles.SafeFileHandle.Open](http://microsoft.win32.safehandles.safefilehandle.open/)(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at Terraria.Utilities.FileUtilities.Write(String path, Byte[] data, Int32 length, Boolean cloud) in tModLoader\Terraria\Utilities\FileUtilities.cs:line 88
   at Terraria.IO.WorldFile.InternalSaveWorld(Boolean useCloudSaving, Boolean resetTime) in tModLoader\Terraria\IO\WorldFile.cs:line 543
   at Terraria.IO.WorldFile.<>c__DisplayClass57_0.<SaveWorld>b__0() in tModLoader\Terraria\IO\WorldFile.cs:line 500
   at Terraria.Utilities.FileUtilities.ProtectedInvoke(Action action) in tModLoader\Terraria\Utilities\FileUtilities.cs:line 170
   at Terraria.IO.WorldFile.SaveWorld(Boolean useCloudSaving, Boolean resetTime) in tModLoader\Terraria\IO\WorldFile.cs:line 499
   at Terraria.IO.WorldFile.SaveWorld() in tModLoader\Terraria\IO\WorldFile.cs:line 476
Running one update...

Object reference not set to an instance of an object. (see server.log for full trace)
tModLoader v2022.9.47.49 Fatal Error
Main engine crash

Tip: This is likely a mod's fault. Disable mods one by one and check if the issue persists

System.NullReferenceException: Object reference not set to an instance of an object.
   at Terraria.Main.WriteFancyWorldLoadErrorToConsole() in tModLoader\Terraria\Main.cs:line 4723
   at Terraria.Main.DedServ_PostModLoad(Boolean& reloadMods) in tModLoader\Terraria\Main.cs:line 4645
   at Terraria.Main.DedServ() in tModLoader\Terraria\Main.cs:line 4214
   at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 233

A server.log file containing error information has been generated in
/home/terraria/terraria-server/tModLoader-Logs
(You will need to share this file if asking for help)

UnRaid Version: 6.11.3

JACOBSMILE commented 1 year ago

Hi, I published a pull request #22 to attempt to fix this issue. Please pull the latest image and see if it works for you now, and report back.

MrGreaterThan commented 1 year ago

Unfortunately I am still getting the same error.

cdnutter commented 1 year ago

Just discovered a quick workaround for this, set the permissions on the host side to 1000:1000 as the container has a user 'terraria' using with 1000:1000 perms.

Should fix the issue of building the server.

JACOBSMILE commented 1 year ago

Thanks for the information, @IAmChrisAMA . I will add this to the documentation.

ySteini commented 1 year ago

Just discovered a quick workaround for this, set the permissions on the host side to 1000:1000 as the container has a user 'terraria' using with 1000:1000 perms.

Should fix the issue of building the server.

Hey how do I do this?

SeppiDamgaard commented 1 year ago

I fixed the issue, for me it had nothing to do with the image or container.

In unraid, if you haven't already, go to tools > New Permissions, select all disks and every share except appdata and run it.

Fixed this and boatload of other issues for me.

JACOBSMILE commented 1 year ago

Please review the updated documentation covering some permission requirements on the host to support volume mapping.

It has been copied below for your reference. (Commit 95a967f)

Permission Configuration This container uses an account named terraria internally which is a low-privileged user. Due to Unix kernel constraints, it may be necessary to grant UID and GID 1000 access to the mapped world and mod directories to properly launch the server.

To do this easily, perform the following command on your HOST's Mod and World directories:

chown 1000:1000 -R