fix(manager): avoid cp -a preserve ownership failure on NFS workspaces - #1163
fix(manager): avoid cp -a preserve ownership failure on NFS workspaces#1163LUOSENGWA wants to merge 1 commit into
Conversation
|
The
A re-run of the failed job would likely pass. If it reproduces consistently, it may be worth filing an upstream issue for the Team reconciler delete/create timing race. Thanks!
重新运行失败的 job 大概率能通过。如果持续复现,可能值得为 Team reconciler 的删除/创建时序竞态提一个上游 issue。 谢谢! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
This PR fixes a Manager startup failure on NFS-backed workspaces by adding --no-preserve=ownership to the cp -a command that installs built-in plugins. The option ordering is correct (-a expands to --preserve=all, and the following --no-preserve=ownership removes ownership preservation), so timestamps, modes, and links are still preserved while avoiding the chown-to-root failure under root-squash/maproot NFS. The change is minimal, targeted, and safe for the Ubuntu/GNU coreutils environment used by the Manager image.
Automated review by github-manager-bot
1655ec3 to
cdf2cb7
Compare
cdf2cb7 to
14352a9
Compare
Problem
When the Manager workspace is mounted from NFS (or any filesystem where the container user cannot chown to root), the plugin copy step in
start-qwenpaw-manager.shfails:Because
set -eis active (inmanager/scripts/lib/base.shandagentteams-env.sh), the failure aborts the entire Manager startup → the Manager enters a crash loop. Theagentteams-manager-toolsplugin (projectflow / taskflow / message / filesync) is never installed.Root cause:
cp -a(==--preserve=all) includes--preserve=ownership, which attempts tochownthe copied files to the source owner (root). On NFS with root-squash ormaprootto a non-root user, the container root cannotchownto uid 0 →Operation not permitted→cpexits non-zero →set -eaborts startup.问题
当 Manager 工作区挂载自 NFS(或任何容器用户无法 chown 到 root 的文件系统)时,
start-qwenpaw-manager.sh中的插件复制步骤会失败:由于
set -e处于启用状态(manager/scripts/lib/base.sh与agentteams-env.sh),失败会中止整个 Manager 启动流程 → Manager 进入崩溃循环。agentteams-manager-tools插件(projectflow / taskflow / message / filesync)永远无法安装。根因:
cp -a(等价于--preserve=all)包含--preserve=ownership,它会尝试将复制后的文件chown为源属主(root)。在启用 root-squash 或将maproot映射到非 root 用户的 NFS 上,容器内 root 无法chown到 uid 0 →Operation not permitted→cp非零退出 →set -e中止启动。Fix
Copy plugins without preserving ownership:
The plugin files keep the container user's ownership (readable by the QwenPaw PluginLoader); timestamps/modes/links are still preserved. Note the option order matters:
cp --no-preserve=ownership -awould be overridden by-a(which expands to--preserve=all), so--no-preserve=ownershipmust come after-a.修复
复制插件时不保留属主:
插件文件保留容器用户的属主(QwenPaw PluginLoader 可读);时间戳/权限/链接仍然保留。注意选项顺序很关键:
cp --no-preserve=ownership -a会被-a(展开为--preserve=all)覆盖,所以--no-preserve=ownership必须放在-a之后。Testing
maprootto a non-root user — plugin install succeeds, Manager starts.cp: failed to preserve ownershipand the Manager exits.测试
maproot映射到非 root 用户时 — 插件安装成功,Manager 正常启动。cp: failed to preserve ownership且 Manager 退出。