Skip to content
Latchkey

schemathesis "Schemathesis found N failures" (server error) in CI

schemathesis generated test cases from your OpenAPI schema, sent them, and at least one check failed. A "Server error" failure means an endpoint returned 500 for a valid generated request, so the API crashed on input it should handle.

What this error means

schemathesis ends with "Schemathesis found N failures" and lists checks like "server_error" or "status_code_conformance", printing the failing request and a curl to reproduce. It exits non-zero.

schemathesis
=================== FAILURES ===================
_____________ GET /users/{id} _____________
1. Test Case ID: ...
- Server error
[500] Internal Server Error
Schemathesis found 1 failures

Common causes

An endpoint crashes on schema-valid input

schemathesis generated an input allowed by the schema (a boundary value, a rare enum) that the handler does not cope with, producing a 500.

The response violates the documented schema

The API returned a status or body that the OpenAPI spec does not declare, so a conformance check fails even without a 500.

How to fix it

Reproduce with the printed curl and fix the handler

  1. Copy the reproduction curl schemathesis prints for the failing case.
  2. Fix the handler so schema-valid input no longer 500s, or correct the schema if the input was never valid.
  3. Re-run so the check passes.
Terminal
schemathesis run http://localhost:8000/openapi.json --checks all

Point schemathesis at the running app with a base URL

When the schema is a file, give the live base URL so requests reach the app under test.

Terminal
schemathesis run ./openapi.yaml --base-url http://localhost:8000

How to prevent it

  • Run schemathesis against the app on every PR so schema-input crashes surface early.
  • Keep the OpenAPI schema in sync with the real responses.
  • Fix 500s on generated input rather than narrowing the schema to hide them.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →