github/spec-kit · error · BundlerError

Downloaded content for bundle '{entry_id}' from {_source_des

Error message

Downloaded content for bundle '{entry_id}' from {_source_desc} is not valid YAML: {exc}

What it means

The downloaded payload was not recognized as a ZIP, so Spec Kit treated it as a bundle.yml document and PyYAML rejected its syntax. The original parser error is included and chained, and the source description identifies the catalog or resolved URL that supplied the bytes.

Source

Thrown at src/specify_cli/commands/bundle/__init__.py:1046

                        f"{_source_desc} is not a valid bundle: {exc}"
                    ) from exc
                # _local_manifest_source returns None only when the file does
                # not exist; since we just wrote *artifact* that cannot happen
                # here.  The explicit guard ensures callers never receive None
                # and silently degrade instead of raising a clear error.
                if manifest is None:
                    raise BundlerError(
                        f"Downloaded artifact for bundle '{entry_id}' from "
                        f"{_source_desc} is not a valid bundle."
                    )
                return manifest

        data = _yaml.safe_load(io.BytesIO(raw))
        return BundleManifest.from_dict(data)
    except BundlerError:
        raise
    except _yaml.YAMLError as exc:
        raise BundlerError(
            f"Downloaded content for bundle '{entry_id}' from {_source_desc} "
            f"is not valid YAML: {exc}"
        ) from exc
    except Exception as exc:  # noqa: BLE001
        raise BundlerError(
            f"Failed to parse downloaded bundle '{entry_id}' from "
            f"{_source_desc}: {exc}"
        ) from exc


def _validate_manifest_structure(manifest, *, source: str) -> None:
    """Reject a malformed manifest before any project mutation can occur."""
    from ...bundler.services.validator import validate_manifest

    report = validate_manifest(manifest)
    if report.ok:
        return
    raise BundlerError(

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. Open the exact URL from the message and copy its text into a YAML validator or editor with YAML syntax checking.
  2. Fix the reported parser position, usually indentation, quoting, or a stray tab.
  3. Confirm the server is sending the intended raw bundle.yml rather than HTML or a truncated response.
  4. Re-upload the corrected YAML and retry the bundle command.

Example fix

# bundle.yml (before)
bundle:
  id: demo
 version: 1.0.0

# bundle.yml (after)
bundle:
  id: demo
  version: 1.0.0
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
import yaml

def manifest_yaml_parses(path: Path) -> bool:
    try:
        yaml.safe_load(path.read_text(encoding="utf-8"))
        return True
    except yaml.YAMLError:
        return False

Try / catch

except BundlerError as exc:
    if "is not valid YAML" in str(exc):
        fetch_and_validate_yaml(url)
    else:
        raise

Prevention

When it happens

Trigger: `specify bundle info/install/update` downloads a non-ZIP artifact whose YAML is invalid — bad indentation, an unsupported construct, or a truncated response that still parses as text but is not valid YAML.

Common situations: A hand-written bundle.yml has inconsistent indentation, the server returns a partially rendered template or error text without a .zip URL, or an edit removed a quote/colon.

Related errors


AI-assisted analysis of github/spec-kit@bf88c9f9a8 (2026-08-14). Data as JSON: /api/errors/baaa35e18d132b67. Report an issue: GitHub.