# pydantic.errors.PydanticUserError: `model_config` cannot be used as a model field name. Use `model_config` for model configuration.

- **ID:** `python/pydantic-config-error-json-schema-extra`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A v2 model defines an attribute literally named `model_config` (often ported from v1 code where the field was user-defined), which Pydantic reserves for configuration.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Rename the field and add an alias: `class M(BaseModel):
    model_config = ConfigDict(populate_by_name=True)
    cfg: dict = Field(alias='model_config')`
   ```
2. **** (90% success)
   ```
   Use `Field(alias='model_config')` and read via `obj.cfg`; update all callers to use the new attribute name.
   ```

## Dead Ends

- **** — Renaming only in the class but not in callers leaves `AttributeError` at runtime when code reads `obj.model_config`. (60% fail)
- **** — Adding `class Config` alongside `model_config` triggers a second PydanticUserError about mixing v1 and v2 config styles. (90% fail)
