{"record":{"id":"b6199cba26e06654","repo":"Comfy-Org/ComfyUI","slug":"path-is-not-within-input-output-temp-or-configu","errorCode":null,"errorMessage":"Path is not within input, output, temp, or configured model bases: {file_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":234,"sourceCode":"        # accepts any extension), so a bucket that cannot load the file\n        # must not contribute a loader path.\n        if extensions and ext not in extensions:\n            continue\n        for b in bases:\n            base_abs = os.path.abspath(b)\n            if not _check_is_within(fp_abs, base_abs):\n                continue\n            cand = (len(base_abs), bucket, _compute_relative(fp_abs, base_abs))\n            if best is None or cand[0] > best[0]:\n                best = cand\n\n    if best is not None:\n        _, bucket, rel_inside = best\n        combined = os.path.join(bucket, rel_inside)\n        normalized = os.path.relpath(os.path.join(os.sep, combined), os.sep)\n        return \"models\", normalized.replace(os.sep, \"/\")\n\n    raise ValueError(\n        f\"Path is not within input, output, temp, or configured model bases: {file_path}\"\n    )\n\n\ndef get_backend_system_tags_from_path(path: str) -> list[str]:\n    \"\"\"Return trusted backend tags derived from current filesystem facts.\n\n    The returned tags are only the backend-generated system tags: ``models``,\n    ``model_type:<folder_name>``, ``input``, ``output``, and ``temp``. Model\n    type tags are based on registered folder names, not path components.\n\n    A ``model_type:<folder_name>`` tag is only emitted when the file's\n    extension is accepted by that folder's registered extension set, so\n    categories sharing a base directory tag only the files they can\n    actually load. Files under a model base whose extension matches no\n    category still get the ``models`` tag.\n    \"\"\"\n    fp_abs = os.path.abspath(path)","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/app/assets/services/path_utils.py#L216-L252","documentation":"Raised by the path-classification helper (used when converting a filesystem path into an asset reference/bucket+relative-path pair) when the given path is not located under any known root: the input directory, output directory, temp directory, or any configured models base. The function walks candidate bases and keeps the longest matching prefix; if none contain the path, it cannot produce a bucket classification and raises ValueError.","triggerScenarios":"Calling path-classification with an arbitrary absolute path like '/etc/passwd', '/home/user/somefile.safetensors', or a models file whose folder is registered but whose base path resolves differently (e.g. via symlink); also relative paths that abspath to outside all bases.","commonSituations":"Registering/importing existing files by path where the user-supplied path points outside ComfyUI's directory tree; symlinks inside models making the realpath land outside the configured base; case or trailing-slash differences in configured bases; stale folder configuration after directories moved.","solutions":["Only classify paths that live under input/, output/, temp/, or a registered models folder — copy or move the file into one first.","Fix folder configuration (extra_model_paths.yaml) so the configured bases match where the files actually reside, then retry.","Check for symlinks: resolve them so the physical location is inside a base, or update the base to point at the physical directory."],"exampleFix":"# before\nclassify('/home/user/downloads/model.safetensors')  # raises\n\n# after\nimport shutil\nshutil.copy(src, models_checkpoints_dir)\nclassify(str(models_checkpoints_dir / 'model.safetensors'))","handlingStrategy":"validation","validationCode":"# Check containment against the same roots before classifying\ndef within_any_root(p: str, roots: list[str]) -> bool:\n    pa = Path(os.path.abspath(p)).resolve()\n    return any(pa.is_relative_to(Path(os.path.abspath(r)).resolve()) for r in roots)","typeGuard":"def is_classifiable_path(p: str, roots) -> bool:\n    return within_any_root(p, roots)","tryCatchPattern":"try:\n    bucket, rel = classify_path(file_path)\nexcept ValueError:\n    skip_or_move(file_path)  # not an asset location; don't index","preventionTips":["Only feed paths from input/output/temp/models trees to classification","Resolve symlinks before comparing against configured bases","Keep folder configuration in sync with where files actually live","Skip and log unclassifiable paths during bulk imports instead of aborting"],"tags":["path","classification","configuration","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}