crewAIInc/crewAI · warning · ValueError

No content could be loaded from repository: {repo_url}

Error message

No content could be loaded from repository: {repo_url}

What it means

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.

Source

Thrown at lib/crewai-tools/src/crewai_tools/rag/loaders/github_loader.py:101

                    if pr.body:
                        body_preview = pr.body[:200].replace("\n", " ")
                        all_content.append(f"  {body_preview}")
                all_content.append("")

        if "issue" in content_types:
            issues = repo.get_issues(state="open")
            issue_list = [i for i in list(issues[:10]) if not i.pull_request][:5]
            if issue_list:
                all_content.append("Recent Issues:")
                for issue in issue_list:
                    all_content.append(f"- Issue #{issue.number}: {issue.title}")
                    if issue.body:
                        body_preview = issue.body[:200].replace("\n", " ")
                        all_content.append(f"  {body_preview}")
                all_content.append("")

        if not all_content:
            raise ValueError(f"No content could be loaded from repository: {repo_url}")

        content = "\n".join(all_content)
        return LoaderResult(
            content=content,
            metadata={
                "source": repo_url,
                "repo": repo_name,
                "content_types": content_types,
            },
            doc_id=self.generate_doc_id(source_ref=repo_url, content=content),
        )

View on GitHub (pinned to 754d7323be)

Solutions

  1. Use the supported content types exactly: 'code', 'repo', 'issues' — or omit content_types to get the default ['code','repo'].
  2. 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.
  3. If you only need repo metadata, pass {'content_types': ['repo']}.

Example fix

# before
result = GithubLoader().load(src, metadata={'content_types': ['docs']})  # nothing loaded

# after
VALID = {'code', 'repo', 'issues'}
ct = [c for c in metadata.get('content_types', []) if c in VALID] or ['code', 'repo']
result = GithubLoader().load(src, metadata={'content_types': ct})
Defensive patterns

Strategy: validation

Validate before calling

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']

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/8a39c367fa80fe1c. Report an issue: GitHub.