HKUDS/DeepTutor · error · SystemExit

{exc}

Error message

{exc}

What it means

start() converts a ValueError from validate_runtime_home into SystemExit with the validator's message. It fires when the DeepTutor runtime home directory is invalid (e.g. wrong type, unreadable path, or a path failing the validator's checks).

Source

Thrown at deeptutor/runtime/launcher.py:941

        request_shutdown(signal_name)

    for sig_name in ("SIGINT", "SIGTERM", "SIGHUP", "SIGBREAK"):
        sig = getattr(signal, sig_name, None)
        if sig is None:
            continue
        try:
            signal.signal(sig, _handler)
        except (OSError, ValueError):
            continue


def start(home: str | Path | None = None, *, dev: bool = False) -> None:
    _relax_console_encoding()
    runtime_home = get_runtime_home(home)
    try:
        validate_runtime_home(runtime_home)
    except ValueError as exc:
        raise SystemExit(str(exc)) from exc
    runtime_home.mkdir(parents=True, exist_ok=True)
    os.environ[DEEPTUTOR_HOME_ENV] = str(runtime_home)
    _reset_runtime_singletons()

    from deeptutor.services.config import (
        HTTP_KEEP_ALIVE_TIMEOUT,
        ensure_runtime_settings_files,
        export_runtime_settings_to_env,
        get_ws_max_size,
        load_auth_settings,
        load_launch_settings,
    )
    from deeptutor.services.setup import init_user_directories

    init_user_directories(runtime_home)
    ensure_runtime_settings_files()
    settings = load_launch_settings(runtime_home)
    runtime_env = export_runtime_settings_to_env(overwrite=True)

View on GitHub (pinned to 3e82f13042)

Solutions

  1. Check the home path: ensure it is a directory path you can create/write (mkdir -p it manually to test)
  2. Point --home at a fresh empty directory to rule out corruption in the existing runtime home
  3. Inspect validate_runtime_home in deeptutor/services/config for the exact failing condition matching your message text
  4. Unset or fix a stale DEEPTUTOR_HOME environment variable

Example fix

# before
deeptutor start --home /etc/deeptutor/passwd  # invalid
# after
deeptutor start --home ~/.deeptutor
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
from deeptutor.services.config import validate_runtime_home
p = Path(home).expanduser().resolve()
if p.exists() and not p.is_dir():
    raise ValueError(f"{p} is a file, not a directory")
validate_runtime_home(p)  # raises ValueError before SystemExit

Try / catch

from deeptutor.runtime.launcher import start
from deeptutor.services.config import validate_runtime_home
try:
    start(home)
except SystemExit as e:
    logger.error("bad runtime home: %s", e.code)

Prevention

When it happens

Trigger: Calling deeptutor.runtime.launcher.start(home) (or `deeptutor start --home ...`) with a home path that validate_runtime_home rejects — such as a path that is not a directory candidate, contains invalid characters, or points to an existing non-directory file.

Common situations: Passing --home pointing at a file instead of a directory; a stale/corrupt runtime home from an older version; permission or filesystem-level problems at the chosen path; a bad DEEPTUTOR_HOME environment value.

Related errors


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/ba894909da0f21cd. Report an issue: GitHub.