# INTERNAL_ERROR: something failed on our side

> A 500 is our fault, not yours. The response is deliberately bare - no stack trace, no internal detail - but it carries a request id that leads us straight to the failure in our logs.

Source: https://astronode.dev/docs/errors/internal-error · Updated: 2026-12-01

Code: `INTERNAL_ERROR` · HTTP status: 500

| Question | Answer |
| --- | --- |
| HTTP status | 500 Internal Server Error |
| Retry? | Yes, with exponential backoff - a few attempts, then stop and report it. |
| Your input at fault? | No. Caller mistakes are always 4xx. |
| Chat-only relatives | 502 `LLM_PROVIDER_ERROR`, 504 `LLM_TIMEOUT` - also retryable. |

## The response

Produced in our test harness by making the rate-limit store fail, as an outage would:

```json
{
  "request_id": "req_01M8RK47X82KNA02TP97WE0JGV",
  "error": { "code": "INTERNAL_ERROR", "message": "Unexpected server error" }
}
```

The message is the same for every 500, by design: it never includes the underlying exception, which could leak internals. Everything we need is keyed by the `request_id`, also sent as the `x-request-id` response header. Each 500 is reported to our error tracking automatically, so you do not need to tell us it happened - only if it keeps happening.

## Retrying safely

Calculation endpoints have no side effects, so retrying them is safe. Endpoints that start a job (bulk matching, PDF reports) do: send an `Idempotency-Key` with them, and a retry after an ambiguous failure gets the original report id back instead of starting a second job (see [IDEMPOTENCY_KEY_REUSED](https://astronode.dev/docs/errors/idempotency-key-reused)).

```python
import random, time, requests

RETRYABLE = {500, 502, 504}

def post(path, body, key, attempts=4):
    for n in range(attempts):
        r = requests.post(f"https://api.astronode.dev{path}", json=body,
                          headers={"Authorization": f"Bearer {key}"}, timeout=30)
        if r.status_code not in RETRYABLE or n == attempts - 1:
            return r
        time.sleep(2 ** n + random.random())  # 1s, 2s, 4s (+ jitter)
```

Do not put 4xx codes in the retry set: a [400](https://astronode.dev/docs/errors/validation-error) or [403](https://astronode.dev/docs/errors/plan-required) will fail identically every time - refusals are not billed, but they burn your per-minute window and your time. A [429](https://astronode.dev/docs/errors/rate-limited) needs its own wait, read from its `Retry-After` header. 5xx responses are never billed either.

## Reporting a persistent 500

- The `request_id` of one failing call (it starts with `req_`).
- The endpoint, and the request body if you can share it - a 500 that repeats for one input is usually a bug in handling that input.
- Whether it started at a specific time. Check the [changelog](https://astronode.dev/changelog) first.

Input-specific 500s are bugs we turn into 400s with a reason. The polar-latitude cases are the precedent: Placidus houses above the Arctic Circle used to fail with a 500 and now return a [400 that explains why](https://astronode.dev/docs/errors/polar-latitude-errors).

## Chat: upstream model errors

[`POST /v1/chat/respond`](https://astronode.dev/capabilities/chat/chat-respond) depends on a language-model provider. When the provider fails it answers `502 LLM_PROVIDER_ERROR`; when the provider does not answer in time, `504 LLM_TIMEOUT`. Both use the chat envelope (`"success": false`) and both are worth one or two retries with backoff - the same loop as above.

## Endpoints

- [`POST /v1/charts/birth`](https://astronode.dev/capabilities/vedic/charts-birth) - Birth Chart (Kundli) API
- [`POST /v1/chat/respond`](https://astronode.dev/capabilities/chat/chat-respond) - AI Astrologer Chat API
- [`POST /v1/western/natal/houses`](https://astronode.dev/capabilities/western/western-natal-houses) - Western Natal Houses API
