bug(sandbox): scp and sftp stall for 30 s and exit 74 after a successful transfer
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 83/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- backend, networking, testing
调研方向
从 crates/openshell-sandbox/src/boundary_exec.rs 开始,这里保留了 SFTP helper 输出 socket 的副本;检查 helper 的正常退出路径以及 signal。然后阅读 trusted_sftp_helper_round_trips_through_boundary_streams 和 crates/openshell-sandbox/src/main_session.rs 中的输出排空处理。完成标准是:一个单元测试确认 helper 正常退出后其输出到达 EOF,并且 issue 中的 SFTP 和 scp 传输能够成功完成,不再停顿 30 秒。
由索引模型根据 Issue 内容生成。
描述
User Story
I ran a mini scale test of OpenShell on Kubernetes. Plain ssh into a sandbox worked, but every scp and sftp transfer stalled for about 30 seconds and then failed with exit code 74. I need SFTP to work so file copy tools and editors like VS Code Remote can use a sandbox.
Problem Statement
An SFTP session (from scp, sftp, or VS Code Remote) finishes its work, then hangs for about 30 seconds and fails with:
openshell: exec output could not be delivered intact
The exit code is 74, even when the file was copied correctly.
Why This Happens
The supervisor hands the sftp subsystem to a helper built into the sandbox runtime. When the helper finishes, OpenShell waits for the helper's output stream to close before it reports the exit status.
The output stream never closes. The helper keeps a second copy of its output socket so it can be cancelled later (boundary_exec.rs). That copy is only closed when the helper is killed (signal), not when it exits normally. Because one copy is still open, the reader never sees end-of-file.
After 30 seconds the runtime gives up waiting (REMOTE_OUTPUT_DRAIN_TIMEOUT), marks the output as lost, and returns 74.
I confirmed this with a unit test on main (624aceea3). The test runs a real SFTP session through the helper and closes it. The helper exits 0, but its output never closes. Closing the extra socket copy when the helper exits makes the test pass. The existing test trusted_sftp_helper_round_trips_through_boundary_streams misses this because it checks only the exit status, not end-of-file on the output.
Impact / Why This Matters
scp,sftp, and anything built on SFTP (such as VS Code Remote) fail or hang against every sandbox.- Scripts treat the transfer as failed because of exit code 74, even when the file arrived.
- The workaround is
openshell sandbox uploadandopenshell sandbox download, which don't use SFTP. They don't help tools that expect plain SSH file transfer.scp -O(legacy mode) doesn't help either, because sandbox images usually have noscpbinary.
Acceptance Criteria
-
scpandsftpto a sandbox exit 0 as soon as the transfer finishes, with no 30-second stall. - A unit test checks that the SFTP helper's output reaches end-of-file after a normal exit.
Reproduction Steps
- Create a sandbox:
openshell sandbox create --name mybox - Add its SSH config:
openshell sandbox ssh-config mybox >> ~/.ssh/config - Copy a file:
time scp ./somefile openshell-mybox.default:/tmp/ - The command hangs for about 30 seconds and exits 74 with "exec output could not be delivered intact".
Environment
- OpenShell: mini scale test build; code path confirmed on
mainat 624aceea3 - Deployment: Kubernetes (Helm), shared supervisor pool
- 主要语言
- Rust
- 星标
- 21.5k
- 派生
- 2.1k
- 平均合并
- 2 天 20 小时
- 30 天内合并 PR
- 246
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA/OpenShell#5638 · 1 条评论 ·
维护者通常 1 天内回复
-
bug: Ready=False/PodTerminating is treated as a terminal sandbox failure可能已有人在做 @TaylorMutch 于 1 天前认领。 未关闭state:accepted state:pr-opened
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA/OpenShell#5588 · 2 条评论 ·
维护者通常 1 天内回复
-
state:triage-needed
难度 1/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
相似的 Issue
-
ai_p2
难度 2/5 1-3 小时 新手友好度 80/100
ClickHouse/ClickHouse#132519 ·
维护者通常 1 天内回复
-
Pattern-clip compiler tests miss the clip cap, sort order, muted output and count/emit agreement未关闭area: engine type: test
难度 2/5 1-3 小时 新手友好度 76/100
YuriiMurha/grooviq#224 ·
维护者通常 1 天内回复
-
state:needs triage
难度 2/5 1-3 小时 新手友好度 83/100
zed-industries/zed#67109 · 1 条评论 ·
维护者通常 1 天内回复
-
bug priority: medium
难度 2/5 1-3 小时 新手友好度 78/100
storytold/photocraft#15500 · 1 条评论 ·
维护者通常 1 天内回复
-
bug good first issue language priority/low
难度 2/5 1-3 小时 新手友好度 88/100
ZanattaMichael/meridian-core#143 ·
维护者通常 1 天内回复