jsknnr / enshrouded-server

Run Enshrouded dedicated server in a container
MIT License
176 stars 20 forks source link

proton-latest: he's dead jim #47

Open mooseh opened 5 months ago

mooseh commented 5 months ago

looks like the proton-latest release doesn't work. here are the last few lines from the stack trace

CAppInfoCacheReadFromDiskThread took 9 milliseconds to initialize
[I 00:00:01,491] [app] start creation step Init_FileSystem
[I 00:00:01,494] [app] start creation step Init_MountPackage
[I 00:00:02,670] +--"":  
[I 00:00:02,670]     |
[I 00:00:02,670]     +--"":
[I 00:00:02,670]         |
[I 00:00:02,670]         +--"gamebuild":  (#0) Archive -> '/gamebuild_path/enshrouded_server'
[I 00:00:02,670]         |
[I 00:00:02,670]         +--"gamebuild_path":  (#1) Native -> 'Z:/home/steam/enshrouded/'
[I 00:00:02,670] [app] start creation step Init_Version
[I 00:00:02,671] Game Version (SVN): 490142
[I 00:00:02,671] [app] start creation step Init_UserSystem
[W 00:00:02,671] [user] Couldn't retrieve steam friends interface.
[W 00:00:02,671] [user] Couldn't retrieve steam user interface.
[I 00:00:02,671] [app] start creation step Init_OnlineSystem
[I 00:00:02,674] [OnlineProviderSteam] started transition from 'Uninitialized' to 'Initialized' (current='<invalid>')!
[I 00:00:02,674] [app] start creation step Init_Session
[I 00:00:02,677] [app] start creation step Init_Tracking
[I 00:00:02,681] [app] start creation step Init_ResourceSystem
[W 00:00:02,683] [resource] Could not load resource cache file 'Z:/home/steam/enshrouded/enshrouded_server.krc'. error=file not found
[I 00:00:02,684] [app] start creation step Init_ResourcePreload_Start
[I 00:00:02,819] [app] start creation step Init_ResourcePreload_Wait
2024-02-01 15:49:37,934 INFO: Waiting for enshrouded_server.exe to be running
tail: invalid PID: ''
2024-02-01 15:49:37,943 ERROR: He's dead, Jim
jsknnr commented 5 months ago

Ah the infamous "He's dead, Jim" error. This means that the enshrouded_server.exe PID closed so I kill the container. The curious issue here is there is no other error.... hmm.. Let me do a local test again real quick as I would expect there to be additional logging.

jsknnr commented 5 months ago

Looking at your log, and looking at my code.... I think that there may be an issue in my while loop where I wait for the process to be running. I believe others haven't hit this bug because the process is coming up faster than it is for you so they only have to enter the loop once. I'll do a bit more testing and if I am right, I will release a bug fix.

jsknnr commented 5 months ago

Yep, I was treating my incremental timeout var like python instead of bash, lol whoops. Go ahead and pull sknnr/enshrouded-dedicated-server:proton-latest and try again. Thanks for the report.

kyz3 commented 5 months ago

Im running into this error as well, even after pulling just now. The v2.0.5 works, but gets super laggy even with just 1 player. And thats with 16 assigned cores lol

Logs as well:

[I 00:00:01,236] CPU Types: [I 00:00:01,237] Performance: 16 0000000000000000000000000000000000000000000000001111111111111111 [I 00:00:01,238] Efficient: 0 0000000000000000000000000000000000000000000000000000000000000000 [I 00:00:01,239] [task] TaskSystemSetup: [I 00:00:01,239] [task] mainWorkerCount: 2 [I 00:00:01,240] [task] nextMainWorkerIndex: 1 [I 00:00:01,241] [task] Group 'default' worker:17 main:2 [I 00:00:01,242] [task] 0: Task-default00 0000000000000000000000000000000000000000000000000000000000000000 ... [I 00:00:01,256] [task] 16: Task-default16 0000000000000000000000000000000000000000000000001111111111111111 [I 00:00:01,257] [task] Group 'background' worker:15 main:0 [I 00:00:01,258] [task] 0: Task-background00 0000000000000000000000000000000000000000000000001111111111111111 ... [I 00:00:01,267] [task] 14: Task-background14 0000000000000000000000000000000000000000000000001111111111111111 [I 00:00:01,268] [app] start creation step Init [I 00:00:01,269] [app] start creation step Init_Steamworks CAppInfoCacheReadFromDiskThread took 10 milliseconds to initialize [E 00:00:01,784] [steam] Failed to initialize Steamworks system...Generic Error [E 00:00:01,785] [steam] Message from Steam: InitGameServer failed [E 00:00:01,785] [app] Failed to create Steamworks. [I 00:00:01,791] [app] start destruction step Init [I 00:00:01,797] [enshrouded] Close Log file 2024-02-01 18:16:07,818 ERROR: He's dead, Jim

What ive also noticed, a little earlier in startup im seeing errors regarding ip/port:

src/common/processpipe_posix.cpp (279) : invalid name/address:port string provided to BSetIpPortFromName SteamClientService_24

Which also gets printed 16 times. SERVER_IP is its local one (i have it natted) and ports are both default

jsknnr commented 5 months ago

The posix error is unrelated. That is from steamcmd reaching out to download the server files, it's harmless.

You are getting the same error message, but for different reasons. The OP's issue was I had a bug in my while loop that he hit. Your issue is because the server is having issues talking to steam:

[E 00:00:01,784] [steam] Failed to initialize Steamworks system...Generic Error
[E 00:00:01,785] [steam] Message from Steam: InitGameServer failed
[E 00:00:01,785] [app] Failed to create Steamworks.

The reason why is not clear. It could simply be intermittent issue communicating with steam. I would try it again and see if it still happens. If not, I need to see more of the log and know more about your setup.

kyz3 commented 5 months ago

Youre right, sorry i was too focused on the jim-part. I have recreated the container, with the same error. Proton log: http://sprunge.us/LOIH7J win/205 log: http://sprunge.us/NPx5KK

Im running docker 25.0.1 on centos9 (proxmox vm), 16xE5-2650 v2 and 32GB RAM. Thanks in advance and sorry for crashing into this issue here..

mooseh commented 5 months ago

are the version cross compatible? will i lose my gamesaves? (yes they are a mounted volume)

jsknnr commented 5 months ago

@mooseh yes. The volume only contains the save. It is safe to go between versions.

@kyz3 No worries. What is happening is the server executable is not staying running, when the pid closes it gives the Jim message. I would double check all your configuration with the proton version. If the 2.0.5 version is working for you the proton image should be working as well. My best guess right now is you've missed something.

kyz3 commented 5 months ago

Im actually only changing the image-tag in my docker-compose.yml from proton-latest to v2.0.5 and back, so i dont think its any configuration unfortunately. I even removed (compose down) the container, if anything should stay after switching the tag. So not only the volume containing the map/save is identical, the configuration also is.

This is my compose:

services: enshrouded: image: sknnr/enshrouded-dedicated-server:proton-latest ports:

  • "15636:15636/udp"
  • "15637:15637/udp" environment:
  • SERVER_NAME=nameofserver
  • SERVER_PASSWORD=passwordofserver
  • GAME_PORT=15636
  • QUERY_PORT=15637
  • SERVER_SLOTS=8
  • SERVER_IP=192.168.169.30 volumes:
  • enshrouded-persistent-data:/home/steam/enshrouded/savegame

volumes: enshrouded-persistent-data: external: true

jsknnr commented 5 months ago

Interesting. Well that should work then. Just for fun can you set the server IP to 0.0.0.0 and give it a whirl?

kyz3 commented 5 months ago

Wow it actually works with 0.0.0.0, log: http://sprunge.us/ataLn8 I was initially playing around with this setting, because i was not getting my server listed when using 0.0.0.0 I need to ask some buddies if they can see it now and if that works, great :D

EDIT: Just had someone look, and unfortunately the server is not now showing up in the serverlist. Changing SERVER_IP back to its local one kills the server again :(

mooseh commented 5 months ago

Wow it actually works with 0.0.0.0, log: http://sprunge.us/ataLn8 I was initially playing around with this setting, because i was not getting my server listed when using 0.0.0.0 I need to ask some buddies if they can see it now and if that works, great :D

EDIT: Just had someone look, and unfortunately the server is not now showing up in the serverlist. Changing SERVER_IP back to its local one kills the server again :(

this will likely be due to docker natting

kyz3 commented 5 months ago

Just played around a bit: Im now running the proton without ports, network_mode=host. Weirdly its not binding 15636, only 15637. When adding ip:15637 in steam serverbrowser to favorites, i can see it online, with latency and playercount. But its not getting found when searching, or ingame.

jsknnr commented 5 months ago

So server IP is a silly setting if you ask me... it just helps the server figure out which interfaces to bind to. 0.0.0.0 tells it to listen on all interfaces and for a container, this is just fine because we typically only have a single interface. I originally made it non configurable with this image because it doesn't do what most people think it does and is really only useful if where the server is running has more than 1 interface and or interfaces you do not want it listening on. Unless 192.168.169.30 is actually an IP address that is on one of the interfaces INSIDE of your container this will cause your error and crash the server... because it can't find that interface. This is also why I made the setting not required and unless configured by the user it goes ahead and just uses 0,0.0.0 by default. My guess is you've still got some network settings between your router and docker that aren't playing nice. Make sure you are forwarding both 15636 and 15637 from you router to the IP address of your docker host if you're doing host networking.

edit: My server that my group plays on has that setting set to 0.0.0.0 and that server runs in my kubernetes cluster. Also testing from docker and podman with setting 0,0,0,0 on a different host also works just fine.

aeperez94 commented 5 months ago

im having troubles trying out the proton version, how should i upgrade my container from 2.0.0.2 to the proton version? sorry if its a newbie question but i tried pulling the proton one but it seems to be missing some files i have in the 2.0.0.2 version. The server works allright but when i try playing with 4+ players it starts to lag like hell.

jsknnr commented 5 months ago

With the container stopped, you need to modify the image tag with how you are starting the container to be proton-latest so it would be something like sknnr/enshrouded-dedicated-server:proton-latest and then you need to make sure your volume has the correct permissions. If you are bind mounting a created directory you need to chown -R 10000:10000 /your/directory/name . If you had docker create the volume for you, the backing directory should exist in /var/lib/docker/volumes. Here is quick 1 liner to just go ahead and change the permission for the docker volume as long as it contains the word enshrouded in its name: chown -R 10000:10000 /var/lib/docker/volumes/$(docker volume ls | grep enshrouded | awk '{print $2}')

mooseh commented 5 months ago

so i still have had no luck with the proton image at all. i work with docker for work so i am well versed with it. so here is the stacktrace:

"@sSteamCmdForcePlatformType" = "windows"

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x5) verifying install, progress: 4.04 (520460367 / 12880418591)
 Update state (0x5) verifying install, progress: 9.48 (1220893181 / 12880418591)
 Update state (0x5) verifying install, progress: 14.81 (1907926412 / 12880418591)
 Update state (0x5) verifying install, progress: 20.32 (2617245503 / 12880418591)
 Update state (0x5) verifying install, progress: 25.79 (3321537790 / 12880418591)
 Update state (0x5) verifying install, progress: 31.20 (4018737323 / 12880418591)
 Update state (0x5) verifying install, progress: 36.62 (4716280092 / 12880418591)
 Update state (0x5) verifying install, progress: 42.08 (5419659245 / 12880418591)
 Update state (0x5) verifying install, progress: 47.63 (6135530965 / 12880418591)
 Update state (0x5) verifying install, progress: 53.04 (6831150119 / 12880418591)
 Update state (0x5) verifying install, progress: 58.45 (7528849618 / 12880418591)
 Update state (0x5) verifying install, progress: 64.00 (8243860872 / 12880418591)
 Update state (0x5) verifying install, progress: 69.48 (8949198436 / 12880418591)
 Update state (0x5) verifying install, progress: 74.98 (9657492130 / 12880418591)
 Update state (0x5) verifying install, progress: 80.53 (10373232897 / 12880418591)
 Update state (0x5) verifying install, progress: 86.05 (11084202915 / 12880418591)
 Update state (0x5) verifying install, progress: 91.54 (11790490574 / 12880418591)
 Update state (0x5) verifying install, progress: 96.99 (12493002805 / 12880418591)
Success! App '2278520' fully installed.
2024-02-07 11:01:14,573 INFO: Updating Enshrouded Server configuration
2024-02-07 11:01:14,835 INFO: Starting Enshrouded Dedicated Server
wine: lstat /tmp/.wine-10000/server-10001c-a6018/socket : No such device or address
2024-02-07 11:01:20,860 INFO: Waiting for enshrouded_server.exe to be running
2024-02-07 11:01:26,879 INFO: Waiting for enshrouded_server.exe to be running
tail: invalid PID: ''
2024-02-07 11:01:26,887 ERROR: He's dead, Jim

here is my docker-compose file

    enshrouded:
      hostname: enshrouded
      container_name: enshrouded
      image: sknnr/enshrouded-dedicated-server:proton-latest
      stop_grace_period: 90s
      ports:
        - "15636:15636" #tcp
        - "15637:15637" #tcp
        - "15636:15636/udp"
        - "15637:15637/udp"
      environment:
        SERVER_NAME: Mooooo Enshrouded
        SERVER_PASSWORD: nicetrywiseguy!
        GAME_PORT: 15636
        QUERY_PORT: 15637
        SERVER_SLOTS: 16
        SERVER_IP: 0.0.0.0
      volumes:
        - /home/fragpanel/servers/enshrouded/savegame:/home/steam/enshrouded/savegame
      restart: unless-stopped

here is my enshrouded savegame folder

fragpanel@panel3:/etc/docker$ ls -lah /home/fragpanel/servers/enshrouded/savegame
total 232K
drwxr-xr-x 2 10000 10000 4.0K Feb  7 11:05 .
drwxr-xr-x 4 10000 10000 4.0K Jan 28 21:17 ..
-rw-r--r-- 1 10000 10000 110K Feb  7 10:44 3ad85aea
-rw-r--r-- 1 10000 10000 110K Feb  7 10:44 3ad85aea.backup
jsknnr commented 5 months ago

This is a new one. Wine is failing to create a socket for the wineserver. Would you mind trying to build the image locally? Modify the entrypoint.sh for the proton image and replace the last line exit 1 with a sleep, for like 600 or so and then build the image. This should allow you to exec into the container once it gets to that point and do some debugging. Check the tmp directory for that folder that the socket is trying to get created in. Also check to see if you can write anything at all into that directory.