已关闭
[E2B runtime] /proxy/44772/command always 502 — Server returns Pod IP:44772 without runtime-aware remapping #3
langxingtian创建于  9月18日关闭于  27 天前
langxingtian
9月18日 创建

Environment:

  • SandboxGroup RUNTIME_TYPE=e2b
  • Server [runtime] type=flux
  • K8s single node (node1)

Repro:

  1. osb command run <sandbox_id> -- bash -c "echo hi"
    → 502 Bad Gateway

  2. Server log shows:
    POST /sandboxes//proxy/44772/command 502

  3. Check endpoints API:
    GET /v1/sandboxes//endpoints/44772?use_server_proxy=true
    → {"endpoint":":44772"}
    But agent pod only listens on 5758; microVM envd listens on 49983.

Root cause:

  • SDK hardcodes port 44772 (opensandbox/sync/adapters/command_adapter.py)
  • Server /endpoints/{port} returns the same port verbatim, no runtime check
  • In E2B mode, execd-style 44772 does not exist; the correct path is:
    Server → Agent:5758 → cri-multiplex → envd:49983

Expected:

  • Server should detect runtime=e2b (from SandboxGroup or Agent metadata)
    and map 44772 → Agent:5758 (or return 49983 for direct access)

Workaround in use:

  • Direct exec via envd Connect RPC at 169.254.x.x:49983 from firecracker netns
likedislike
openFuyao-botopenFuyao-bot成员
9月18日 添加了label:sig/sig-agent-sandbox
openFuyao-bot
openFuyao-bot成员
9月18日 评论:

欢迎来到 openFuyao 社区

Hey @langxingtian , 感谢你对社区的贡献.

机器人使用手册

有关指令的使用,可以点击 此处 查看详情。开发人员可以在每个PR或Issue下方评论特定指令来触发机器人任务。您可以自助配置此仓库的 PR 合并规则,更多详情,请参阅此处。

联系指引

有疑问可以联系 SIG: sig-agent-sandbox ,
维护者是: @Gao-Pan, @fisher789, @ruanhanqing, @wwthw, @zjw6 ,
审核者是: @Gao-Pan, @fisher789, @ruanhanqing, @wwthw, @zjw6 .

likedislike
zjw6zjw6成员
9月20日 将 leewang 设为负责人
leewang
leewang成员
27 天前 评论:
  1. E2B 沙箱是 microVM,内部只有 envd 守护进程,监听 49983,提供 Connect RPC(/process.Process/Start、/files、/health)。
  2. flux 在 E2B 模式下不注入 execd,agent 上报的 endpoint 就是 CNI IP:49983(internal/agent/runtime/e2b.go;E2B 的 ExecdPort 为 0)。E2B 模式下 agent pod 上也没有 44772——44772/execd 只存在于 containerd 模式。这是设计如此,不是缺失。
  3. 所以 osb 侧按 execd 契约取 endpoint(44772)再发 POST /command,在 E2B 下没有对端。
  4. E2B 下执行命令请走 envd 的 Connect RPC。

SDK 是否增加 envd 适配器,属于 opensandbox 侧的决策;flux 的 E2B endpoint 契约不会改回 44772。

likedislike
leewangleewang成员
27 天前 issue状态由 开启 改变为 非问题
leewangleewang成员
27 天前 关闭了 issue