修复 Stdb 发布临时目录权限
Project CI / Repository checks (push) Failing after 3m27s
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m14s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 5m31s
Project CI / AI game creator shell Rust shard 3/4 (push) Failing after 4m38s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m26s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m41s
Project CI / AI game creator shell Rust crates (push) Successful in 2m33s
Project CI / Frontend tests (push) Failing after 3m51s
Project CI / Backend tests (push) Successful in 7m37s
Project CI / Native shell tests (push) Successful in 7m7s
Project CI / AI game creator shell web tests (push) Failing after 3m15s

将以服务用户执行的 WASM 发布临时目录移到 /var/tmp
This commit is contained in:
2026-09-16 00:02:46 +08:00
parent ab8e744ae7
commit eeb0206164
2 changed files with 9 additions and 1 deletions
@@ -5603,3 +5603,9 @@ Cocos Creator 根目录由 `package.json.creator.version` 与普通 `assets/`
- **原因**:统一错误解析器只处理标准 `error.message/details` 结构;部分网关或旧兼容响应使用字符串 `error`,解析失败后回落到登录接口传入的通用文案。
- **处理**`parseApiErrorMessage` 同时支持字符串 `error`,标准嵌套结构保持原有优先级;未知或空响应继续使用通用兜底。
- **验证**`src/services/apiClient.test.ts` 新增字符串错误响应回归用例,定向测试 32 项通过,`npm run typecheck` 通过。
## 2026-09-15 Jenkins Stdb 发布临时目录必须允许服务用户遍历
- **现象**`Genarrative-Stdb-Module-Publish` 在备份和 SpacetimeDB 就绪后,于 `spacetime publish``Permission denied`
- **原因**Jenkins 以 root 运行时 `${HOME}/data/tmp` 位于 `/root` 下;即使发布临时子目录已 `chown``spacetimedb`,父目录仍不可遍历。
- **处理**:发布给 `--run-as-user` 的 WASM 临时目录改用 `/var/tmp`,继续使用随机目录并在退出时清理。
+3 -1
View File
@@ -747,7 +747,9 @@ if [[ -n "${RUN_AS_USER}" && "$(id -u)" -eq 0 ]]; then
echo "[production-stdb-publish] 发布用户不存在: ${RUN_AS_USER}" >&2
exit 1
fi
task_tmp_dir="${HOME}/data/tmp"
# runuser 需要能够穿过临时目录的父目录;Jenkins 以 root 运行时 HOME
# 通常是 /root,而 /root 对 spacetimedb 不可遍历。
task_tmp_dir="/var/tmp"
mkdir -p "${task_tmp_dir}"
PUBLISH_TMP_DIR="$(mktemp -d "${task_tmp_dir}/genarrative-stdb-publish.XXXXXX")"
install -m 0644 "${SOURCE_DIR}/spacetime_module.wasm" "${PUBLISH_TMP_DIR}/spacetime_module.wasm"