Jump to solution
Verify

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%.

Jump to Verify Open PR/Commit
@@ -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
repro.py
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
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.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).
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

  • 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

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
affected (exit=None)
fixed (exit=0)

Discussion

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

“right..”
@tlambert03 · 2025-02-14 · confirmation · source
“@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…”
@tlambert03 · 2025-02-14 · source
“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…”
@Czaki · 2025-02-14 · source
“Great to hear your are testing on the pre-releases. I'll investigate tomorrow.”
@Viicos · 2025-02-14 · source

Failure Signature (Search String)

  • m = MenuItem(command=a, when=None)

Error Message

Stack trace
error.txt
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

repro.py
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

When NOT to use: This fix should not be applied if the model does not implement both methods correctly.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be applied if the model does not implement both methods correctly.

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
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.