Issue
- Running:
bench build --app helpdesk
- fails with:
killed (exit code 137)
Cause
- Exit code 137 occurs when the operating system kills a process due to low memory (OOM).
- This can happen if swap space is not properly active or already full, even if the server has sufficient RAM.
Solution (Actual Fix)
- Restart Swap and clear it:
sudo swapoff -a
sudo swapon -a
- Retry Build:
bench build --app helpdesk
After restarting swap, the build should complete successfully.
Alternative Solution
- If the above does not work because the server has very low RAM:
- Increase Swap Memory:
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
- Retry the build again.
Note : The main fix is to restart and reset swap. Increasing swap is only needed on servers with insufficient RAM.
Don’t forget to restart bench after you build app successfully.
bench restart