Page MenuHomeFeedback Tracker

[Linux Dedicated] Server will not load mod if mod root directory is read-only
Reviewed, NormalPublic

Description

Applies to both main branch v1.66 and legacyports v1.64.

While loading mod server checks if it has read-write access to mod directory.
If server fails to get read AND write access to mod directory, mod loading aborted: mod is marked as NOT FOUND in RPT log (console output); no mod files are read.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Linux x64
Operating System Version
Debian "jessie" 8.7; kernel 4.8.11-1~bpo8+1 (amd64)
Category
Dedicated Server
Steps To Reproduce
  1. Set up mod directory as read-only:
~$ cd Steam/steamapps/common/Arma\ 3\ Server
~/Steam/steamapps/common/Arma 3 Server$ chmod 555 mods/@CBA_A3

No need to use recursive chmod: mod's files and subdirectories can remain writeable. Server only checks access to mod's root directory itself.

  1. Run server with mods (strace part is for more logging; tee part is for logging console output into file):
~$ cd Steam/steamapps/common/Arma\ 3\ Server
~/Steam/steamapps/common/Arma 3 Server$ strace -ff -o /mnt/memdisk/arma3server ./arma3server -netlog -ip=192.168.153.1 -port=2302 -cfg=/home/steam/Steam/steamapps/common/Arma\ 3\ Server/cfg/arma3-server-modded.network.cfg -config=/home/steam/Steam/steamapps/common/Arma\ 3\ Server/cfg/arma3-server-modded.server.cfg -mod=mods/@CBA_A3 -servermod=mods/@CBA_A3 -bepath= -loadmissiontomemory 2>&1 | tee /mnt/memdisk/console.log
  1. Server fails to load mod showing it as not found in console output (rpt):
10:13:40 ============================================================================================= List of mods ===============================================================================================
10:13:40 modsReadOnly = true
10:13:40 safeModsActivated = false
10:13:40 customMods = true
10:13:40 hash = '9E6147A921E73C79788034EEBE98DAAADF5C2B89'
10:13:40 hashShort = '1f88dd0f'
10:13:40                                               name |               modDir |    default |               origin |                                     hash | hashShort | fullPath
10:13:40 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10:13:40                                            @CBA_A3 |              @CBA_A3 |      false |            NOT FOUND |                                          |           | 
10:13:40                                  Arma 3 DLC Bundle |            dlcbundle |       true |            NOT FOUND |                                          |           | 
10:13:40                                        Arma 3 Apex |            expansion |       true |             GAME DIR | 889deca7b67b3edca0b2da51a5318a40167757dd |  c794d30d | /home/steam/Steam/steamapps/common/Arma 3 Server/expansion
10:13:40                                    Arma 3 Marksmen |                 mark |       true |             GAME DIR | 7129193541b9133ea1bea45441e244eb180cbfe7 |  58644447 | /home/steam/Steam/steamapps/common/Arma 3 Server/mark
10:13:40                                 Arma 3 Helicopters |                 heli |       true |             GAME DIR | 037b8a52dea414a8999d947ae74a01089ef1178e |  6b140d2c | /home/steam/Steam/steamapps/common/Arma 3 Server/heli
10:13:40                                       Arma 3 Karts |                 kart |       true |             GAME DIR | 9b8fdc1c10171397e45e8a671074d3b570c758a9 |  a5c8c24c | /home/steam/Steam/steamapps/common/Arma 3 Server/kart
10:13:40                                        Arma 3 Zeus |              curator |       true |             GAME DIR | e3578d1509f22cc901180ed73925c9d766cdc84c |  e6c7fc7b | /home/steam/Steam/steamapps/common/Arma 3 Server/curator
10:13:40                                             Arma 3 |                   A3 |       true |            NOT FOUND |                                          |           | 
10:13:40 ==========================================================================================================================================================================================================

Notice "modsReadOnly = true" line. What does that mean?

Additional Information

Analyzing strace output: all I could grep out of strace logs on mod's name:

/mnt/memdisk$ egrep -nH CBA arma3server.*
arma3server.13327:1:execve("./arma3server", ["./arma3server", "-netlog", "-ip=192.168.153.1", "-port=2302", "-cfg=/home/steam/Steam/steamapps"..., "-config=/home/steam/Steam/steama"..., "-mod=mods/@CBA_A3", "-servermod=mods/@CBA_A3", "-bepath=", "-loadmissiontomemory"], [/* 26 vars */]) = 0
arma3server.13327:372:access("mods/@CBA_A3", R_OK|W_OK)       = -1 EACCES (Permission denied)
arma3server.13327:380:access("/home/steam/.local/share/Arma 3\\mods/@CBA_A3", R_OK|W_OK) = -1 ENOENT (No such file or directory)
arma3server.13327:381:access("mods/@CBA_A3", R_OK|W_OK)       = -1 EACCES (Permission denied)
arma3server.13327:67321:access("mods/@CBA_A3", R_OK|W_OK)       = -1 EACCES (Permission denied)
arma3server.13327:67329:access("/home/steam/.local/share/Arma 3\\mods/@CBA_A3", R_OK|W_OK) = -1 ENOENT (No such file or directory)
arma3server.13327:67330:access("mods/@CBA_A3", R_OK|W_OK)       = -1 EACCES (Permission denied)

No tries to read any of mod's files. Also notice how backslash is incorrectly used as path delimiter. I don't have directory named "Arma 3\mods". In linux (and more generally, most unix) filesystems backslash is a valid character for file or directory name. And in those weird directory locations mods are checked for read-write access too.
Even on clean runs with write-enabled mod directory I couldn't find any evidence server actually writes anything. And writing there doesn't make too much sense anyway. However, even not being critical, this issue can lead to very subtle and hard-to-catch problems with mods. Any more or less complex configuration can hit it: running multiple servers with multiple users (you will need to add all users to one group and set write permissions for group); having one user for running server and other to manage mods and other content; unpacking from archive where mod dirs can have read-only mode; etc.
Now every admin has to check if his mod dirs have write permissions, when in fact only reading is required. That's odd.

console log (rpt):


strace logs: arma3server.no_mod_load.tgz
configs: cfg.tgz

Event Timeline

Alwin claimed this task.Jan 24 2017, 9:42 AM
Alwin changed the task status from New to Reviewed.

@pedeathtrian Thanks for report, we´ll check your report and let you know. I´ll ask you about patience bucause it can tak a some time.

dedmen added a subscriber: dedmen.May 18 2020, 9:49 AM

"some time" :D
Server needs write access to be able to lock the file, or atleast because it wants to lock the file, whether it needs it I dunno.