ich777 / docker-steamcmd-server

Simple Dockerfile that installs steamcmd and a selected game server
119 stars 95 forks source link

ARK:Survival Ascended: Wait for server to spawn before starting watchdog #63

Closed Tetricz closed 4 months ago

Tetricz commented 4 months ago

I noticed while trying to transfer my server from a VM to this container that it would reliably fail to start the watchdog and then exit after a restart when the log already existed.

So this snippet just adds a while loop to check if the server has started. It exits after a hard-coded amount of time I felt was reasonable for the process to start.

ich777 commented 4 months ago

@Tetricz thanks for the PR but this seems like a over engineered solution... On what hardware do you run the container?

Can you describe what happens exactly on your system? Is the container restarting?

BTW, there shouldn't be a difference if the log exists or not since the container waits exactly the same time so I really don't understand why it's failing <- I hope you see why this is confusing me a bit why it's not working on your system.

Tetricz commented 4 months ago

The hardware is an Intel i9-13900 with 128gb of ram. I'm using your template for unRAID.

It's taking longer than 2 seconds for the process to spawn and if the log doesn't exist it goes into that while loop waiting for up to 20 seconds. If the log exists the tail process will end on my server causing the containers main process to terminate.

It's a little over engineered. Setting the sleep time to 10 seconds also works.

ich777 commented 4 months ago

That's strange on my i5-10600 I have no such issues...

Can you maybe try to change the default value from 2 seconds to maybe 4 seconds? 10 seconds seem a bit excessive... I would like to change only that value if possible.

Tetricz commented 4 months ago

4 seconds doesn't work. At 8 seconds it fails occasionally.

I'm more curious why it takes so long for the process to start. Do you have any ideas for why that happens? I did a little testing to make sure that it wasn't anything to do with the e-cores on my cpu. The time didn't change.

I have the max_map_count set using this in the go file, echo 265000 > /proc/sys/vm/max_map_count.

Tetricz commented 4 months ago

I decided to reproduce it again for the logs, but suddenly it works as expected with a fresh world and install.

These are the logs for my server, I have a feeling that my solution only, while solving my problem is really hiding another issue.

Logs

