Đang tải…
Đang tải…
npx claude-code-templates@latest --sandbox e2b/SANDBOX_DEBUGGINGArchivo: e2b-launcher.py
Archivo: e2b-monitor.py
Para testing sin API keys válidos, crea un archivo demo que simule el flujo completo.
Síntomas:
❌ Error: The sandbox was not found: This error is likely due to sandbox timeout
Soluciones:
Aumentar timeout del sandbox:
sbx = Sandbox.create(timeout=600) # 10 minutos
sbx.set_timeout(900) # Extender a 15 minutos
Usar el monitor para ver qué consume tiempo:
python e2b-monitor.py "Your prompt here" "" your_e2b_key your_anthropic_key
Síntomas:
❌ Claude not found, checking PATH...
Debugging Steps:
Verificar template correcto:
template="anthropic-claude-code" # Debe ser exactamente este
Verificar instalación en sandbox:
# El launcher ejecuta automáticamente:
which claude
claude --version
echo $PATH
Síntomas:
❌ Write permission issue
Soluciones:
Verificar directorio de trabajo:
pwd
whoami
ls -la
Cambiar a directorio con permisos:
sbx.commands.run("cd /home/user && mkdir workspace && cd workspace")
Síntomas:
❌ Error: 401: Invalid API key
Debugging:
Verificar formato de API key:
Verificar permisos:
python e2b-monitor.py "Create a React app" "" your_e2b_key your_anthropic_key
[14:32:15] INFO: 🚀 Starting enhanced E2B sandbox with monitoring
[14:32:16] INFO: ✅ Sandbox created: abc123xyz
[14:32:17] INFO: 🔍 System resources check
[14:32:17] INFO: Memory usage:
[14:32:17] INFO: total used free
[14:32:17] INFO: Mem: 2.0Gi 512Mi 1.5Gi
[14:32:18] INFO: 📁 Initial file system state
[14:32:18] INFO: Current directory: /home/user
[14:32:19] INFO: 🤖 Executing Claude Code with monitoring
[14:32:19] INFO: Starting monitored execution: echo 'Create a React app'...
[14:32:22] INFO: Command completed in 3.45 seconds
[14:32:22] INFO: Exit code: 0
[14:32:22] INFO: STDOUT length: 2847 characters
# Usar el monitor para ver exactamente dónde se cuelga
python e2b-monitor.py "Complex prompt that times out"
El launcher automáticamente descarga archivos generados:
💾 DOWNLOADING FILES TO LOCAL MACHINE:
✅ Downloaded: ./index.html → ./e2b-output/index.html
✅ Downloaded: ./styles.css → ./e2b-output/styles.css
📁 All files downloaded to: /path/to/project/e2b-output
[14:33:20] INFO: Top processes:
[14:33:20] INFO: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
[14:33:20] INFO: user 1234 5.2 2.1 98765 43210 pts/0 S+ 14:32 0:01 claude
export E2B_DEBUG=1 # Debug mode
export ANTHROPIC_API_KEY=your_key # Claude API key
export E2B_API_KEY=your_key # E2B API key
# Para operaciones muy largas (ej: compilación completa)
sbx = Sandbox.create(timeout=1800) # 30 minutos
sbx.set_timeout(3600) # 1 hora máximo
El launcher descarga automáticamente todos los archivos generados:
./e2b-output/Con estas herramientas puedes monitorear exactamente qué está pasando dentro del sandbox E2B y debuggear cualquier problema que surja.