Jump to solution
Details

The Fix

Upgrade to version 0.42.0 or later.

Based on closed Kludex/starlette issue #2771 · PR/commit linked

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Open PR/Commit
@@ -37,7 +37,7 @@ full = [ "python-multipart>=0.0.18", "pyyaml", - "httpx>=0.22.0", + "httpx>=0.27.0,<0.29.0", ]
fix.md
Option A — Upgrade to fixed release\nUpgrade to version 0.42.0 or later.\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\n

Why This Fix Works in Production

  • Trigger: TypeError: Client.__init__() got an unexpected keyword argument 'app'
  • Mechanism: Pins the version of httpx to avoid breaking changes introduced in version 0.28.0.
  • Why the fix works: Pins the version of httpx to avoid breaking changes introduced in version 0.28.0. (first fixed release: 0.42.0).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Dependency interaction matters here: httpx v0.28.0.
  • Surfaces as: TypeError: Client.__init__() got an unexpected keyword argument 'app'

Proof / Evidence

  • GitHub issue: #2771
  • Fix PR: https://github.com/encode/starlette/pull/2773
  • First fixed release: 0.42.0
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.95
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.80

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“yes, but httpx-0.28.0(released yeterday). And it was installed automatically)”
@vladislavkoz · 2024-11-29 · confirmation · source
“We had a hard time yesterday and today trying to figure out why all of our tests were failing all of a sudden. Specifically adding…”
@mr-grj · 2024-11-29 · source
“Not that it matters for this, but: https://github.com/encode/starlette/pull/2773”
@Kludex · 2024-11-30 · source
“Yes, I've also found that we can install connexion==3.0.3 and all other dependencies will be installed correctly(older starlette/httpx). So it's possible to use 3.0.3 if…”
@vladislavkoz · 2024-11-29 · source

Failure Signature (Search String)

  • TypeError: Client.__init__() got an unexpected keyword argument 'app'

Error Message

Stack trace
error.txt
Error Message ------------- TypeError: Client.__init__() got an unexpected keyword argument 'app'

What Broke

Tests were failing unexpectedly due to the breaking change in httpx, causing confusion and delays.

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

Upgrade to version 0.42.0 or later.

When NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/encode/starlette/pull/2773

First fixed release: 0.42.0

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use if it changes public behavior or if the failure cannot be reproduced.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
0.42.0 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.