Devidian / docker-spaceengineers

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

World Deleted? After Update #46

Closed Borderman2 closed 1 year ago

Borderman2 commented 1 year ago

Hello, it's me again today we where playing on the server and we lost connection to it assuming it was a another chrash but the server didn't come back on the network.

i assume that the network connection got cut. the server continued to functiond normal (without connection). after the auto restart from the server it couldn't connect to steam and tried a few times to establish a connection, when the connection finally came back steam made an update. and now the "instances" folder is empty.

can you help out?

Logs.txt

sorry that the logs are in a txt file otherwise it would have looked bad (and im lazy to format). those are the last surviving logs.

best regards 2B.

Devidian commented 1 year ago

Hey, how do you run the image? I mean how did you connect the "instances" folder? Do you use volumes, or do you use host directories?

Borderman2 commented 1 year ago

Hey, Whatever comes as default is what i am are using. im not a expert with docker containers so if you mean mounting a directory or setting a WORKDIR i have not done that.

best regards 2B.

Devidian commented 1 year ago

If you start it with "docker run" let me know your full starting command and if you run with a composer file let me know its contents please.

Borderman2 commented 1 year ago

in the folder where i have downloaded the docker i use docker-compose up -d to start it. i use docker container ls to list if its there and docker container logs -f se-ds-docker to see its logs.

and this is the content of the docker-compose file.

version: '3.8'

services:
  se-server:
    build: .
    image: spaceengineers:latest
    container_name: se-ds-docker
    restart: unless-stopped
    volumes:
      # left side: your docker-host machine
      # right side: the paths in the image (!!do not change!!)
      - /appdata/space-engineers/instances:/appdata/space-engineers/instances
      - /appdata/space-engineers/SpaceEngineersDedicated:/appdata/space-engineers/SpaceEngineersDedicated
      - /appdata/space-engineers/steamcmd:/root/.steam
    ports:
      - target: 27016
        published: 27016
        protocol: udp
        mode: host
    environment:
      - WINEDEBUG=-all
      - INSTANCE_NAME=SpaceServer
      - PUBLIC_IP=127.0.0.1
      # public ip required for healthcheck
Devidian commented 1 year ago

Ok, if you use this file, your instances folder should never be cleared at all by the image. Could anything on your host-machine delete the folder?

My idea was that you use docker-volumes instead of host links, that might lead to empty folders maybe but in your case it might be host related issue.

Borderman2 commented 1 year ago

i was going to answer but git went down ... anyway everything else was fine but space, is it possible to store the world in the home directory?

Devidian commented 1 year ago

sure, you can change the left part of volumes to whatever you want.

Borderman2 commented 1 year ago

i m looking at the documentation and if im understanding it correctly i need to add volumes: - myapp:/home/SE/ but what doese myapp stand for?

im not an expert with docker containers. if you could help out that woud be very appreciated.

Devidian commented 1 year ago

One way is to change the left side like this:

version: '3.8'

services:
  se-server:
    build: .
    image: spaceengineers:latest
    container_name: se-ds-docker
    restart: unless-stopped
    volumes:
      # left side: your docker-host machine
      # right side: the paths in the image (!!do not change!!)
      - /home/SE:/appdata/space-engineers/instances
      - /appdata/space-engineers/SpaceEngineersDedicated:/appdata/space-engineers/SpaceEngineersDedicated
      - /appdata/space-engineers/steamcmd:/root/.steam
    ports:
      - target: 27016
        published: 27016
        protocol: udp
        mode: host
    environment:
      - WINEDEBUG=-all
      - INSTANCE_NAME=SpaceServer
      - PUBLIC_IP=127.0.0.1
      # public ip required for healthcheck

Another way is to add a docker volume like this: see documentation

version: '3.8'

services:
  se-server:
    build: .
    image: spaceengineers:latest
    container_name: se-ds-docker
    restart: unless-stopped
    volumes:
      # left side: your docker-host machine
      # right side: the paths in the image (!!do not change!!)
      - instancesVolume:/appdata/space-engineers/instances
      - gameVolume:/appdata/space-engineers/SpaceEngineersDedicated
      - steamVolume:/root/.steam
    ports:
      - target: 27016
        published: 27016
        protocol: udp
        mode: host
    environment:
      - WINEDEBUG=-all
      - INSTANCE_NAME=SpaceServer
      - PUBLIC_IP=127.0.0.1
      # public ip required for healthcheck
volumes:
  instancesVolume:
  gameVolume:
  steamVolume:
Borderman2 commented 1 year ago

ok thank you, sad that the world is lost but now we can at least make an script that saves the current backup folder and zip it.