HKUDS/DeepTutor · error · ValueError

Folder does not exist: {folder}

Error message

Folder does not exist: {folder}

What it means

Raised by assert_path_allowed when the path given to link a folder (e.g. an Obsidian vault) into a knowledge base does not exist on disk after expanduser(). It is the first guard in the linked-folder validation chain (exists → is directory → within allowlist).

Source

Thrown at deeptutor/services/rag/linked_kb.py:102

            continue
        try:
            roots.append(Path(chunk).expanduser().resolve())
        except OSError:
            continue
    return roots


def assert_path_allowed(folder_path: str) -> Path:
    """Resolve ``folder_path`` and enforce the optional root allowlist.

    Returns the resolved absolute path. Raises ``ValueError`` if the folder is
    missing/not a directory, or escapes the configured allowlist (symlinks are
    resolved first so they can't tunnel out). With no allowlist set, any
    existing directory is permitted — the self-hosted default.
    """
    folder = Path(folder_path).expanduser()
    if not folder.exists():
        raise ValueError(f"Folder does not exist: {folder}")
    if not folder.is_dir():
        raise ValueError(f"Not a directory: {folder}")
    resolved = folder.resolve()

    roots = allowed_link_roots()
    if roots and not any(_is_within(resolved, root) for root in roots):
        raise ValueError("This folder is outside the locations allowed for linking.")
    return resolved


def _is_within(path: Path, root: Path) -> bool:
    try:
        return path == root or root in path.parents
    except OSError:
        return False


def probe_linked_folder(folder_path: str, provider: str) -> ProbeResult:

View on GitHub (pinned to 3e82f13042)

Solutions

  1. Verify the path exists and is spelled correctly (ls the exact expanded path).
  2. Use an absolute path including ~ expansion, e.g. /home/user/Vault rather than ~/Vault if the shell isn't expanding it.
  3. If running in Docker/WSL, confirm the folder is mounted into the container.
  4. Reconnect via the linked-folder UI so the picker supplies a validated absolute path.

Example fix

# before
await connect_obsidian_vault(session, kb_id, "~/Notes/vualt")  # typo
# after
await connect_obsidian_vault(session, kb_id, str(Path("~/Notes/vault").expanduser()))
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
p = Path(folder_path).expanduser()
if not p.exists():
    raise InputError(f"folder missing: {p}")

Prevention

When it happens

Trigger: Calling connect_obsidian_vault, probe_linked_folder_route, connect_linked_folder_route, or create_connection with a typo'd or nonexistent folder path; passing a relative path that doesn't resolve from the process CWD; the folder living on an unmounted drive.

Common situations: Typos in vault paths, ~ not expanded correctly, moving/renaming a vault after saving its path, running the server in a container where the host path isn't mounted.

Related errors


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