[GH-ISSUE #14479] [Docs] API returns undocumented 499 and 503 status codes on scheduler errors #55903

Closed
opened 2026-04-29 09:55:25 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @oqoqo-bot on GitHub (Feb 26, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14479

Documentation Gap

The API error documentation lists six possible HTTP status codes (200, 400, 404, 429, 500, 502). However, handleScheduleError returns two additional codes — 499 for canceled requests and 503 for queue-full conditions — that are not in the docs.

Severity: high

Description

The API error documentation lists six possible HTTP status codes (200, 400, 404, 429, 500, 502). However, handleScheduleError returns two additional codes — 499 for canceled requests and 503 for queue-full conditions — that are not in the docs. API clients built against the documented error codes will not handle these responses.

  • The error docs enumerate all API status codes as 200, 400, 404, 429, 500, and 502 (errors.mdx:9-14)
  • handleScheduleError returns 499 with "request canceled" when the context is canceled (routes.go:2507)
  • handleScheduleError returns 503 (ServiceUnavailable) with the error message when ErrMaxQueue is hit (routes.go:2509)
  • HTTP 499 is a non-standard code (Nginx convention) that most HTTP libraries don't recognize, making it especially surprising for API consumers
  • The same function also returns 400, 404, and 500 which are documented — only 499 and 503 are missing from the docs

How to Validate

Affected Files

  • docs/api/errors.mdx
  • server/routes.go

Created by Oqoqo

Originally created by @oqoqo-bot on GitHub (Feb 26, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14479 ## Documentation Gap The API error documentation lists six possible HTTP status codes (200, 400, 404, 429, 500, 502). However, `handleScheduleError` returns two additional codes — 499 for canceled requests and 503 for queue-full conditions — that are not in the docs. **Severity:** high ## Description The API error documentation lists six possible HTTP status codes (200, 400, 404, 429, 500, 502). However, `handleScheduleError` returns two additional codes — 499 for canceled requests and 503 for queue-full conditions — that are not in the docs. API clients built against the documented error codes will not handle these responses. - The error docs enumerate all API status codes as 200, 400, 404, 429, 500, and 502 ([errors.mdx:9-14](https://github.com/ollama/ollama/blob/main/docs/api/errors.mdx#L9-L14)) - `handleScheduleError` returns 499 with `"request canceled"` when the context is canceled ([routes.go:2507](https://github.com/ollama/ollama/blob/main/server/routes.go#L2507)) - `handleScheduleError` returns 503 (`ServiceUnavailable`) with the error message when `ErrMaxQueue` is hit ([routes.go:2509](https://github.com/ollama/ollama/blob/main/server/routes.go#L2509)) - HTTP 499 is a non-standard code (Nginx convention) that most HTTP libraries don't recognize, making it especially surprising for API consumers - The same function also returns 400, 404, and 500 which are documented — only 499 and 503 are missing from the docs ## How to Validate - [Confirm errors.mdx does not list 499 or 503.](https://github.com/ollama/ollama/blob/main/docs/api/errors.mdx#L9-L14) - [Confirm handleScheduleError returns 499 for context.Canceled.](https://github.com/ollama/ollama/blob/main/server/routes.go#L2502-L2515) - [Confirm handleScheduleError returns 503 for ErrMaxQueue.](https://github.com/ollama/ollama/blob/main/server/routes.go#L2509) ## Affected Files - `docs/api/errors.mdx` - `server/routes.go` --- *Created by [Oqoqo](https://oqoqo.ai)*
Author
Owner

@rick-github commented on GitHub (Feb 27, 2026):

The 499 is internal because the client has cancelled. The 503 is documented in the FAQ. Please don't post any more AI rubbish.

<!-- gh-comment-id:3970088777 --> @rick-github commented on GitHub (Feb 27, 2026): The 499 is internal because the client has cancelled. The 503 is documented in the FAQ. Please don't post any more AI rubbish.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#55903