[Bug]: install passes a leftover forcedl value instead of each server's force setting

Open
#5,189 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #5190 by @borzaka — merged

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
bash, shell
Domain
cli

Research direction

Read lgsm/modules/install_server_files.sh around line 233 and check the force= assignments in its server branches. The issue identifies the mismatch: the fn_fetch_file call passes ${forcedl} instead of ${force}. Confirm the expected argument with the reported samp reproduction; done means the call passes the branch’s noforce setting.

Written by the indexing model from the issue text.

Description

command: install info: steamcmd reproducible: unable severity: low status: fixed in develop type: bug
Severity

severity: low

Reproducibility

reproducible: unable

Regression

regression: no

Affects latest release

latest-release: yes

User story

As a LinuxGSM maintainer, I want fn_install_server_files to pass the download setting each server defines, so that install does not depend on a value left over from an earlier download.

Script name

all servers installed by fn_install_server_files

Game

Other

Linux distro

Other

Command

command: install

Expected behavior

fn_fetch_file gets the force="noforce" value that each of the 27 server branches in fn_install_server_files sets.

Actual behavior

The call in lgsm/modules/install_server_files.sh line 233 passes ${forcedl}, which no branch sets, so it gets whatever the last fn_fetch_file call left in the global forcedl. Today that is always noforce: the module is loaded by fn_fetch_module just before, and the downloads in between (EULA, SteamCMD) also pass noforce. There is no visible effect today.

Further information

85290d6b ("corrected download settings", 2017-05-14) changed the argument in the call from ${force} to ${forcedl} but did not rename the force= assignments, and it has stayed that way since (the file later moved from lgsm/functions to lgsm/modules). The bug is latent: if a download that passes "forcedl" (for example install_config.sh or an update module) ever ran just before this function, install would download the archive again despite force="noforce". The fix is to pass ${force} in the call; force is not used anywhere else in lgsm/.

Pre-checks
  • I ran update and validate before reporting this issue.

Not applicable: found by code review of develop, not on a live server.

Relevant log output
# fn_install_server_files with shortname=samp and forcedl="forcedl" left from an earlier call,
# fn_fetch_file stubbed to print its 9th argument
develop (b3d24bec): fn_fetch_file arg9 (forcedl) = forcedl
Steps to reproduce
  1. Source fn_install_server_files from lgsm/modules/install_server_files.sh with fn_fetch_file, fn_dl_extract and fn_clear_tmp stubbed.
  2. Set shortname=samp and forcedl="forcedl", then call fn_install_server_files.
  3. fn_fetch_file receives forcedl instead of the branch's noforce.

🤖 Generated with Claude Code

Dominant language
Shell
Stars
4.9k
Forks
870
Avg merge
18h 44m
Merged PRs (30d)
148

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GameServerManagers/LinuxGSM

All issues in GameServerManagers/LinuxGSM

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.