Build failed?
Learn how to diagnose and fix common build failures.
Understanding Build Failures
Section titled “Understanding Build Failures”When a build fails, check the build logs for error messages.
Common Build Errors
Section titled “Common Build Errors”1. Dependency Errors
Section titled “1. Dependency Errors”Symptoms:
ERROR: Could not find a version that satisfies the requirementSolutions:
- Check package name spelling
- Specify version:
package==1.0.0 - Use compatible Python version
2. Import Errors
Section titled “2. Import Errors”Symptoms:
ModuleNotFoundError: No module named 'xxx'Solutions:
- Add missing package to
requirements.txt - Check package installation name
3. Syntax Errors
Section titled “3. Syntax Errors”Symptoms:
SyntaxError: invalid syntaxSolutions:
- Check Python version compatibility
- Verify code syntax
- Test locally first
4. File Not Found
Section titled “4. File Not Found”Symptoms:
FileNotFoundError: [Errno 2] No such file or directorySolutions:
- Check file paths
- Ensure files are uploaded
- Use relative paths
5. Memory Errors
Section titled “5. Memory Errors”Symptoms:
MemoryError / JavaScript heap out of memorySolutions:
- Reduce dependencies
- Split into smaller packages
Debugging Steps
Section titled “Debugging Steps”Step 1: Check Build Logs
Section titled “Step 1: Check Build Logs”Navigate to Worker details → Builds → View logs
Step 2: Identify Error Type
Section titled “Step 2: Identify Error Type”Look for keywords:
ERRORFailedException
Step 3: Fix and Rebuild
Section titled “Step 3: Fix and Rebuild”- Make necessary changes
- Upload new code
- Trigger new build
Prevention Tips
Section titled “Prevention Tips”| Issue | Prevention |
|---|---|
| Dependency | Pin versions in requirements |
| Syntax | Test locally before uploading |
| File paths | Use relative paths |
| Memory | Minimize dependencies |