{"record":{"id":"30aacb98cc679f5f","repo":"Comfy-Org/ComfyUI","slug":"path-is-not-within-input-output-temp-or-configu-30aacb","errorCode":null,"errorMessage":"Path is not within input, output, temp, or configured model bases: {path}","messagePattern":"Path is not within input, output, temp, or configured model bases: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"app/assets/services/path_utils.py","lineNumber":287,"sourceCode":"    model_types: list[str] = []\n    under_models_base = False\n    for folder_name, bases, extensions in get_comfy_models_folders():\n        for base in bases:\n            if fp_path.is_relative_to(os.path.abspath(base)):\n                under_models_base = True\n                # Empty set accepts any extension, matching\n                # folder_paths.filter_files_extensions semantics.\n                if not extensions or ext in extensions:\n                    model_types.append(folder_name)\n                break\n\n    if under_models_base:\n        _add(\"models\")\n    for folder_name in model_types:\n        _add(f\"model_type:{folder_name}\")\n\n    if not tags:\n        raise ValueError(\n            f\"Path is not within input, output, temp, or configured model bases: {path}\"\n        )\n    return tags\n\n\ndef get_known_subfolder_tags(subfolder: str | None) -> list[str]:\n    \"\"\"Return tags for known UI/input subfolder names.\"\"\"\n    if subfolder in _KNOWN_SUBFOLDER_TAGS:\n        return [subfolder]\n    return []\n\n\ndef get_known_input_subfolder_tags_from_path(path: str) -> list[str]:\n    \"\"\"Return known input-layout tags for files in canonical input subfolders.\n\n    These are compatibility tags for current UI-origin input directories such as\n    ``pasted`` and ``webcam``. They are intentionally narrow: only files directly\n    inside a known top-level input directory receive the matching tag.","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/app/assets/services/path_utils.py#L269-L305","documentation":"Raised by get_backend_system_tags_from_path when no trusted backend system tag can be derived from the path. That function emits 'models', 'model_type:<folder>', 'input', 'output', 'temp' based on which known root contains the file; if the path is under none of them, the tag set is empty and it refuses with this ValueError rather than returning untagged (and thus untrusted-classifiable) data.","triggerScenarios":"Passing a path outside every known root (e.g. '/tmp/other/file.png' outside the managed temp dir, or a user home path) to system-tag derivation — typically while building tags for an asset reference from a file location.","commonSituations":"Importing/indexing files from arbitrary disk locations; a moved or reconfigured models directory; temp files written to a directory other than the server-managed temp root; symlinks whose resolution escapes the base.","solutions":["Ensure the file physically resides under input/, output/, the managed temp dir, or a configured models folder before deriving system tags.","Re-align folder configuration with actual on-disk locations if files legitimately live elsewhere.","Pre-check containment with the same roots the server uses (or the classification API) before calling tag derivation."],"exampleFix":"# before\ntags = get_backend_system_tags_from_path('/var/data/model.safetensors')\n\n# after\nif not path_within_known_roots(p):\n    p = move_into_models_dir(p)\ntags = get_backend_system_tags_from_path(str(p))","handlingStrategy":"validation","validationCode":"known = collect_known_roots()  # input, output, temp, model bases\nif not within_any_root(path, known):\n    path = relocate_into_known_root(path)  # or reject before tagging","typeGuard":"def will_derive_system_tags(path: str, roots) -> bool:\n    return within_any_root(path, roots)","tryCatchPattern":"try:\n    tags = get_backend_system_tags_from_path(path)\nexcept ValueError:\n    tags = []  # caller decides: move the file or skip","preventionTips":["Place files under managed roots before deriving system tags","Validate paths against the server's root list, not assumptions","Watch for symlinked model dirs after config changes"],"tags":["tags","path","classification","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}