---Ensuring UID: 99 matches user---
---Ensuring GID: 100 matches user---
---Setting umask to 000---
---Checking for optional scripts---
---No optional script found, continuing---
---Taking ownership of data...---
---Starting...---
---Update SteamCMD---
tid(34) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/serverdata/Steam/logs/stderr.txt'
Logging directory: '/serverdata/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
---Update Server---
tid(59) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/serverdata/Steam/logs/stderr.txt'
Logging directory: '/serverdata/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK
"@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 (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x61) downloading, progress: 0.36 (42097624 / 11652185233)
 Update state (0x61) downloading, progress: 0.84 (97733282 / 11652185233)
 Update state (0x61) downloading, progress: 4.43 (516679540 / 11652185233)
 Update state (0x61) downloading, progress: 10.16 (1183459383 / 11652185233)
 Update state (0x61) downloading, progress: 14.46 (1685282424 / 11652185233)
 Update state (0x61) downloading, progress: 16.03 (1867514620 / 11652185233)
 Update state (0x61) downloading, progress: 18.92 (2204107516 / 11652185233)
 Update state (0x61) downloading, progress: 20.45 (2382603300 / 11652185233)
 Update state (0x61) downloading, progress: 21.37 (2490036088 / 11652185233)
 Update state (0x61) downloading, progress: 22.35 (2604645771 / 11652185233)
 Update state (0x61) downloading, progress: 23.25 (2709410083 / 11652185233)
 Update state (0x61) downloading, progress: 24.42 (2845614767 / 11652185233)
 Update state (0x61) downloading, progress: 25.50 (2971443887 / 11652185233)
 Update state (0x61) downloading, progress: 26.52 (3089872711 / 11652185233)
 Update state (0x61) downloading, progress: 27.59 (3214653255 / 11652185233)
 Update state (0x61) downloading, progress: 28.58 (3329996615 / 11652185233)
 Update state (0x61) downloading, progress: 29.70 (3461068615 / 11652185233)
 Update state (0x61) downloading, progress: 30.77 (3585849159 / 11652185233)
 Update state (0x61) downloading, progress: 31.72 (3695949639 / 11652185233)
 Update state (0x61) downloading, progress: 32.69 (3809195847 / 11652185233)
 Update state (0x61) downloading, progress: 33.79 (3936784099 / 11652185233)
 Update state (0x61) downloading, progress: 34.88 (4064074879 / 11652185233)
 Update state (0x61) downloading, progress: 35.78 (4168932479 / 11652185233)
 Update state (0x61) downloading, progress: 36.56 (4260158591 / 11652185233)
 Update state (0x61) downloading, progress: 37.32 (4348684219 / 11652185233)
 Update state (0x61) downloading, progress: 38.31 (4464027579 / 11652185233)
 Update state (0x61) downloading, progress: 39.37 (4587425907 / 11652185233)
 Update state (0x61) downloading, progress: 40.35 (4701888311 / 11652185233)
 Update state (0x61) downloading, progress: 41.37 (4820377399 / 11652185233)
 Update state (0x61) downloading, progress: 42.32 (4931526455 / 11652185233)
 Update state (0x61) downloading, progress: 43.30 (5045246223 / 11652185233)
 Update state (0x61) downloading, progress: 44.30 (5161638159 / 11652185233)
 Update state (0x61) downloading, progress: 45.29 (5277391131 / 11652185233)
 Update state (0x61) downloading, progress: 46.35 (5400271131 / 11652185233)
 Update state (0x61) downloading, progress: 47.36 (5518096667 / 11652185233)
 Update state (0x61) downloading, progress: 48.27 (5625032987 / 11652185233)
 Update state (0x61) downloading, progress: 49.22 (5735207675 / 11652185233)
 Update state (0x61) downloading, progress: 50.33 (5864170235 / 11652185233)
 Update state (0x61) downloading, progress: 51.45 (5995231995 / 11652185233)
 Update state (0x61) downloading, progress: 52.40 (6105811707 / 11652185233)
 Update state (0x61) downloading, progress: 53.45 (6227612411 / 11652185233)
 Update state (0x61) downloading, progress: 54.38 (6336711419 / 11652185233)
 Update state (0x61) downloading, progress: 55.34 (6448855803 / 11652185233)
 Update state (0x61) downloading, progress: 56.41 (6573414331 / 11652185233)
 Update state (0x61) downloading, progress: 57.37 (6684624315 / 11652185233)
 Update state (0x61) downloading, progress: 58.45 (6810796779 / 11652185233)
 Update state (0x61) downloading, progress: 59.39 (6919848683 / 11652185233)
 Update state (0x61) downloading, progress: 60.39 (7036238943 / 11652185233)
 Update state (0x61) downloading, progress: 61.12 (7121693279 / 11652185233)
 Update state (0x61) downloading, progress: 62.15 (7242279519 / 11652185233)
 Update state (0x61) downloading, progress: 63.18 (7361817183 / 11652185233)
 Update state (0x61) downloading, progress: 64.19 (7479201619 / 11652185233)
 Update state (0x61) downloading, progress: 65.22 (7599787859 / 11652185233)
 Update state (0x61) downloading, progress: 66.23 (7717228371 / 11652185233)
 Update state (0x61) downloading, progress: 67.20 (7830181715 / 11652185233)
 Update state (0x61) downloading, progress: 68.10 (7935265267 / 11652185233)
 Update state (0x61) downloading, progress: 69.07 (8048302579 / 11652185233)
 Update state (0x61) downloading, progress: 70.12 (8170988019 / 11652185233)
 Update state (0x61) downloading, progress: 71.19 (8295368327 / 11652185233)
 Update state (0x61) downloading, progress: 72.33 (8428531319 / 11652185233)
 Update state (0x61) downloading, progress: 73.36 (8548413663 / 11652185233)
 Update state (0x61) downloading, progress: 74.38 (8666751839 / 11652185233)
 Update state (0x61) downloading, progress: 75.40 (8785406799 / 11652185233)
 Update state (0x61) downloading, progress: 76.42 (8904772431 / 11652185233)
 Update state (0x61) downloading, progress: 77.45 (9024928607 / 11652185233)
 Update state (0x61) downloading, progress: 78.44 (9139612340 / 11652185233)
 Update state (0x61) downloading, progress: 79.49 (9261867700 / 11652185233)
 Update state (0x61) downloading, progress: 80.60 (9391507236 / 11652185233)
 Update state (0x61) downloading, progress: 81.65 (9514157860 / 11652185233)
 Update state (0x61) downloading, progress: 82.93 (9662861092 / 11652185233)
 Update state (0x61) downloading, progress: 84.08 (9797151524 / 11652185233)
 Update state (0x61) downloading, progress: 85.30 (9939104548 / 11652185233)
 Update state (0x61) downloading, progress: 86.36 (10062654244 / 11652185233)
 Update state (0x61) downloading, progress: 87.25 (10166581412 / 11652185233)
 Update state (0x61) downloading, progress: 88.18 (10274838315 / 11652185233)
 Update state (0x61) downloading, progress: 89.03 (10374397739 / 11652185233)
 Update state (0x61) downloading, progress: 89.85 (10469818123 / 11652185233)
 Update state (0x61) downloading, progress: 90.69 (10567274731 / 11652185233)
 Update state (0x61) downloading, progress: 91.55 (10667965755 / 11652185233)
 Update state (0x61) downloading, progress: 92.45 (10772344089 / 11652185233)
 Update state (0x61) downloading, progress: 93.38 (10880347313 / 11652185233)
 Update state (0x61) downloading, progress: 94.19 (10974846193 / 11652185233)
 Update state (0x61) downloading, progress: 94.97 (11066035441 / 11652185233)
 Update state (0x61) downloading, progress: 95.79 (11161550065 / 11652185233)
 Update state (0x61) downloading, progress: 96.55 (11250390225 / 11652185233)
 Update state (0x61) downloading, progress: 97.28 (11334884593 / 11652185233)
 Update state (0x61) downloading, progress: 98.10 (11430214897 / 11652185233)
 Update state (0x61) downloading, progress: 98.91 (11525713041 / 11652185233)
 Update state (0x61) downloading, progress: 99.76 (11623875729 / 11652185233)
 Update state (0x81) verifying update, progress: 0.33 (38163208 / 11652185233)
 Update state (0x81) verifying update, progress: 0.96 (112352604 / 11652185233)
 Update state (0x81) verifying update, progress: 1.89 (220355932 / 11652185233)
 Update state (0x81) verifying update, progress: 2.29 (266493276 / 11652185233)
 Update state (0x81) verifying update, progress: 2.68 (312630620 / 11652185233)
 Update state (0x81) verifying update, progress: 3.13 (365059420 / 11652185233)
 Update state (0x81) verifying update, progress: 3.47 (404698636 / 11652185233)
 Update state (0x81) verifying update, progress: 3.92 (457127436 / 11652185233)
 Update state (0x81) verifying update, progress: 4.36 (508453996 / 11652185233)
 Update state (0x81) verifying update, progress: 4.71 (548299884 / 11652185233)
 Update state (0x81) verifying update, progress: 5.10 (594437228 / 11652185233)
 Update state (0x81) verifying update, progress: 9.12 (1062471069 / 11652185233)
 Update state (0x81) verifying update, progress: 9.83 (1145524338 / 11652185233)
 Update state (0x81) verifying update, progress: 10.53 (1227313266 / 11652185233)
 Update state (0x81) verifying update, progress: 11.25 (1310610121 / 11652185233)
 Update state (0x81) verifying update, progress: 11.61 (1352553161 / 11652185233)
 Update state (0x81) verifying update, progress: 12.04 (1402884809 / 11652185233)
 Update state (0x81) verifying update, progress: 12.47 (1453216457 / 11652185233)
 Update state (0x81) verifying update, progress: 12.88 (1500232746 / 11652185233)
 Update state (0x81) verifying update, progress: 13.26 (1545321514 / 11652185233)
 Update state (0x81) verifying update, progress: 25.51 (2972536261 / 11652185233)
 Update state (0x81) verifying update, progress: 39.33 (4583335719 / 11652185233)
 Update state (0x81) verifying update, progress: 51.28 (5975344583 / 11652185233)
 Update state (0x81) verifying update, progress: 61.72 (7192177287 / 11652185233)
 Update state (0x81) verifying update, progress: 75.36 (8781563587 / 11652185233)
 Update state (0x81) verifying update, progress: 89.45 (10423216745 / 11652185233)
