Exit code 130 means the container received SIGINT (Ctrl+C). This is typically intentional user interruption, not an error. Verify if termination was expected or implement signal handling.
Exit code 130 indicates that a container was terminated by a SIGINT signal (signal 2). The exit code is calculated as 128 + 2 = 130. SIGINT is the standard interrupt signal sent when a user presses Ctrl+C. Unlike other exit codes, 130 is not an errorโit indicates intentional interruption. This commonly occurs during interactive debugging sessions, manual process termination, or when kubectl commands themselves are interrupted.
First, verify whether someone manually interrupted the process:
kubectl describe pod <pod-name>Check the Events section and Last State. If Reason shows "Completed" with exit code 130, it was likely a user-initiated Ctrl+C.
Review recent activity:
- Did someone run kubectl exec or kubectl attach?
- Was a CI/CD job cancelled?
- Did a developer interrupt a debugging session?
If exit code 130 triggers unwanted restarts:
# For one-time tasks, prevent restarts
spec:
restartPolicy: Never
# Or only restart on actual failures
spec:
restartPolicy: OnFailureNote: Deployments force restartPolicy: Always. Use Jobs if you need different restart behavior.
For applications that need graceful interruption handling:
Python:
import signal
import sys
def handler(signum, frame):
print("Received SIGINT, cleaning up...")
# Cleanup logic
sys.exit(0) # Exit cleanly instead of 130
signal.signal(signal.SIGINT, handler)Node.js:
process.on('SIGINT', () => {
console.log('Received SIGINT, shutting down...');
// Cleanup logic
process.exit(0);
});Exit code 130 (SIGINT) is different from error-indicating codes:
| Code | Signal | Meaning |
|------|--------|---------|
| 130 | SIGINT | User interrupt (Ctrl+C) - usually intentional |
| 137 | SIGKILL | Force kill - often OOMKilled |
| 143 | SIGTERM | Graceful termination request |
If you're seeing 130 unexpectedly, check for automated processes sending SIGINT rather than SIGTERM.
In CI/CD systems, exit code 130 indicates job cancellation:
# GitLab CI example - handle interrupts
script:
- |
trap 'echo "Job cancelled, cleaning up..."; exit 0' INT
./long-running-task.shSome CI systems interpret code 130 as failure. Wrap commands to return 0 on interrupt if needed:
./my-command || [ $? -eq 130 ] && exit 0Exit code 130 is expected behavior in interactive Kubernetes workflows. When running kubectl exec -it or kubectl run -it, pressing Ctrl+C sends SIGINT to the container process, resulting in exit code 130.
For debugging containers that exit with 130, check if automated tools or scripts are sending SIGINT. Some process managers incorrectly send SIGINT instead of SIGTERM for graceful shutdown.
In production, exit code 130 should be rare since interactive sessions are uncommon. If you see it frequently, investigate whether monitoring tools or automated processes are interrupting containers.
The container runtime preserves the exit code, so 130 indicates the application itself exited with that code (either by not handling SIGINT or by explicitly exiting with 130 after handling it).
Service port already allocated
How to fix "Service port already allocated" in Kubernetes
minimum cpu usage per Container
How to fix "minimum cpu usage per Container" in Kubernetes
Failed to connect to server: connection refused (HTTP/2)
How to fix "HTTP/2 connection refused" error in Kubernetes
No subnets found for EKS cluster
How to fix "eks subnet not found" in Kubernetes
missing request for cpu in container
How to fix "missing request for cpu in container" in Kubernetes HPA