{"record":{"id":"ba894909da0f21cd","repo":"HKUDS/DeepTutor","slug":"exc-ba8949","errorCode":null,"errorMessage":"{exc}","messagePattern":"\\{exc\\}","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"deeptutor/runtime/launcher.py","lineNumber":941,"sourceCode":"        request_shutdown(signal_name)\n\n    for sig_name in (\"SIGINT\", \"SIGTERM\", \"SIGHUP\", \"SIGBREAK\"):\n        sig = getattr(signal, sig_name, None)\n        if sig is None:\n            continue\n        try:\n            signal.signal(sig, _handler)\n        except (OSError, ValueError):\n            continue\n\n\ndef start(home: str | Path | None = None, *, dev: bool = False) -> None:\n    _relax_console_encoding()\n    runtime_home = get_runtime_home(home)\n    try:\n        validate_runtime_home(runtime_home)\n    except ValueError as exc:\n        raise SystemExit(str(exc)) from exc\n    runtime_home.mkdir(parents=True, exist_ok=True)\n    os.environ[DEEPTUTOR_HOME_ENV] = str(runtime_home)\n    _reset_runtime_singletons()\n\n    from deeptutor.services.config import (\n        HTTP_KEEP_ALIVE_TIMEOUT,\n        ensure_runtime_settings_files,\n        export_runtime_settings_to_env,\n        get_ws_max_size,\n        load_auth_settings,\n        load_launch_settings,\n    )\n    from deeptutor.services.setup import init_user_directories\n\n    init_user_directories(runtime_home)\n    ensure_runtime_settings_files()\n    settings = load_launch_settings(runtime_home)\n    runtime_env = export_runtime_settings_to_env(overwrite=True)","sourceCodeStart":923,"sourceCodeEnd":959,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/runtime/launcher.py#L923-L959","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the home path: ensure it is a directory path you can create/write (mkdir -p it manually to test)","Point --home at a fresh empty directory to rule out corruption in the existing runtime home","Inspect validate_runtime_home in deeptutor/services/config for the exact failing condition matching your message text","Unset or fix a stale DEEPTUTOR_HOME environment variable"],"exampleFix":"# before\ndeeptutor start --home /etc/deeptutor/passwd  # invalid\n# after\ndeeptutor start --home ~/.deeptutor","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom deeptutor.services.config import validate_runtime_home\np = Path(home).expanduser().resolve()\nif p.exists() and not p.is_dir():\n    raise ValueError(f\"{p} is a file, not a directory\")\nvalidate_runtime_home(p)  # raises ValueError before SystemExit","typeGuard":null,"tryCatchPattern":"from deeptutor.runtime.launcher import start\nfrom deeptutor.services.config import validate_runtime_home\ntry:\n    start(home)\nexcept SystemExit as e:\n    logger.error(\"bad runtime home: %s\", e.code)","preventionTips":["Pre-validate home with validate_runtime_home and catch ValueError","Ensure the home path's parent exists and is writable","Keep DEEPTUTOR_HOME pointing at a dedicated directory"],"tags":["runtime-home","path-validation","startup","configuration"],"backgroundTag":"invalid-configuration-path","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}