The Fix
pip install pydantic==2.11.0
Based on closed pydantic/pydantic issue #11443 · 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%.
@@ -873,7 +873,7 @@ def _generate_schema_from_get_schema_method(self, obj: Any, source: Any) -> core
return schema
- if (validators := getattr(obj, '__get_validators__', None)) is not None:
+ if get_schema is None and (validators := getattr(obj, '__get_validators__', None)) is not None:
from pydantic.v1 import BaseModel as BaseModelV1
from pydantic import BaseModel
class Model(BaseModel):
a: int
@classmethod
def __get_validators__(cls):
yield cls._validate
@classmethod
def _validate(cls, value):
raise ValueError
m = Model(a=1) # runs fine.
class Other(BaseModel):
m: Model
Other(m={'a': 1})
# ValueError
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.11.0\nWhen NOT to use: This fix should not be applied if the model does not implement both methods correctly.\n\n
Why This Fix Works in Production
- Trigger: m = MenuItem(command=a, when=None)
- Mechanism: The validation method was incorrectly receiving an unexpected number of arguments
- Why the fix works: Fixes the validation issue by not checking for `__get_validators__` on classes where `__get_pydantic_core_schema__` is also defined. (first fixed release: 2.11.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
- Shows up under Python 3.12 in real deployments (not just unit tests).
- The validation method was incorrectly receiving an unexpected number of arguments
- Surfaces as: Traceback (most recent call last):
Proof / Evidence
- GitHub issue: #11443
- Fix PR: https://github.com/pydantic/pydantic/pull/11444
- First fixed release: 2.11.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.46
Verified Execution
We executed the runnable minimal repro in a temporary environment and captured exit codes + logs.
- Status: PASS
- Ran: 2026-02-11T16:52:29Z
- Package: pydantic
- Fixed: 2.11.0
- Mode: fixed_only
- Outcome: ok
Logs
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“right..”
“@Czaki, I think we should probably try to create a MRE here that leaves app-model and pydantic-compat out of it and only uses pydantic v2…”
“Since Pydantic 2.3 the __get_validators__ is part of PyDantic 2. Until Tuesday, I will not have time to sit on MRE, and not sure what…”
“Great to hear your are testing on the pre-releases. I'll investigate tomorrow.”
Failure Signature (Search String)
- m = MenuItem(command=a, when=None)
Error Message
Stack trace
Error Message
-------------
Traceback (most recent call last):
File "/home/czaki/Projekty/app-model/tests/bug_reproduce.py", line 9, in <module>
m = MenuItem(command=a, when=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/czaki/.pyenv/versions/app-model/lib/python3.12/site-packages/pydantic/main.py", line 230, in __init__
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: MenuItemBase._validate() takes 2 positional arguments but 3 were given
Process finished with exit code 1
Minimal Reproduction
from pydantic import BaseModel
class Model(BaseModel):
a: int
@classmethod
def __get_validators__(cls):
yield cls._validate
@classmethod
def _validate(cls, value):
raise ValueError
m = Model(a=1) # runs fine.
class Other(BaseModel):
m: Model
Other(m={'a': 1})
# ValueError
Environment
- Python: 3.12
- Pydantic: 2
What Broke
CI jobs failed due to validation errors in Pydantic models.
Why It Broke
The validation method was incorrectly receiving an unexpected number of arguments
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.11.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/pydantic/pydantic/pull/11444
First fixed release: 2.11.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the model does not implement both methods correctly.
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 |
|---|---|
| 2.11.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.