GoogleContainerTools/jib · error · CacheCorruptedException

Manifest(s) missing

Error message

Manifest(s) missing

What it means

verifyImageMetadata requires every ManifestAndConfigTemplate entry in the cached metadata to carry a non-null manifest. If the metadata cache contains entries but at least one has a null manifest, the cache is inconsistent and CacheCorruptedException('Manifest(s) missing') is thrown.

Source

Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/cache/CacheStorageReader.java:52

import java.nio.file.Path;
import java.security.DigestException;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/** Reads from the default cache storage engine. */
class CacheStorageReader {

  @VisibleForTesting
  static void verifyImageMetadata(ImageMetadataTemplate metadata, Path metadataCacheDirectory)
      throws CacheCorruptedException {
    List<ManifestAndConfigTemplate> manifestsAndConfigs = metadata.getManifestsAndConfigs();
    if (manifestsAndConfigs.isEmpty()) {
      throw new CacheCorruptedException(metadataCacheDirectory, "Manifest cache empty");
    }
    if (manifestsAndConfigs.stream().anyMatch(entry -> entry.getManifest() == null)) {
      throw new CacheCorruptedException(metadataCacheDirectory, "Manifest(s) missing");
    }
    if (metadata.getManifestList() == null && manifestsAndConfigs.size() != 1) {
      throw new CacheCorruptedException(metadataCacheDirectory, "Manifest list missing");
    }

    ManifestTemplate firstManifest = manifestsAndConfigs.get(0).getManifest();
    if (firstManifest instanceof V21ManifestTemplate) {
      if (metadata.getManifestList() != null
          || manifestsAndConfigs.stream().anyMatch(entry -> entry.getConfig() != null)) {
        throw new CacheCorruptedException(metadataCacheDirectory, "Schema 1 manifests corrupted");
      }
    } else if (firstManifest instanceof BuildableManifestTemplate) {
      if (manifestsAndConfigs.stream().anyMatch(entry -> entry.getConfig() == null)) {
        throw new CacheCorruptedException(metadataCacheDirectory, "Schema 2 manifests corrupted");
      }
      if (metadata.getManifestList() != null
          && manifestsAndConfigs.stream().anyMatch(entry -> entry.getManifestDigest() == null)) {
        throw new CacheCorruptedException(metadataCacheDirectory, "Schema 2 manifests corrupted");

View on GitHub (pinned to fb949e2676)

Solutions

  1. Delete the Jib cache directory and rebuild with network access to re-fetch manifests
  2. Rerun the build online (not -Djib.offline) so retrieveMetadata falls back to the registry when the cache is invalid
  3. Verify cache JSON files contain full manifest objects if hand-inspecting
  4. Keep Jib version consistent between machines sharing a cache

Example fix

// before
gradle jib --offline   // cached entry lacks manifest
// after
rm -rf ~/.cache/google-cloud-tools-jib
gradle jib   // online rebuild repairs the cache
Defensive patterns

Strategy: retry

Validate before calling

jq -e '[.manifestsAndConfigs[] | select(.manifest==null)] | length == 0' "$METADATA_FILE" || rm -rf "$IMG_CACHE_DIR"

Prevention

When it happens

Trigger: retrieveMetadata reads cached metadata where manifestsAndConfigs is non-empty but stream().anyMatch(entry -> entry.getManifest() == null) is true — entries exist yet their manifest payloads were not persisted or failed to deserialize.

Common situations: Partial cache writes from a killed build; cache files edited or pruned by external tools; deserialization issues after a Jib version changed the metadata template shape; shared cache volumes with inconsistent sync.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/dc1eb1157e3bbfec. Report an issue: GitHub.