# Runtime.ExitError: RequestId ... Error: Runtime exited with error

AWS error fixes · Updated 16 November 2026

**Short answer:** The process running your function exited or was killed before it returned a response. The exit status in the message is the clue: "signal: killed" is almost always running out of memory, "exit status 1" or 2 is your code or runtime calling exit or crashing during start-up, and "signal: segmentation fault" points at a native library. Read the log lines just above the error to see what the process was doing.

## What it looks like

```
START RequestId: 8f2a… Version: $LATEST
…
RequestId: 8f2a… Error: Runtime exited with error: exit status 1
Runtime.ExitError
END RequestId: 8f2a…
REPORT RequestId: 8f2a… Duration: 412.30 ms  Billed Duration: 413 ms  Memory Size: 512 MB  Max Memory Used: 88 MB
```

Lambda expects the runtime process to stay alive between invocations and hand back each result. If it exits, the current invocation fails with this error and the next one pays for a fresh start (a cold start).

## Read the exit status

| Message ends with | Likely cause |
|---|---|
| `signal: killed` | Out of memory. `Max Memory Used` equals `Memory Size` in the REPORT line; see [Lambda out of memory](https://cloudconsole.dev/errors/lambda-out-of-memory) |
| `exit status 1` | Code called `process.exit(1)` or `sys.exit(1)`, or an uncaught error in a custom runtime or start-up script |
| `exit status 2` | Common for a Go `panic` on `provided.al2023`; the panic trace is in the log above |
| `signal: segmentation fault` / `signal: aborted` | A native module or binary crashed, often one compiled for a different OS or CPU architecture |
| `exit status 0` | Something exited cleanly, e.g. a custom `bootstrap` that runs once instead of looping |

## Common causes in practice

- **Explicit exits in handler code.** CLI-style scripts ported to Lambda often end with `process.exit()` or `sys.exit()`. Return or throw instead; let the runtime report the result.
- **A crash during initialisation.** Code at module level (reading config, opening a DB connection) throws and the runtime process dies. Wrap start-up work and log the error before it propagates.
- **Native dependencies built on a laptop.** Modules such as `sharp`, `bcrypt` or Python wheels with C extensions built on macOS or for x86_64, deployed to an arm64 function (or the reverse).
- **Custom runtimes** whose `bootstrap` doesn't loop over the Runtime API's `next` invocation endpoint.
- **Memory exhaustion** that kills the process abruptly.

## Diagnose and fix

1. Find recent occurrences and the lines just before them:

   ```
   aws logs filter-log-events --log-group-name /aws/lambda/my-function \
     --filter-pattern '"Runtime exited with error"' --start-time $(date -d '-1 hour' +%s000) \
     --query 'events[].message' --output text
   ```

2. Check the architecture and runtime against what you built for:

   ```
   aws lambda get-function-configuration --function-name my-function \
     --query '[Runtime,Architectures,MemorySize,Handler]'
   ```

3. Rebuild native dependencies for the target, e.g. Python wheels for arm64:

   ```
   pip install -r requirements.txt -t package/ \
     --platform manylinux2014_aarch64 --only-binary=:all: --python-version 3.12
   ```

4. If `Max Memory Used` is at the limit, raise memory and look for what is growing.

Confirm the fix by invoking with a realistic payload and checking the REPORT line shows a clean finish. Alarm on the function's `Errors` metric (see [Lambda Errors alarm](https://cloudconsole.dev/alarms/lambda-errors)) so a regression is caught early.

## Questions

### What is Runtime.ExitError in Lambda?

The runtime process exited or was killed while handling an invocation, so Lambda had no response to return. The exit status or signal in the message tells you why.

### Does Runtime exited with error signal: killed mean out of memory?

Almost always. Check the REPORT line: if Max Memory Used equals Memory Size, increase memory or reduce what the function loads.

### Is a Runtime.ExitError retried?

For asynchronous invocations, yes: Lambda retries failed async events by default, up to two more times. Synchronous callers get the error and decide themselves.

## When this happens away from your desk

Exit errors tend to appear right after a deploy, as a sudden jump in the function's error rate. CloudConsole, a phone app for AWS, is built to show that alarm next to the crashing log lines on your phone, so you can decide quickly whether to roll back.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Troubleshoot execution issues in Lambda](https://docs.aws.amazon.com/lambda/latest/dg/troubleshooting-execution.html)
- [AWS Lambda documentation](https://docs.aws.amazon.com/lambda/)

## Related

- [Runtime exited with error: signal: killed (Lambda out of memory)](https://cloudconsole.dev/errors/lambda-out-of-memory)
- [Runtime.ImportModuleError: Unable to import module](https://cloudconsole.dev/errors/lambda-runtime-importmoduleerror)
- [Runtime.InvalidEntrypoint](https://cloudconsole.dev/errors/lambda-runtime-invalidentrypoint)
- [Lambda: Task timed out after 3.00 seconds](https://cloudconsole.dev/errors/lambda-task-timed-out)
- [aws lambda update-function-configuration](https://cloudconsole.dev/cli/lambda-update-function-configuration)
- [Lambda memory usage with Logs Insights](https://cloudconsole.dev/logs-insights/lambda-memory-usage)

---

Source: https://cloudconsole.dev/errors/lambda-runtime-exiterror

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
