RobustToolbox icon indicating copy to clipboard operation
RobustToolbox copied to clipboard

Server fails to start when passed a directory with trailing slash in --data-dir

Open Partmedia opened this issue 2 months ago • 2 comments

Previously, starting a packaged server with a --data-dir containing a trailing slash worked. Now, this causes maps to fail to load:

System.InvalidOperationException: This branch should never be reached. Path: /Maps/Test/dev_map.yml
   at Robust.Shared.ContentPack.PathHelpers.SafeGetResourcePath(String baseDir, ResPath path) in RobustToolbox/Robust.Shared/ContentPack/PathHelpers.cs:line 88

Steps to Reproduce

  1. Check out space-station-14 fb22cefd8 and update engine submodule.
  2. dotnet build
  3. Compare running ./bin/Content.Server/Content.Server --data-dir /tmp with ./bin/Content.Server/Content.Server --data-dir /tmp/

You can also run Content.Packaging, get a ZIP, extract, and run Robust.Server with --data-dir. Because this doesn't load a map immediately, there is a latent fault when you try to start round and map loading fails.

Workaround

Don't pass directories with trailing slashes to --data-dir.

Partmedia avatar Nov 02 '25 06:11 Partmedia

Likely regressed in d4f265c314.

Partmedia avatar Nov 02 '25 07:11 Partmedia

both of the This branch should never be reached errors are infact reachable

the first one is very easy just have .. in any path, the other is trailing /

deltanedas avatar Nov 09 '25 00:11 deltanedas