Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

[UNSTABLE] Can't launch barotrauma. That's the bug.

Open Regalis11 opened this issue 7 months ago • 4 comments

Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/16068

Originally posted by ubertpendragon May 13, 2025

Disclaimers

  • [X] I have searched the issue tracker to check if the issue has already been reported.
  • [ ] My issue happened while using mods.

What happened?

I don't have a crash log or anything. It just doesn't launch

Reproduction steps

  1. Try launching Barotrauma [Unstable]
  2. Can't

Bug prevalence

Just once

Single player or multiplayer?

Single player

-

No response

Version

v1.9.0.0 (Unstable)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Regalis11 avatar May 14 '25 05:05 Regalis11

Fixed in https://github.com/FakeFishGames/Barotrauma-development/commit/89ac7272155ac4677883489d0a85b25e04a85d7a and updated the unstable build. Should still be tested on Mac and Linux.

Regalis11 avatar May 14 '25 06:05 Regalis11

Tested on steam unstable branch, linux and mac

No issues on linux

Mac gives many errors that are similar, but doesn't cause a crash and was able to launch rounds in SP and MP

Cannot copy "/Users/joonasle/Library/Application Support/Steam/steamapps/workshop/content/602960/2559634234/Binary/System.Resources.Reader.dll" to "/Users/joonasle/Documents/Library/Application Support/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/Binary/System.Resources.Reader.dll": unauthorized access. The file/folder might be read-only! {Access to the path '/Users/joonasle/Documents/Library/Application Support/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/Binary/System.Resources.Reader.dll' is denied.}
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at [System.IO](http://system.io/).FileSystem.TryCloneFile(String sourceFullPath, String destFullPath, Boolean overwrite, Boolean& cloned)
   at [System.IO](http://system.io/).FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at [Barotrauma.IO](http://barotrauma.io/).File.Copy(String src, String dest, Boolean overwrite, Boolean catchUnauthorizedAccessExceptions) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Utils\SafeIO.cs:line 447
Inner exception: Operation not permitted
Couldn't load xml document "/Users/joonasle/Documents/Library/Application Support/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/filelist.xml"! {Access to the path '/Users/joonasle/Documents/Library/Application Support/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/filelist.xml' is denied.}
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at [System.IO](http://system.io/).Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at [Barotrauma.IO](http://barotrauma.io/).File.Open(String path, FileMode mode, FileAccess access, Nullable`1 share, Boolean catchUnauthorizedAccessExceptions) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Utils\SafeIO.cs:line 532
   at Barotrauma.XMLExtensions.TryLoadXml(String filePath, Exception& exception) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Serialization\XMLExtensions.cs:line 98
Inner exception: Operation not permitted

Image

Jasontti avatar May 15 '25 10:05 Jasontti

@Jasontti I'm interested in trying this out to figure out why that happens, as I haven't seen those errors myself – was this just from running the now current unstable, from Steam?

ilmarilahti avatar May 20 '25 22:05 ilmarilahti

@ilmarilahti Yes, just from steam. I have rider installed on that Mac and have successfully compiled DLC projects. Did some testing and found the issue.

Notes from testing: Old dotnet version according to dotnet --info was 6.0.31 Even though i could compile DLC project and run it without issues

Updating dotnet to 9.0.5 did not resolve warnings.

Steam uses /Users/<user>/Documents/Library/ to store workshop items. I'm not sure if this could be configured in game somehow

Seems that workshop items are automatically stored in icloud. Making library folder to be always available locally fixed things partly, but would still warn on some files. When you launch the game, icloud sees them being accessed and does something with them, causing them to not be available for some reason.

Disabling icloud syncing for documents folder fixed the issue.

Could not find a way to exclude steams workshop folder from icloud, there might be a potential workaround with symlinking and having .nosync suffix in folders name example found online:

mv MyFolder .MyFolder.nosync
ln -s .MyFolder.nosync MyFolder

There still is one mystery why there is a warning for accessing /Users/<use>/Library/ as it seemingly doesn't exist, maybe some iCloud thing.

I don't like disabling iCloud syncing on documents folder as a solution for this.

Jasontti avatar May 23 '25 09:05 Jasontti

Ticket out dated. Game now launchable in unstable. Closing ticket.

Jasontti avatar Aug 21 '25 12:08 Jasontti