JuliusBrussee/caveman · error · CatalogError
: sources must be a non-empty list
Error message
{label}: sources must be a non-empty list What it means
Each row's 'sources' field must be a list containing at least one entry — these are the URLs documenting the provider's pricing/capabilities. An empty list, a non-list (string, null), or a missing value triggers this CatalogError.
Solutions
- Provide at least one source URL as a list, e.g. sources: ["https://example.com/pricing"]
- Wrap a single URL string into a list
- Remove the empty-list placeholder once a real documentation URL is available
Example fix
// before sources: [] // after sources: - https://docs.example.com/pricing
Defensive patterns
Strategy: validation
Validate before calling
srcs = row.get("sources")
assert isinstance(srcs, list) and len(srcs) > 0, "sources must be a non-empty list" Type guard
def has_sources(row):
srcs = row.get("sources")
return isinstance(srcs, list) and len(srcs) > 0 and all(isinstance(s, str) for s in srcs) Try / catch
try:
validate_catalog(rows)
except CatalogError as e:
if "sources must be a non-empty list" in str(e):
add_source_url(row)
raise Prevention
- Never commit rows with empty sources; use a TODO draft outside the catalog
- Wrap single URLs in a list on import
- Require sources in the catalog schema
When it happens
Trigger: sources: [] in the catalog row; sources set to a single string instead of a one-element list; the key omitted so it defaults to null.
Common situations: Adding a placeholder row before finding documentation URLs; YAML list syntax errors collapsing the list; deleting the only source during cleanup without replacing it.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- canonical span
- cave_agent_definition_invalid
- cave_context_ir_invalid
- cave_output_schema_mismatch
- cave_output_schema_mismatch
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/9e77dc792bad95dc.
Report an issue: GitHub.
Appendix: source
Thrown at shared/provider-catalog/validate_catalog.py:158
if required not in pricing:
raise CatalogError(f"{label}: pricing.{required} is required")
for field, value in pricing.items():
if value is None or field == "long_context_threshold_inclusive":
if field == "long_context_threshold_inclusive" and value is not None and not isinstance(value, bool):
raise CatalogError(f"{label}: pricing.{field} must be boolean or null")
continue
if isinstance(value, bool) or not isinstance(value, (int, float)):
raise CatalogError(f"{label}: pricing.{field} must be numeric or null")
if not math.isfinite(value) or value < 0:
raise CatalogError(f"{label}: pricing.{field} must be finite and nonnegative")
if field == "batch_discount_fraction" and value > 1:
raise CatalogError(f"{label}: pricing.batch_discount_fraction must be <= 1")
if not isinstance(row["capabilities"], dict):
raise CatalogError(f"{label}: capabilities must be an object")
sources = row["sources"]
if not isinstance(sources, list) or not sources:
raise CatalogError(f"{label}: sources must be a non-empty list")
if any(not isinstance(source, str) or not source.startswith("https://") for source in sources):
raise CatalogError(f"{label}: every source must be HTTPS")
verified_at = parsed_time(row["verified_at"], label)
if verified_at > now:
raise CatalogError(f"{label}: verified_at is in the future")
if verified_at < now - timedelta(days=120):
raise CatalogError(f"{label}: verified_at is older than 120 days")
return identity[0], identity[1], identity[2]
def check_review_markers(text: str, label: str) -> None:
"""Refuse a catalog that still carries an unreviewed sync proposal.
YAML comments are invisible to the parsed rows, so this reads the raw file:
a rubber-stamped merge must not be able to advance price provenance while
the line saying "nobody has confirmed this yet" is still in the file.
"""View on GitHub (pinned to 3ee70a1026)