Success! App '2430930' fully installed.
---Checking the maximum map count per process...---
---Maximum map count per process OK...---
---Current map count per process: 265000---
---Checking if WINE workdirectory is present---
---WINE workdirectory not found, creating please wait...---
---Checking if WINE is properly installed---
---Setting up WINE---
---Prepare Server---
---Server ready---
---Start Server---
Waiting for logs...
Waiting for logs...
Waiting for logs...
Waiting for logs...
Waiting for logs...
Waiting for logs...
Waiting for logs...
Waiting for logs...
Waiting for logs...
Waiting for logs...
[2024.04.13-23.51.41:668][  0]Log file open, 04/13/24 18:51:41
[2024.04.13-23.51.41:668][  0]LogMemory: Platform Memory Stats for WindowsServer
[2024.04.13-23.51.41:668][  0]LogMemory: Process Physical Memory: 484.96 MB used, 490.06 MB peak
[2024.04.13-23.51.41:668][  0]LogMemory: Process Virtual Memory: 473.85 MB used, 473.85 MB peak
[2024.04.13-23.51.41:668][  0]LogMemory: Physical Memory: 48846.10 MB used,  79744.02 MB free, 128590.11 MB total
[2024.04.13-23.51.41:668][  0]LogMemory: Virtual Memory: 48846.11 MB used,  79744.02 MB free, 128590.12 MB total
[2024.04.13-23.51.42:762][  0]ARK Version: 39.23
[2024.04.13-23.51.42:883][  0]LogCFCore: SetSettings called:
{
    "defaultLanguage": "en",
    "gameId": 83374,
    "apiKey": "*****1aZe",
    "maxConcurrentInstallations": 3,
    "modsDirectory": "ShooterGame/Mods",
    "modsDirectoryMode": "CFCore",
    "userDataDirectory": "ShooterGame/ModsUserData",
    "isServer": true,
    "isServerPcOnly": false,
    "throttling":
    {
        "diskWriteBytesPerSec": 0
    },
    "premiumMods":
    {
        "publicKeyPem": "*****"
    },
    "logger":
    {
        "enabled": true,
        "history": 8,
        "maxSizeInMB": 2
    }
}
[2024.04.13-23.51.42:884][  0]LogCFCore: Warning: Couldn't load mods library from disk
[2024.04.13-23.51.42:884][  0]LogCFCore: User context not loaded from disk
[2024.04.13-23.51.43:141][  0]Primal Game Data Took 0.26 seconds
[2024.04.13-23.52.06:834][  0]Server: "NA-PVP-Smalltribes-4p-2xT-No Offline Raid" has successfully started!
[2024.04.13-23.52.07:071][  0]Commandline:  "ScorchedEarth_WP?listen?SessionName=ServerName?ServerPassword=?Port=7777?ServerAdminPassword=" -server -log -NoBattlEye -crossplay
[2024.04.13-23.52.07:071][  0]Full Startup: 28.15 seconds
[2024.04.13-23.52.07:071][  0]Number of cores 24
[2024.04.13-23.52.07:137][  0]No spawn additional explorer notes to spawn
Session terminated, killing shell...
---Ensuring UID: 99 matches user---
usermod: no changes
---Ensuring GID: 100 matches user---
usermod: no changes
---Setting umask to 000---
---Checking for optional scripts---
---No optional script found, continuing---
---Taking ownership of data...---
---Starting...---
---Update SteamCMD---
tid(22) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/serverdata/Steam/logs/stderr.txt'
Logging directory: '/serverdata/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
---Update Server---
tid(45) burning pthread_key_t == 0 so we never use it
Redirecting stderr to '/serverdata/Steam/logs/stderr.txt'
Logging directory: '/serverdata/Steam/logs'
minidumps folder is set to /tmp/dumps
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1709846822
-- type 'quit' to exit --
Loading Steam API...OK
"@sSteamCmdForcePlatformType" = "windows"

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
Success! App '2430930' already up to date.
---Checking the maximum map count per process...---
---Maximum map count per process OK...---
---Current map count per process: 265000---
---Checking if WINE workdirectory is present---
---WINE workdirectory found---
---Checking if WINE is properly installed---
---WINE properly set up---
---Prepare Server---
---Server ready---
---Start Server---
Waiting for logs...
[2024.04.13-23.51.41:668][  0]Log file open, 04/13/24 18:51:41
[2024.04.13-23.51.41:668][  0]LogMemory: Platform Memory Stats for WindowsServer
[2024.04.13-23.51.41:668][  0]LogMemory: Process Physical Memory: 484.96 MB used, 490.06 MB peak
[2024.04.13-23.51.41:668][  0]LogMemory: Process Virtual Memory: 473.85 MB used, 473.85 MB peak
[2024.04.13-23.51.41:668][  0]LogMemory: Physical Memory: 48846.10 MB used,  79744.02 MB free, 128590.11 MB total
[2024.04.13-23.51.41:668][  0]LogMemory: Virtual Memory: 48846.11 MB used,  79744.02 MB free, 128590.12 MB total
[2024.04.13-23.51.42:762][  0]ARK Version: 39.23
[2024.04.13-23.51.42:883][  0]LogCFCore: SetSettings called:
{
    "defaultLanguage": "en",
    "gameId": 83374,
    "apiKey": "*****1aZe",
    "maxConcurrentInstallations": 3,
    "modsDirectory": "ShooterGame/Mods",
    "modsDirectoryMode": "CFCore",
    "userDataDirectory": "ShooterGame/ModsUserData",
    "isServer": true,
    "isServerPcOnly": false,
    "throttling":
    {
        "diskWriteBytesPerSec": 0
    },
    "premiumMods":
    {
        "publicKeyPem": "*****"
    },
    "logger":
    {
        "enabled": true,
        "history": 8,
        "maxSizeInMB": 2
    }
}
[2024.04.13-23.51.42:884][  0]LogCFCore: Warning: Couldn't load mods library from disk
[2024.04.13-23.51.42:884][  0]LogCFCore: User context not loaded from disk
[2024.04.13-23.51.43:141][  0]Primal Game Data Took 0.26 seconds
[2024.04.13-23.52.06:834][  0]Server: "NA-PVP-Smalltribes-4p-2xT-No Offline Raid" has successfully started!
[2024.04.13-23.52.07:071][  0]Commandline:  "ScorchedEarth_WP?listen?SessionName=ServerName?ServerPassword=?Port=7777?ServerAdminPassword=" -server -log -NoBattlEye -crossplay
[2024.04.13-23.52.07:071][  0]Full Startup: 28.15 seconds
[2024.04.13-23.52.07:071][  0]Number of cores 24
[2024.04.13-23.52.07:137][  0]No spawn additional explorer notes to spawn
tail: invalid PID: ‘’
Terminated
Tetricz commented 4 months ago

