Error Types
SandboxError / SandboxException
Base class for all Moru errors. Catch this to handle any Moru error.TimeoutError / TimeoutException
Raised when an operation times out. Common causes:- Sandbox creation took too long
- Command exceeded timeout
- Network issues
- Increase timeout value
- Check network connectivity
- Use a template with pre-installed dependencies
NotFoundError / NotFoundException
Resource not found - sandbox, template, or file doesn’t exist. Common causes:- Sandbox was terminated
- Template doesn’t exist
- File path is incorrect
AuthenticationError / AuthenticationException
Authentication failed - invalid or missing API key. Solutions:- Verify your API key is correct
- Check if the key has necessary permissions
- Ensure
MORU_API_KEYenvironment variable is set
RateLimitError
Too many requests - rate limit exceeded. Solutions:- Wait and retry with exponential backoff
- Reduce request frequency
- Contact support for higher limits
NotEnoughSpaceError / NotEnoughSpaceException
Disk space exhausted in sandbox. Solutions:- Delete unnecessary files
- Use a larger disk quota
- Start fresh with a new sandbox
CommandExitError / CommandExitException
Command exited with non-zero exit code.TemplateError / TemplateException
Template incompatibility or version issues. Solutions:- Rebuild the template
- Update to a newer template version
- Check template build logs
BuildError / BuildException
Template build failed. Solutions:- Check build logs
- Verify Dockerfile is correct
- Ensure dependencies are available
Common Issues
”Sandbox not responding”
The sandbox may have timed out or crashed.- Check if sandbox is still running:
sandbox.is_running() - Check sandbox logs via CLI:
moru sandbox logs sbx_id - Create a new sandbox if needed
”Connection refused”
Network connectivity issues.- Verify internet connectivity
- Check if sandbox allows outbound connections
- Verify the port is correct for
getHost()
”Permission denied”
File or command permission issues.- Use
user="root"for privileged operations - Check file permissions with
sandbox.files.get_info() - Ensure template has correct user setup
Error Handling Pattern
Getting Help
If you encounter persistent issues:- Check the dashboard for system status
- Review sandbox logs for detailed error messages
- Report issues at github.com/moru-ai