Jump to solution
Verify

The Fix

pip install pydantic==2.6.0

Based on closed pydantic/pydantic issue #9389 · PR/commit linked

Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.

Jump to Verify Open PR/Commit
@@ -3,6 +3,7 @@ members: - ConfigDict + - with_config - ExtraValues - BaseConfig
repro.py
(0,) <class 'tuple'> 3 <class 'int'> pydantic version: 2.7.1 pydantic-core version: 2.18.2 pydantic-core build: profile=release pgo=false install path: /home/pi/blinka/lib/python3.11/site-packages/pydantic python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] platform: Linux-6.6.20+rpt-rpi-v8-aarch64-with-glibc2.36 related packages: fastapi-0.110.2 typing_extensions-4.11.0 commit: unknown
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install pydantic==2.6.0\nWhen NOT to use: This fix should not be used if backward compatibility with existing models is a concern.\n\nOption C — Workaround\nas you proposed [^1].\nWhen NOT to use: This fix should not be used if backward compatibility with existing models is a concern.\n\n

Why This Fix Works in Production

  • Trigger: No change from before, no warning that I've done anything wrong.
  • Mechanism: Default values in Pydantic models were not validated, leading to incorrect types being assigned
  • Why the fix works: Added a `with_config` decorator to comply with typing spec, which may address the issue of default values not being validated. (first fixed release: 2.6.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

  • Triggered by an upgrade/regression window: 6.6.20 breaks; 2.6.0 is the first fixed release.
  • Shows up under Python 3.11 in real deployments (not just unit tests).
  • Default values in Pydantic models were not validated, leading to incorrect types being assigned
  • Production symptom (often without a traceback): No change from before, no warning that I've done anything wrong.

Proof / Evidence

  • GitHub issue: #9389
  • Fix PR: https://github.com/pydantic/pydantic/pull/8611
  • First fixed release: 2.6.0
  • Affected versions: 6.6.20
  • 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.63

Discussion

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

“You are looking for https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.validate_default”
@Viicos · 2024-05-04 · source
“Sharing one more reference from the doc: https://docs.pydantic.dev/2.7/concepts/fields/#validate-default-values”
@RajatRajdeep · 2024-05-05 · source
“> You can open a new issue for this to catch attention from maintainers, but there's a high chance it will be rejected, as it…”
@JohnHind · 2024-05-07 · source
“Thanks guys, but this ought to work? No change from before, no warning that I've done anything wrong”
@JohnHind · 2024-05-06 · source

Failure Signature (Search String)

  • No change from before, no warning that I've done anything wrong.
  • This also works and seems cleaner, particularly if there is more than one schema to modify.
Copy-friendly signature
signature.txt
Failure Signature ----------------- No change from before, no warning that I've done anything wrong. This also works and seems cleaner, particularly if there is more than one schema to modify.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- No change from before, no warning that I've done anything wrong. This also works and seems cleaner, particularly if there is more than one schema to modify.

Minimal Reproduction

repro.py
(0,) <class 'tuple'> 3 <class 'int'> pydantic version: 2.7.1 pydantic-core version: 2.18.2 pydantic-core build: profile=release pgo=false install path: /home/pi/blinka/lib/python3.11/site-packages/pydantic python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] platform: Linux-6.6.20+rpt-rpi-v8-aarch64-with-glibc2.36 related packages: fastapi-0.110.2 typing_extensions-4.11.0 commit: unknown

Environment

  • Python: 3.11
  • Pydantic: 2

What Broke

Users experienced unexpected behavior due to incorrect types being assigned to model fields.

Why It Broke

Default values in Pydantic models were not validated, leading to incorrect types being assigned

Fix Options (Details)

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

pip install pydantic==2.6.0

When NOT to use: This fix should not be used if backward compatibility with existing models is a concern.

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

Option C — Workaround Temporary workaround

as you proposed [^1].

When NOT to use: This fix should not be used if backward compatibility with existing models is a concern.

Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.

Fix reference: https://github.com/pydantic/pydantic/pull/8611

First fixed release: 2.6.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

  • This fix should not be used if backward compatibility with existing models is a concern.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

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

Prevention

  • Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
  • Upgrade behind a canary and run integration tests against the canary before 100% rollout.

Version Compatibility Table

VersionStatus
6.6.20 Broken
2.6.0 Fixed

Related Issues

No related fixes found.

Sources

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