Skip to content

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

@Partmedia

Description

@Partmedia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions