jammsen / docker-sons-of-the-forest-dedicated-server

Docker container to easily provision and manage Sons of the Forest Dedicated Server with Wine
https://hub.docker.com/r/jammsen/sons-of-the-forest-dedicated-server
134 stars 19 forks source link

Issue on docker swarm setup #25

Closed gitzec closed 10 months ago

gitzec commented 10 months ago

Have you read the Important information text above

Current behavior

Hi, as the title states I am not able to get this up and running.

I am running a 4 node docker swarm here and also a lot of services in it.

For SOTF i added this to my stack:

  sotf: # Sons of the Forest Server
    image: jammsen/sons-of-the-forest-dedicated-server:latest
    environment:
      ALWAYS_UPDATE_ON_START: 1
    ports:
      - "8766:8766/udp"
      - "27016:27016/udp"
      - "9700:9700/udp"
    volumes:
      - /media/docker/darknet_sotf/steamcmd/:/steamcmd
      - /media/docker/darknet_sotf/sonsoftheforest/:/sonsoftheforest
      - /media/docker/darknet_sotf/winedata/:/winedata
    deploy:
      placement:
        preferences:
          - spread: node.labels.Focus == power
    networks:
      - docker-darknet

When the container starts up it creates files and folders inside the three volumes (which are hosted from a QTS NAS via nfs, exports are mounted on each docker node of the swarm).

Tree looks like this:

.
├── sonsoftheforest
│   ├── steam_appid.txt
│   └── userdata
│       ├── dedicatedserver.cfg
│       └── ownerswhitelist.txt
├── steamcmd
│   ├── linux32
│   │   ├── libstdc++.so.6
│   │   └── steamcmd
│   ├── steamcmd.sh
│   └── steam.sh
└── winedata
    └── WINE64
        ├── dosdevices
        │   ├── c: -> ../drive_c
        │   └── z: -> /
        ├── drive_c
        │   ├── ProgramData
        │   │   └── Microsoft
        │   │       └── Windows
        │   │           ├── Start Menu
        │   │           │   └── Programs
        │   │           │       ├── Administrative Tools
        │   │           │       └── StartUp
        │   │           └── Templates
        │   ├── Program Files
        │   │   ├── Common Files
...

But, the server never comes up. The container dies and a new one is spawned all the time. The last log I saw shows this:

>>> Doing a fresh install of the gameserver
>>> Checking if Wine is set in bashrc
>>> Setting up Wine in bashrc
/steamcmd/steamcmd.sh: line 29: /steamcmd/linux32/steamcmd: Permission denied
>>> Doing an update of the gameserver
/steamcmd/steamcmd.sh: line 29: /steamcmd/linux32/steamcmd: Permission denied
0024:err:virtual:map_file_into_view failed to set PROT_EXEC on file map, noexec filesystem?
0024:err:virtual:virtual_map_section mapping 0x250000 17000 0 failed
00d8:err:virtual:map_file_into_view failed to set PROT_EXEC on file map, noexec filesystem?
00d8:err:virtual:virtual_map_section mapping 0x250000 17000 0 failed
>>> Starting the gameserver
wine: failed to open "/sonsoftheforest/SonsOfTheForestDS.exe": c0000135

I did a chmod 777 /steamcmd/linux32/steamcmd even though it was +x for root anyway but that did not solve the issue.

Desired behavior

Container starts up and the SOTF server is being visible in the game client.

Links to screenshots

No response

To Reproduce

See above.

Software setup

Hardware setup

Additional context

Thanks for baking, publishing and even supporting this image.

jammsen commented 10 months ago

Hey @gitzec it might be have something todo that you try to host it from a NFS and might be down to NFS limitation, i am really not sure and that last time i did something with Swarm is already a time ago, so im also not sure if it might come down to that.

Things you could try to do: Could you try to start it in a normal way without Swarm and locally? (Basically single node, manual start and everything local)

Could you try to start it with swarm but with local-storage? (Basically do it the Swarm way but with a local storage to figure out if the network mount is the limitation)

gitzec commented 10 months ago

Hammer!

The NFS indeed was the cause. I moved everything from the share to my home dir on the desired node, redirected the volumes, nailed the service to this node and some minutes later I already was in the game.

After some patches the game should be playable by now.

Thank you sooo much! Good job!

jammsen commented 10 months ago

@gitzec Thanks, it was just a guess but im happy it works now, have fun gaming.

jammsen commented 10 months ago

@gitzec also if you like the work, consider giving the repo a ⭐

gitzec commented 8 months ago

I would like to add this info to this case:

In /etc/fstab of the swarm nodes I now use the nfs mount option exec . This makes the server work when the Docker volumes are stored on an nfs drive. The default (when not set) for nfs mounts is noexec.

Changed line in fstab:

nas1:/docker   /media/docker   nfs   users,bg,nconnect=8,exec   0   0
                                                         ☝

(the data of the sotf server is in a subdirectory of this share)

2023-11-06T12:50:45.036672996Z #DSL Incoming client connection with auth ticket
2023-11-06T12:50:45.037071149Z #DSL Steam auth successful for client 2 with steam id 1337133713371337, username SomeGamer
2023-11-06T12:50:45.065428379Z #DSL Server waking up...
jammsen commented 8 months ago

If you use fstab for mounting over nfs or cifs, please dont forget the options like UID/GID/dirmode/filemode for example. https://linux.die.net/man/8/mount.cifs