Repository navigation
fix(core): follow-up failure handling for extraction, updates and logs - #5113
Merged
Merged
Conversation
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.
9 of 17 tasks
This was referenced Nov 1, 2026
Merged
1 task
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up fixes found while reviewing and testing #5109. They are independent of it and merge cleanly with it in either order.
exitbypassis set,core_exit.shreturns instead of exiting, so a failed extraction fell through andfn_install_steamcmdranchmodon asteamcmd.shthat was never extracted. This is reachable when an update restarts the server andcheck_steamcmd.shinstalls SteamCMD.fn_dl_extractnow returns 1 after a bypassed failure andfn_install_steamcmdstops on it."force"tofn_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 asmultitheftauto_linux_x64.tar.gzthe next update would extract the stale file again.install_logs.shcalledcore_exit.shwithout settingexitcode, 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-resourcesalways errored: the module never calledcore_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
Testing
gameservermanagers/linuxgsm:ubuntu-26.04image aslinuxgsm, this branch on its own and merged with fix(core): propagate archive extraction and copy failures #5109, compared with develop and with fix(core): propagate archive extraction and copy failures #5109 alone:fn_install_steamcmdwithexitbypass=1and a corruptsteamcmd_linux.tar.gz./hlwonserver auto-installwith a read-only serverfiles directory./mtaserver auto-install, then./mtaserver install-default-resourcesanswered yes and no./mtaserver force-updatewith a stale file planted aslgsm/tmp/multitheftauto_linux_x64.tar.gzchmod: cannot access .../steamcmd.shFAIL: Creating game log directory ..., exit code 1Both merge orders with #5109 are clean. shfmt is clean, module modes unchanged, and shellcheck reports nothing new beyond the usual cross-module SC2154/SC2034.
Risk and rollback
Breaking changes
Documentation
Checklist
PR will not be merged until all steps are complete.