[Bug]: update-lgsm prints "fn_print_plain_flush: command not found" when updating from before v26.5.0

未关闭 适合新手
#5,242 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, linux, shell
领域
backend, cli

调研方向

从第 22 行附近的 lgsm/modules/core_exit.sh 开始,将其对 fn_print_plain_flush 的调用与 core_modules.sh 中针对 fn_fetch_core_dl 的保护条件进行比较。按照 issue 中的描述,创建一个 v26.4.0 实例并对 master 运行 update-lgsm,以重现问题。当首次更新在没有 shell 错误的情况下完成并成功退出时,任务即完成。

由索引模型根据 Issue 内容生成。

描述

command: update-lgsm distro: Debian engine: source2 game: Counter-Strike 2 regression: yes reproducible: always severity: low type: bug
Severity

severity: low

Reproducibility

reproducible: always

Regression

regression: yes

Affects latest release

latest-release: yes

User story

As a server admin who updates an old LinuxGSM install, I want update-lgsm to finish without a shell error, so that I can tell the update worked.

Script name

cs2server (reproduced with ts3server; any server is affected)

Game

Counter-Strike 2

Linux distro

Debian 13

Command

command: update-lgsm

Expected behavior

update-lgsm prints [ OK ] Updating LinuxGSM <server>: Updating modules and exits.

Actual behavior

Right after that line it prints core_exit.sh: line 22: fn_print_plain_flush: command not found. The exit code is still 0.

Further information

update-lgsm replaces the modules on disk while the running script still has the old core_messages.sh loaded. It then runs core_exit.sh, which is now the new file. Since #5117 (v26.5.0), core_exit.sh calls fn_print_plain_flush unconditionally, and an old core_messages.sh does not define it. This happens once, when updating from a version older than v26.5.0. Guarding the call with type, as core_modules.sh does for fn_fetch_core_dl, avoids it.

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

Not run: reproduced by running update-lgsm itself on a new test instance.

Relevant log output
# ts3server created from v26.4.0, Debian 13 (WSL2), modulesversion="v26.4.0".
$ LGSM_GITHUBBRANCH=master ./ts3server update-lgsm
checking GitHub module [ install_logs.sh ] ... UPDATE
fetching GitHub [ install_logs.sh ] ... OK
[  OK  ] Updating LinuxGSM ts3server: Updating modules
/home/user/ts3server/lgsm/modules/core_exit.sh: line 22: fn_print_plain_flush: command not found
$ echo $?
0
# A second update-lgsm prints no error.
Steps to reproduce
  1. Create an instance from v26.4.0: curl -Lo linuxgsm.sh https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/v26.4.0/linuxgsm.sh && chmod +x linuxgsm.sh && LGSM_GITHUBBRANCH=v26.4.0 bash linuxgsm.sh ts3server.
  2. Run one command so the v26.4.0 modules are downloaded: LGSM_GITHUBBRANCH=v26.4.0 ./ts3server details.
  3. Run LGSM_GITHUBBRANCH=master ./ts3server update-lgsm. The error is printed after Updating modules.

🤖 Generated with Claude Code

主要语言
Shell
星标
4.9k
派生
866
平均合并
17 小时 58 分钟
30 天内合并 PR
100

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GameServerManagers/LinuxGSM 的其他 Issue

查看 GameServerManagers/LinuxGSM 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。