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.
@@ -3,6 +3,7 @@
members:
- ConfigDict
+ - with_config
- ExtraValues
- BaseConfig
(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
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
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).
- 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”
“Sharing one more reference from the doc: https://docs.pydantic.dev/2.7/concepts/fields/#validate-default-values”
“> 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…”
“Thanks guys, but this ought to work? No change from before, no warning that I've done anything wrong”
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
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 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
(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
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].
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.
When NOT to Use This Fix
- This fix should not be used if backward compatibility with existing models is a concern.
Verify Fix
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
| Version | Status |
|---|---|
| 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.