Okay, I've found more weirdness, but I think I narrowed it down more.

It seems to be an issue with how long it takes to load. I'm storing it on a zfs pool and the problem is no longer reproducible if the primary cache is set to All instead of metadata.

Let me know your thoughts on this.

ich777 commented 4 months ago

@Tetricz this is interesting, I only tested it on BTRFS so far but I can test it on ZFS too.

What ZFS pool do you have exactly? I can test it over here on ZFS too but I even think I did that at some point back when I created the container on my ZFS Mirror.

However it is really strange that it takes that long for the process to start since it should start immediately.

Tetricz commented 4 months ago

Definitely weird. My ZFS pool is a 4 1tb array of micron ssds. Perhaps compression might be the reason, however I've never had any issues with it for other game servers.

ZFS Properties

NAME                       PROPERTY              VALUE                           SOURCE
cache/game-servers/ark-sa  type                  filesystem                      -
cache/game-servers/ark-sa  creation              Sat Apr 13 18:11 2024           -
cache/game-servers/ark-sa  used                  11.2G                           -
cache/game-servers/ark-sa  available             1.89T                           -
cache/game-servers/ark-sa  referenced            11.1G                           -
cache/game-servers/ark-sa  compressratio         1.39x                           -
cache/game-servers/ark-sa  mounted               yes                             -
cache/game-servers/ark-sa  quota                 none                            default
cache/game-servers/ark-sa  reservation           none                            default
cache/game-servers/ark-sa  recordsize            128K                            default
cache/game-servers/ark-sa  mountpoint            /mnt/cache/game-servers/ark-sa  inherited from cache
cache/game-servers/ark-sa  sharenfs              off                             default
cache/game-servers/ark-sa  checksum              on                              default
cache/game-servers/ark-sa  compression           on                              inherited from cache
cache/game-servers/ark-sa  atime                 off                             inherited from cache
cache/game-servers/ark-sa  devices               on                              default
cache/game-servers/ark-sa  exec                  on                              default
cache/game-servers/ark-sa  setuid                on                              default
cache/game-servers/ark-sa  readonly              off                             inherited from cache/game-servers
cache/game-servers/ark-sa  zoned                 off                             default
cache/game-servers/ark-sa  snapdir               hidden                          default
cache/game-servers/ark-sa  aclmode               discard                         default
cache/game-servers/ark-sa  aclinherit            restricted                      default
cache/game-servers/ark-sa  createtxg             29235598                        -
cache/game-servers/ark-sa  canmount              on                              default
cache/game-servers/ark-sa  xattr                 sa                              inherited from cache
cache/game-servers/ark-sa  copies                1                               default
cache/game-servers/ark-sa  version               5                               -
cache/game-servers/ark-sa  utf8only              on                              -
cache/game-servers/ark-sa  normalization         formD                           -
cache/game-servers/ark-sa  casesensitivity       sensitive                       -
cache/game-servers/ark-sa  vscan                 off                             default
cache/game-servers/ark-sa  nbmand                off                             default
cache/game-servers/ark-sa  sharesmb              off                             default
cache/game-servers/ark-sa  refquota              none                            default
cache/game-servers/ark-sa  refreservation        none                            default
cache/game-servers/ark-sa  guid                  2129172342132322179             -
cache/game-servers/ark-sa  primarycache          all                             local
cache/game-servers/ark-sa  secondarycache        all                             default
cache/game-servers/ark-sa  usedbysnapshots       54.1M                           -
cache/game-servers/ark-sa  usedbydataset         11.1G                           -
cache/game-servers/ark-sa  usedbychildren        0B                              -
cache/game-servers/ark-sa  usedbyrefreservation  0B                              -
cache/game-servers/ark-sa  logbias               latency                         default
cache/game-servers/ark-sa  objsetid              3000                            -
cache/game-servers/ark-sa  dedup                 off                             default
cache/game-servers/ark-sa  mlslabel              none                            default
cache/game-servers/ark-sa  sync                  standard                        inherited from cache/game-servers
cache/game-servers/ark-sa  dnodesize             auto                            inherited from cache
cache/game-servers/ark-sa  refcompressratio      1.37x                           -
cache/game-servers/ark-sa  written               8.91M                           -
cache/game-servers/ark-sa  logicalused           15.5G                           -
cache/game-servers/ark-sa  logicalreferenced     15.3G                           -
cache/game-servers/ark-sa  volmode               default                         default
cache/game-servers/ark-sa  filesystem_limit      none                            default
cache/game-servers/ark-sa  snapshot_limit        none                            default
cache/game-servers/ark-sa  filesystem_count      none                            default
cache/game-servers/ark-sa  snapshot_count        none                            default
cache/game-servers/ark-sa  snapdev               hidden                          default
cache/game-servers/ark-sa  acltype               posix                           inherited from cache
cache/game-servers/ark-sa  context               none                            default
cache/game-servers/ark-sa  fscontext             none                            default
cache/game-servers/ark-sa  defcontext            none                            default
cache/game-servers/ark-sa  rootcontext           none                            default
cache/game-servers/ark-sa  relatime              off                             default
cache/game-servers/ark-sa  redundant_metadata    all                             default
cache/game-servers/ark-sa  overlay               on                              default
cache/game-servers/ark-sa  encryption            off                             default
cache/game-servers/ark-sa  keylocation           none                            default
cache/game-servers/ark-sa  keyformat             none                            default
cache/game-servers/ark-sa  pbkdf2iters           0                               default
cache/game-servers/ark-sa  special_small_blocks  0                               default
ich777 commented 4 months ago

