# Service Crashes Troubleshooting Guide **Last Updated**: 2025-10-22 --- ## OOM Killed (Exit Code 137) ### Symptom: Container exits with code 137 **Diagnosis**: ```bash # Check pod events kubectl describe pod foxhunt-trading-service-xxxxx -n foxhunt | grep -A 10 Events # Output: # Reason: OOMKilled # Message: Container exceeded memory limit # Check memory limits kubectl get pod foxhunt-trading-service-xxxxx -n foxhunt -o jsonpath='{.spec.containers[0].resources.limits.memory}' ``` **Resolution**: ```bash # Increase memory limit kubectl patch deployment foxhunt-trading-service -n foxhunt \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"trading-service","resources":{"limits":{"memory":"4Gi"}}}]}}}}' # OR enable swap (not recommended for production) ``` --- ## Panic/Segfault ### Symptom: Container crashes with panic or segfault **Diagnosis**: ```bash # Check logs before crash kubectl logs -n foxhunt foxhunt-trading-service-xxxxx --previous | tail -100 # Output: # thread 'main' panicked at 'index out of bounds: the len is 10 but the index is 10', src/main.rs:42 ``` **Resolution**: ```bash # Fix code bug and deploy new version # Add bounds checking in code ``` --- **End of Service Crashes Troubleshooting Guide**