{"record":{"id":"8a39c367fa80fe1c","repo":"crewAIInc/crewAI","slug":"no-content-could-be-loaded-from-repository-repo","errorCode":null,"errorMessage":"No content could be loaded from repository: {repo_url}","messagePattern":"No content could be loaded from repository: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py","lineNumber":101,"sourceCode":"                    if pr.body:\n                        body_preview = pr.body[:200].replace(\"\\n\", \" \")\n                        all_content.append(f\"  {body_preview}\")\n                all_content.append(\"\")\n\n        if \"issue\" in content_types:\n            issues = repo.get_issues(state=\"open\")\n            issue_list = [i for i in list(issues[:10]) if not i.pull_request][:5]\n            if issue_list:\n                all_content.append(\"Recent Issues:\")\n                for issue in issue_list:\n                    all_content.append(f\"- Issue #{issue.number}: {issue.title}\")\n                    if issue.body:\n                        body_preview = issue.body[:200].replace(\"\\n\", \" \")\n                        all_content.append(f\"  {body_preview}\")\n                all_content.append(\"\")\n\n        if not all_content:\n            raise ValueError(f\"No content could be loaded from repository: {repo_url}\")\n\n        content = \"\\n\".join(all_content)\n        return LoaderResult(\n            content=content,\n            metadata={\n                \"source\": repo_url,\n                \"repo\": repo_name,\n                \"content_types\": content_types,\n            },\n            doc_id=self.generate_doc_id(source_ref=repo_url, content=content),\n        )\n","sourceCodeStart":83,"sourceCodeEnd":113,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py#L83-L113","documentation":"Raised by GithubLoader.load() when, after fetching the repository, the all_content list is still empty — meaning no requested content type contributed anything. content_types comes from metadata (default ['code','repo']); if it is an empty list, or contains only unrecognized values, nothing is appended and the loader refuses to return an empty document.","triggerScenarios":"Passing metadata={'content_types': []}; passing content_types values not in the supported set (e.g. 'docs', 'wiki') so no branch runs; passing ['issues'] on a repo with no open issues (the issues branch only appends when issue_list is non-empty).","commonSituations":"Config-driven ingestion where an empty list means 'use defaults' to the author but 'load nothing' to the loader; typos in content type names ('Repo' vs 'repo'); users assuming arbitrary content types are supported.","solutions":["Use the supported content types exactly: 'code', 'repo', 'issues' — or omit content_types to get the default ['code','repo'].","Validate the list before loading: ct = [c for c in content_types if c in {'code','repo','issues'}] and fall back to defaults if empty.","If you only need repo metadata, pass {'content_types': ['repo']}."],"exampleFix":"# before\nresult = GithubLoader().load(src, metadata={'content_types': ['docs']})  # nothing loaded\n\n# after\nVALID = {'code', 'repo', 'issues'}\nct = [c for c in metadata.get('content_types', []) if c in VALID] or ['code', 'repo']\nresult = GithubLoader().load(src, metadata={'content_types': ct})","handlingStrategy":"validation","validationCode":"VALID_CONTENT_TYPES = {'code', 'repo', 'issues'}\\n\\ndef sanitize_content_types(ct: list[str] | None) -> list[str]:\\n    ct = [c for c in (ct or []) if c in VALID_CONTENT_TYPES]\\n    return ct or ['code', 'repo']","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whitelist content types against the supported set before loading.","Treat an empty list as 'use defaults', never pass it through.","Lowercase user input to avoid 'Repo' vs 'repo' mismatches."],"tags":["github","configuration","loader","rag"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}