This is a really strange problem, I will try to reproduce that on my system in the next few days, please give me a bit.

Definitely strange issue...

ich777 commented 4 months ago

@Tetricz sorry, it took a bit longer than expected but I still can't reproduce this on my test server, which is way under powered for that dedicated server anyways (Ryzen 3200G). I tried it on BTRFS, ZFS (with compression on and off), ZFS Mirror (with compression on and off) and also with XFS.

All work fine.

First startup is working as it should, restart is working fine, start after a container rebuild is fine <- everything tested with and without logs existing before the container starts.

I'm fine with increasing the sleep timer to 10 seconds but it is really strange that the process on your system took so long to spawn because it should there be immediately anyways.

Tetricz commented 4 months ago

Honestly, I'm not sure. I've been running the container without issue for the past week, but it still happens if I turn caching off from All -> Metadata.

Waiting 10 seconds seems overkill, but so does my solution. If you're happy with things as they are, we can close out this pull request and I'll keep zfs caching enabled for my ark server. (Also create an issue to keep track in case it happens for anyone else)

ich777 commented 4 months ago

Maybe a dumb question but isn't ZFS without caching painfully slow and causes unnecessary disk I/O?

It's enabled by default correct and it shouldn't have any major downsides IIRC. I'm really not a huge fan changing it to 10 seconds or implement your workaround because, in no offense, it's a bit over engineered and is not necessary for most users.

If you agree on leaving is as is that would be my favorite solution or I could change the sleep to 4 to 6 seconds.