Devidian / docker-spaceengineers

A Docker for Space Engineers Dedicated Server
87 stars 21 forks source link

server doesn't start: World <worldname> not found. #27

Closed IARI closed 1 year ago

IARI commented 2 years ago

I haven't managed to successfully run the container. The log game server always crashes with a log like this:

----------------------------------START GAME---------------------------------
2022-02-22 20:48:23.709: App Version: 01_200_030
2022-02-22 20:48:23.720: Is official: True [NO][NIS][NAMP]
2022-02-22 20:48:23.722: Environment.ProcessorCount: 4
2022-02-22 20:48:23.726: Environment.OSVersion: Microsoft Windows 7 Professional (Microsoft Windows NT 6.1.7601 Service Pack 1)
2022-02-22 20:48:23.726: Environment.CommandLine: "Z:\appdata\space-engineers\SpaceEngineersDedicated\DedicatedServer64\SpaceEngineersDedicated.exe" -noconsole -ignorelastsession -path Z:\appdata\space-engineers\instances\Spaceblabla
2022-02-22 20:48:23.726: Environment.Is64BitProcess: True
2022-02-22 20:48:23.726: Environment.Is64BitOperatingSystem: True
2022-02-22 20:48:23.726: Environment.Version: .NET Framework 4.8.3761.0
2022-02-22 20:48:23.726: Environment.CurrentDirectory: Z:\appdata\space-engineers\SpaceEngineersDedicated\DedicatedServer64
2022-02-22 20:48:23.726: CPU Info: AMD EPYC 7702P 64-Core Processor
Computer does not meet minimum requirements, forcing Experimental mode
2022-02-22 20:48:25.772: Bind IP : 172.70.0.75:27016
dbus[90]: arguments to dbus_connection_send_with_reply_and_block() were incorrect, assertion "connection != NULL" failed in file ../../../dbus/dbus-connection.c line 3544.
This is normally a bug in some application using the D-Bus library.
  D-Bus not built with -rdynamic so unable to print a backtrace
wine: Assertion failed at address 00007F8240939CE1 (thread 006c), starting debugger...
2022-02-22 20:48:29.893: Networking service: Steam
2022-02-22 20:48:29.893: Server successfully started
2022-02-22 20:48:29.893: Product name: Space Engineers
2022-02-22 20:48:29.893: Desc: Space Engineers
2022-02-22 20:48:29.893: Public IP: 194.13.83.121
2022-02-22 20:48:29.894: User ID: [009...964]
2022-02-22 20:48:29.897: Server connected to Steam
2022-02-22 20:48:30.417: Server Name: Spaceblabla
2022-02-22 20:48:30.417: World Name: Earth Planet
2022-02-22 20:48:30.445: Auto Restart Enabled
2022-02-22 20:48:30.507: Remote Server Listener started. Listening on port 8080
2022-02-22 20:48:33.626: World Earth Planet not found.
2022-02-22 20:48:33.626: Creating new one with same name
2022-02-22 20:48:33.627: Cannot start new world - Premade world not found 
-----------------------------------END GAME----------------------------------

What I have done:

Now after it failed, as suggested here I found that inside the instance /Saves/LastSession.sbl would have an absolute local path and corrected it. it didn't help.

For some reason, the world just isn't loaded.

Devidian commented 2 years ago

Good morning, can you post your compose file or startup parameter too?

IARI commented 2 years ago

Hello,

I have actually managed to find a solution by now. I am still not sure about what happened exactly but i have a suspicion.

So after I set up the Dedicated Server locally on my machine and started it for the first time, it had created the folder \Saves\Earth Planet 02-22-2022 20-17-28 within its instance folder. Then, whenever the docker container started, for some reason it always kept writing the following value in SpaceEngineers-Dedicated.cfg:

<LoadWorld>Z:\appdata\space-engineers\instances\Spaceblabla\Saves\Earth Planet</LoadWorld>

At first I thought the path form the save that I had uploaded must somehow have been crippled along the way, and had its end-part cut off - but that doesn't seem to make so much sense, why would it particularly cut off at that point. So now my assumption is, that this Path is actually somehow generated from 1. the instance directory and 2. the World name

<WorldName>Earth Planet</WorldName>

If this assumption is correct, that would mean that renaming the save is an important step (which I have not yet found in any forum, documentation or tutorial for setting up a dedicated SE server) Can you clarify on this?

For the sake of completeness and finding out what happened here's the docker file:

version: "3.8"

services:
    spaceengineers:
        container_name: "spaceengineers"
        image: "devidian/spaceengineers"
        restart: unless-stopped
        volumes:
            # left side: your docker-host machine
            # right side: the paths in the image (!!do not change!!)
            - instances:/appdata/space-engineers/instances
            - dedicated:/appdata/space-engineers/SpaceEngineersDedicated
            - steamcmd:/root/.steam
        ports:
          - target: 8080
            published: 18080
            protocol: tcp
            mode: host
          - target: 27016
            published: 27016
            protocol: udp
            mode: host
        networks:
            proxy:
                ipv4_address: 172.70.0.75
        environment:
          - WINEDEBUG=-all
          # change TestInstance to your instance name
          - INSTANCE_NAME=Spaceblabla
          #- INSTANCE_IP=194.13.83.121
          #- CURRENT_IP=194.13.83.121
        labels:
            - "traefik.enable=false"
            - "traefik.http.routers.spaceengineers.entrypoints=https"
            - "traefik.http.routers.spaceengineers.rule=Host(`<REDACTED>`)"
            - "traefik.http.routers.spaceengineers.service=spaceengineers"
            - "traefik.http.services.spaceengineers.loadbalancer.server.port=8080"

volumes:
    instances:
    dedicated:
    steamcmd:

networks:
    proxy:
        external: true
Devidian commented 2 years ago

Okay, if we take a look at the example in this repository, we first have a directory called DockerQuickStart which is the INSTANCE_NAME of the quick start example world. If you then take a look at the SpaceEngineers-Dedicated.cfg inside this directory and search for WorldName, you will find that the world is called Docker Star System, so the result is, that the save is found in /INSTANCE_NAME/Saves/WorldName => /DockerQuickStart/Saves/Docker\ Star\ System/.

The entrypoint.sh script takes the WorldName and the INSTANCE_NAME and replaces the string in LoadWorld with that format because if you generate your instance on Windows, the path is something like <LoadWorld>C:\ProgramData\SpaceEngineersDedicated\DockerQuickStart\Saves\Docker Star System</LoadWorld> which will not find the world you created and therefore create a new one.

So if you create an instance on windows, it should look like the example in this repository, including Save directory.

ryanwake commented 2 years ago

Just as a side note, unless I am generating it incorrectly on Windows. The Save folder gets saved as "WorldName " so you do have to chop out the date time from the folder when copying it over.

For example, I created a server on my Windows machine, World Name of Star System. It automatically creates "Saves\Star System 07-06-2022 12-15-12" in the instance path. So, I had to chop off the date time and copy it to the server. Might be worth mentioning in the documentation.

I also had an issue, I am using Unraid to host my containers, and INSTANCE_NAME was not configurable, so I had to manually add a variable called INSTANCE_NAME and set the name of my instance as it wasn't loading the correct instance. But that may be some weirdness related to how Unraid does stuff.