dotnet/efcore · error · Exception

Could not find checksum for {path} in Release file.

Error message

Could not find checksum for {path} in Release file.

What it means

Raised by parse_release_file when scanning the Release file checksum lines (regex `^ (\S*) +(\S*) +(\S*)$`) and finding no entry whose path equals the requested path AND whose first column is 64 chars (i.e. a SHA256). It means the Release file as fetched does not advertise a checksum for the Packages.gz path being verified.

Source

Thrown at eng/common/cross/install-debs.py:154

        print("Signature verified successfully.")

        with open(release_file.name) as f:
            return f.read()

def parse_release_file(content, path):
    """Parses the Release file and returns sha256 checksum of the specified path."""

    # data looks like this:
    # <checksum>  <size>  <path>
    matches = re.findall(r'^ (\S*) +(\S*) +(\S*)$', content, re.MULTILINE)

    for entry in matches:
        # the file has both md5 and sha256 checksums, we want sha256 which has a length of 64
        if entry[2] == path and len(entry[0]) == 64:
            return entry[0]

    raise Exception(f"Could not find checksum for {path} in Release file.")

def parse_debian_version(version):
    """Parse a Debian package version into epoch, upstream version, and revision."""
    match = re.match(r'^(?:(\d+):)?([^-]+)(?:-(.+))?$', version)
    if not match:
        raise ValueError(f"Invalid Debian version format: {version}")
    epoch, upstream, revision = match.groups()
    return int(epoch) if epoch else 0, upstream, revision or ""

def compare_upstream_version(v1, v2):
    """Compare upstream or revision parts using Debian rules."""
    def tokenize(version):
        tokens = re.split(r'([0-9]+|[A-Za-z]+)', version)
        return [int(x) if x.isdigit() else x for x in tokens if x]

    tokens1 = tokenize(v1)
    tokens2 = tokenize(v2)

View on GitHub (pinned to dbf9771522)

Solutions

  1. Fetch the Release file by hand (`curl <mirror>/dists/<suite>/Release`) and grep it for the path shown in {path} - confirm whether the component/arch/filename actually exist.
  2. Correct --arch to match the suite's published architectures, and drop suites/components that the distro does not publish.
  3. Use the right mirror variant (debian vs debian-ports) for the architecture.
  4. Ensure the Release file downloaded fully (re-run; a truncated Release also triggers this).
Defensive patterns

Strategy: validation

Validate before calling

# Pre-check that the Release file lists the path you intend to fetch
import re, aiohttp, asyncio

async def release_has_path(mirror, suite, path):
    async with aiohttp.ClientSession() as s:
        async with s.get(f"{mirror}/dists/{suite}/Release") as r:
            r.raise_for_status()
            content = await r.text()
    matches = re.findall(r'^ (\S*) +(\S*) +(\S*)$', content, re.MULTILINE)
    found = any(m[2] == path and len(m[0]) == 64 for m in matches)
    if not found:
        raise RuntimeError(f"Release for {suite} has no sha256 for {path}; check arch/component/suite")
    return True

asyncio.run(release_has_path(mirror, suite, f"main/binary-{arch}/Packages.gz"))

Try / catch

try:
    content = await download_package_index_parallel(mirror, arch, suites, check_sig=True, keyring=keyring)
except Exception as e:
    if "Could not find checksum for" in str(e):
        # the path isn't published - stop probing other components and fix the args
        raise SystemExit(f"Suite {suites} does not publish the requested arch/component. {e}")
    raise

Prevention

When it happens

Trigger: parse_release_file(content, path) is called with a path like 'main/binary-<arch>/Packages.gz' that does not appear in the Release file's checksum section - e.g. the component or architecture in the path is not published in that suite, or the suite's Release file uses a different filename (Packages.xz vs Packages.gz).

Common situations: --arch value not published by the suite (e.g. an arch only in ports but Release fetched from main debian); --suite that has no 'universe' component (Debian) but code requests both main and universe; mirror mixes suites incorrectly; Release file truncated so the matching line is missing.

Related errors


AI-assisted analysis of dotnet/efcore@dbf9771522 (2026-08-06). Data as JSON: /api/errors/82efd039d5052a9a. Report an issue: GitHub.