{"record":{"id":"d3b12c7adf8ef240","repo":"invoke-ai/InvokeAI","slug":"no-files-associated-with-source","errorCode":null,"errorMessage":"No files associated with {source}","messagePattern":"No files associated with (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/model_install/model_install_default.py","lineNumber":870,"sourceCode":"                    subfolders=subfolders if len(subfolders) > 1 else None,\n                    session=self._session,\n                ),\n                metadata,\n            )\n\n        if isinstance(source, URLModelSource):\n            try:\n                fetcher = self.get_fetcher_from_url(str(source.url))\n                kwargs: dict[str, Any] = {\"session\": self._session}\n                metadata = fetcher(**kwargs).from_url(source.url)\n                assert isinstance(metadata, ModelMetadataWithFiles)\n                return metadata.download_urls(session=self._session), metadata\n            except ValueError:\n                pass\n\n            return [RemoteModelFile(url=self._normalize_huggingface_blob_url(source.url), path=Path(\".\"), size=0)], None\n\n        raise Exception(f\"No files associated with {source}\")\n\n    def _guess_source(self, source: str) -> ModelSource:\n        \"\"\"Turn a source string into a ModelSource object.\"\"\"\n        variants = \"|\".join(ModelRepoVariant.__members__.values())\n        hf_repoid_re = f\"^([^/:]+/[^/:]+)(?::({variants})?(?::/?([^:]+))?)?$\"\n        source_obj: Optional[StringLikeSource] = None\n        source_stripped = source.strip('\"')\n\n        if source_stripped.startswith(\"external://\"):\n            external_id = source_stripped.removeprefix(\"external://\")\n            provider_id, _, provider_model_id = external_id.partition(\"/\")\n            if not provider_id or not provider_model_id:\n                raise ValueError(f\"Invalid external model source: '{source_stripped}'\")\n            source_obj = ExternalModelSource(provider_id=provider_id, provider_model_id=provider_model_id)\n        elif Path(source_stripped).exists():  # A local file or directory\n            source_obj = LocalModelSource(path=Path(source_stripped))\n        elif match := re.match(hf_repoid_re, source):\n            source_obj = HFModelSource(","sourceCodeStart":852,"sourceCodeEnd":888,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/model_install/model_install_default.py#L852-L888","documentation":"_remote_files_from_source() resolves the downloadable files for a model source (HF repo or URL). If it cannot determine any remote files for the source — no metadata, no download URLs, no usable URL fallback — it raises a generic Exception('No files associated with {source}').","triggerScenarios":"Passing a HFModelSource/URLModelSource whose metadata yields an empty download_urls list; a repo with no model weights matching the variant/subfolder filters; a URL source that reaches the final fallback branch without usable metadata or url; custom ModelSource subclasses unsupported by the method.","commonSituations":"HuggingFace repo contains only metadata/code, no weight files; incorrect variant or subfolder filters exclude all files; deleted/renamed repo returning sparse metadata; pointing at an HTML page URL instead of a file.","solutions":["Verify the source repo/URL actually contains downloadable weight files in a browser or via the HF API.","Remove/adjust variant, subfolder, or path filters on HFModelSource so files match.","Re-fetch metadata — a stale/mis-serialized metadata record may have empty download_urls; clear cached metadata for the repo.","Use a direct file URL (URLModelSource to the exact file) instead of a repo-level source."],"exampleFix":"// before\nservice.download_and_cache_model(HFModelSource(repo_id='author/repo', variant='wrong-variant'))\n// after\nservice.download_and_cache_model(HFModelSource(repo_id='author/repo'))  # drop filters or point at a repo with weights","handlingStrategy":"validation","validationCode":"# verify the source has files before requesting install\nimport requests\nr = requests.get(f'https://huggingface.co/api/models/{repo_id}', timeout=10)\nhas_files = bool(r.json().get('siblings'))","typeGuard":"def is_installable_source(source) -> bool:\n    return isinstance(source, (HFModelSource, URLModelSource)) and bool(getattr(source, 'url', None) or getattr(source, 'repo_id', None))","tryCatchPattern":"try:\n    files = service._remote_files_from_source(source)\nexcept Exception:\n    files = []\nif not files:\n    raise RuntimeError(f'Source {source} has no downloadable files; check repo/URL')","preventionTips":["Check the repo in a browser/HF API to confirm weight files exist before installing.","Don't over-restrict variant/subfolder filters on HFModelSource.","Point URLModelSource at a direct file URL, not an HTML page.","Clear stale cached metadata for repos that changed upstream."],"tags":["download","huggingface","model-source"],"backgroundTag":"no-downloadable-files-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}