Skip to content

fix(core): follow-up failure handling for extraction, updates and logs - #5113

Merged
dgibbs64 merged 5 commits into
developfrom
fix/extract-failure-followups
Oct 30, 2026
Merged

dgibbs64 merged 5 commits into
developfrom
fix/extract-failure-followups

Conversation

@dgibbs64

Copy link
Copy Markdown
Member

Description

Follow-up fixes found while reviewing and testing #5109. They are independent of it and merge cleanly with it in either order.

  • exitbypass gap in SteamCMD install: when exitbypass is set, core_exit.sh returns instead of exiting, so a failed extraction fell through and fn_install_steamcmd ran chmod on a steamcmd.sh that was never extracted. This is reachable when an update restarts the server and check_steamcmd.sh installs SteamCMD. fn_dl_extract now returns 1 after a bypassed failure and fn_install_steamcmd stops on it.
  • Update downloads were never forced: ten update modules passed "force" to fn_fetch_file, which only recognises "forcedl", so an archive already in tmpdir was reused. With fix(core): propagate archive extraction and copy failures #5109 a failed extraction leaves the archive in tmpdir, and for fixed file names such as multitheftauto_linux_x64.tar.gz the next update would extract the stale file again.
  • Log directory failures exited 0: install_logs.sh called core_exit.sh without setting exitcode, so it printed FAIL and then exited with code 0. Each failure now logs a FAIL line, which sets the exit code to 1.
  • ./mtaserver install-default-resources always errored: the module never called core_exit.sh, so it ended with "Command did not exit correctly" and exit code 2 even on success. It now exits when it is the first command, and the install flow that also calls it carries on as before.

Related to #5048

Affected servers: all (SteamCMD install, log directories); bb, etl, fctr, jk2, mta, pmc, ts3, ut99, vints, xnt (updates); mta (default resources)

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Chore (CI, workflows, tooling or other maintenance).
  • Comment update (typo, spelling, explanation, examples, etc).

Testing

case before after
bypassed SteamCMD extraction failure chmod: cannot access .../steamcmd.sh returns 1, no chmod
hlwon auto-install, read-only serverfiles FAIL printed, exit code 0 FAIL: Creating game log directory ..., exit code 1
mta install-default-resources (yes / no) "Command did not exit correctly", exit code 2 exit code 0, 2343 resources installed
mta auto-install Install Complete Install Complete
mta force-update with stale archive in tmp stale file extracted archive downloaded again, extract OK, exit code 0

Both merge orders with #5109 are clean. shfmt is clean, module modes unchanged, and shellcheck reports nothing new beyond the usual cross-module SC2154/SC2034.

  • Environment used (distro/version): Ubuntu 26.04 container

Risk and rollback

  • Risk level: low. Successful paths behave the same; only failure paths exit differently, and update archives are always downloaded again, as the modules already intended.
  • Rollback plan: revert the commit.

Breaking changes

  • No breaking changes.
  • Breaking changes included (describe below).

Documentation

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue ("Fixes", or "Related to" for a partial fix).
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have provided a detailed enough description of this PR.

Ten update modules passed "force" to fn_fetch_file, which only
recognises "forcedl", so an archive already in tmpdir was reused. A
failed extraction leaves the archive in tmpdir, and for fixed file
names such as multitheftauto_linux_x64.tar.gz the next update would
extract the stale file again.
install_logs.sh called core_exit.sh without setting exitcode, so a
failure to create a log directory, log file or symlink printed FAIL
but exited with code 0. Log each failure with fn_script_log_fail,
which sets exitcode to 1.
The module never called core_exit.sh, so running
./mtaserver install-default-resources always ended with "Command did
not exit correctly" and exit code 2, even on success. Exit only when it
is the first command, so the install flow that calls it carries on.
When exitbypass is set, core_exit.sh returns instead of exiting, so a
failed extraction fell through to the caller. fn_install_steamcmd then
ran chmod on a steamcmd.sh that was never extracted. This is reachable
when an update restarts the server and check_steamcmd.sh installs
SteamCMD.

fn_dl_extract now returns 1 after a bypassed failure, and
fn_install_steamcmd stops on it.
@github-actions github-actions Bot added the type: bugfix Pull request that fixes a bug label Oct 30, 2026
@dgibbs64 dgibbs64 added this to the v26.5.0 milestone Oct 30, 2026
@github-actions github-actions Bot added engine: renderware Issues related to renderware engine engine: vintagestory Issues related to vintagestory engine engine: factorio Issues related to factorio engine engine: unreal Issues related to unreal engine engine: idtech3 Issues related to idtech3 engine engine: lwjgl2 Issues related to lwjgl2 engine engine: null Issues related to null engine engine: unreal3 Issues related to unreal3 engine game: Multi Theft Auto Issues related to Multi Theft Auto game: Vintage Story Issues related to Vintage Story game: Factorio Issues related to Factorio game: Unreal Tournament 99 Issues related to Unreal Tournament 99 game: ET: Legacy Issues related to ET: Legacy game: Jedi Knight II: Jedi Outcast Issues related to Jedi Knight II: Jedi Outcast game: PaperMC Issues related to PaperMC game: Teamspeak 3 Issues related to Teamspeak 3 game: Xonotic Issues related to Xonotic labels Oct 30, 2026
@dgibbs64
dgibbs64 merged commit ff15be6 into develop Oct 30, 2026
35 checks passed
@dgibbs64
dgibbs64 deleted the fix/extract-failure-followups branch October 30, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine: factorio Issues related to factorio engine engine: idtech3 Issues related to idtech3 engine engine: lwjgl2 Issues related to lwjgl2 engine engine: null Issues related to null engine engine: renderware Issues related to renderware engine engine: unreal Issues related to unreal engine engine: unreal3 Issues related to unreal3 engine engine: vintagestory Issues related to vintagestory engine game: ET: Legacy Issues related to ET: Legacy game: Factorio Issues related to Factorio game: Jedi Knight II: Jedi Outcast Issues related to Jedi Knight II: Jedi Outcast game: Multi Theft Auto Issues related to Multi Theft Auto game: PaperMC Issues related to PaperMC game: Teamspeak 3 Issues related to Teamspeak 3 game: Unreal Tournament 99 Issues related to Unreal Tournament 99 game: Vintage Story Issues related to Vintage Story game: Xonotic Issues related to Xonotic type: bugfix Pull request that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant