bug: nonexistent config path dumps raw FileNotFoundError traceback

Open Beginner friendly
#1,488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
cli

Research direction

Start in nemo_gym/global_config.py at load_extra_config_paths() around line 206, then trace the CLI entrypoint used by ng_run. Reproduce the problem with the provided ng_run command and verify that a nonexistent path reports the resolved path and resolution context without a traceback. Done means missing config paths fail fast with a concise actionable message.

Written by the indexing model from the issue text.

Description

CLI Config usability

Summary

Found by our virtual developer review agent.

When a user passes a typo'd or nonexistent path in +config_paths, NeMo Gym raises a bare FileNotFoundError with a full traceback instead of a clear, actionable error message.

Location

nemo_gym/global_config.pyload_extra_config_paths() (~line 206)

extra_config = OmegaConf.load(config_path)

The function resolves relative paths against cwd and PARENT_DIR, but never checks that the resolved path exists before calling OmegaConf.load().

Current behavior

A routine user error (typo in config path) produces a 7-frame traceback:

FileNotFoundError: [Errno 2] No such file or directory:
'.../resources_servers/does_not_exist/configs/nope.yaml'

The absolute path is present but buried in the traceback, and there is no guidance on how to fix it.

Expected behavior

A missing config path should fail fast with a concise, user-facing message (no traceback) that includes the resolved path and where it was checked.

Suggested fix

Guard the OmegaConf.load() call with a path-existence check and raise a clean SystemExit with the resolved path and resolution context (cwd vs install root). Catch this in the CLI entrypoint so a traceback is not printed.

Example:

if not config_path.exists():
    raise SystemExit(
        f"Config file not found: {config_path}\n"
        f"Checked relative to cwd ({Path.cwd()}) and install root ({PARENT_DIR})."
    )
extra_config = OmegaConf.load(config_path)

Repro

ng_run "+config_paths=[resources_servers/does_not_exist/configs/nope.yaml]"
Dominant language
Python
Stars
1.2k
Forks
349
Avg merge
2d 40m
Merged PRs (30d)
320

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA-NeMo/Gym

All issues in NVIDIA-NeMo/Gym

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.