dotnet/runtime · error · NotImplementedError

{coreclr_args.mode}

Error message

{coreclr_args.mode}

What it means

Raised by main() in jitrollingbuild.py as `raise NotImplementedError(coreclr_args.mode)` when coreclr_args.mode is not one of 'upload', 'download', or 'list'. The mode comes from the argparse subparser dest='mode'; an unrecognized or unset mode reaches the else branch.

Solutions

  1. Use one of the supported subcommands: upload, download, or list (e.g. `jitrollingbuild.py list`).
  2. Run `jitrollingbuild.py -h` to see the valid subcommands.
  3. If scripting against main(), ensure args.mode is set to a valid value before calling.

Example fix

// before
python jitrollingbuild.py downlodd   # typo -> NotImplementedError
// after
python jitrollingbuild.py download -git_hash abc
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_MODES = {"upload", "download", "list"}
if coreclr_args.mode not in SUPPORTED_MODES:
    raise SystemExit(f"Unsupported mode {coreclr_args.mode!r}; choose from {sorted(SUPPORTED_MODES)}")

Type guard

def is_known_mode(m: str) -> bool:
    return m in {"upload", "download", "list"}

Prevention

When it happens

Trigger: Invoking the script with a subcommand name that is not upload/download/list, or calling main() programmatically with an args object whose mode attribute is None or an unsupported string.

Common situations: Typo in the subcommand; invoking the script with no subcommand on argparse versions that do not enforce required subparsers; programmatic misuse of setup_args/main.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/5aa0c2afcfc4d740. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/scripts/jitrollingbuild.py:720

    logger.setLevel(logging.INFO)

    if sys.version_info.major < 3:
        logging.error("Please install python 3 or greater")
        return 1

    coreclr_args = setup_args(args)

    if coreclr_args.mode == "upload":
        upload_command(coreclr_args)

    elif coreclr_args.mode == "download":
        download_command(coreclr_args)

    elif coreclr_args.mode == "list":
        list_command(coreclr_args)

    else:
        raise NotImplementedError(coreclr_args.mode)

    # Note that if there is any failure, an exception is raised and the process exit code is then `1`
    return 0

################################################################################
# __main__
################################################################################


if __name__ == "__main__":
    args = parser.parse_args()
    sys.exit(main(args))

View on GitHub (pinned to 60108ba66e)