#720 Sandbox temp files fail in Docker-in-Docker: can't find __main__ module

closed high Created 2025-12-27 03:27 · Updated 2025-12-27 03:27

Description

Edit
FIXED: When running sandboxed code execution (tools.code.exec) inside Docker containers with Docker socket mounted (DinD), temp files created in /tmp exist only inside the worker container. When Docker mounts them into sandbox containers, it uses HOST paths where the file doesn't exist, causing 'can't find __main__ module' error. Root cause: tempfile.NamedTemporaryFile creates files in /tmp inside container, but Docker volume mounts use host paths. Fix: Use HIGHWAY_SANDBOX_DEV_MOUNT_PATH environment variable (which is mounted at same path on host and container via ${PWD}:${PWD}) for temp file storage. Created .sandbox_temp subdirectory. File modified: engine/tools/sandbox.py lines 372-396 Also added .sandbox_temp to .gitignore.

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...