Skip to content

[VDR][v0.6.0] ERR-f5cffc34 · Server-config validation errors escape main() as a raw doubled pydantic traceback #2686

Description

@anwithk

Severity: 🟠 high | Category: Error Handling | Finding ID: ERR-f5cffc34

Location: nemo_gym/cli/main.py:949

Problem

New. _handle_pydantic_validation_error only formats a ValidationError whose exc.title names a BaseNeMoGymCLIConfig subclass; anything else hits a bare raise at line 949, which chains a second traceback onto the first. Overriding ++head_server.port=11577 replaces the whole head_server block and drops the defaulted host; gym env resolve accepts this and exits 0, then gym env start spins up a Ray cluster, tears it down, and dies with ~40 lines ending in ValidationError: 1 validation error for BaseServerConfig / host / Field required. Nothing says the override dropped a sibling key or that ++head_server.host must be given too.

Suggested fix

Format every ValidationError through the same helper (fall back to the missing/invalid summary for non-CLI models) rather than re-raising, and validate BaseServerConfig before Ray/server spin-up. For partial overrides of a defaulted block, merge the defaults rather than replacing the block, or name the dropped keys in the error.

Evidence

pydantic_core._pydantic_core.ValidationError: 1 validation error for BaseServerConfig / host / Field required [type=missing, input_value={'port': 11577}, input_type=DictConfig]

Found by the error-quality-auditor critic in DX review Gym-1-20260821203248 — incremental from v0.5.0 to fa0d25158. Parent tracker #2214.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions