withastro/astro · warning

[content] Could not read the chunked data store at ${fileURL

Error message

[content] Could not read the chunked data store at ${fileURLToPath(dirPath)}, rebuilding from scratch.

What it means

The content layer persists its data store on disk as chunks described by a manifest.json. Astro found the manifest but failed to read or parse it, or one of the referenced part files is missing — the chunked cache is corrupt. It warns with the underlying error and falls through to a fresh empty store so loaders rebuild it from source files; no source data is lost, the next build just re-syncs everything.

Source

Thrown at packages/astro/src/content/mutable-data-store.ts:630

				const manifest: DataStoreManifest = JSON.parse(manifestData);
				const collections = new Map<string, Map<string, any>>();
				for (const collectionName in manifest) {
					const parser = new ChunkedCollectionParser();
					for (const fileName of manifest[collectionName]) {
						// Parsing each part before reading the next prevents raw collection
						// contents from accumulating in memory during cache restoration.
						parser.add(await fs.readFile(new URL(`./${fileName}`, dirPath), 'utf-8'));
					}
					collections.set(collectionName, parser.finish());
				}
				const store = await MutableDataStore.fromMap(collections);
				store.#writer = new ChunkedWriter(dirPath, chunkSize);
				return store;
			} catch (err) {
				// The manifest exists but couldn't be read/parsed, or a referenced
				// part is missing: the chunked cache is corrupt. Warn loudly and fall
				// through to a fresh store so loaders rebuild it.
				console.warn(
					`[content] Could not read the chunked data store at ${fileURLToPath(dirPath)}, rebuilding from scratch.`,
					err,
				);
			}
		}
		// Fresh build, or recovering from a corrupt cache: start empty.
		await fs.mkdir(dirPath, { recursive: true });
		const store = new MutableDataStore();
		store.#writer = new ChunkedWriter(dirPath, chunkSize);
		return store;
	}
}

// This is the scoped store for a single collection. It's a subset of the MutableDataStore API, and is the only public type.
export interface DataStore {
	get: <TData extends Record<string, unknown> = Record<string, unknown>>(
		key: string,
	) => DataEntry<TData> | undefined;

View on GitHub (pinned to 157c500c38)

Solutions

  1. Treat it as benign — the store rebuilds automatically on the next build or dev-server start
  2. For a clean slate, delete the entire .astro directory and rebuild
  3. Avoid running multiple concurrent builds against the same project directory
Defensive patterns

Strategy: fallback

Validate before calling

// Health check for the chunked data-store cache before a build
import { existsSync, readFileSync } from 'node:fs';
function chunkedStoreIntact(dir: string): boolean {
  const manifest = `${dir}/manifest.json`; // DATA_STORE_MANIFEST_FILE
  if (!existsSync(manifest)) return true; // fresh build, nothing to restore
  try {
    const parts: string[][] = Object.values(JSON.parse(readFileSync(manifest, 'utf-8')));
    return parts.flat().every((p) => existsSync(`${dir}/${p}`));
  } catch {
    return false; // corrupt manifest
  }
}
if (!chunkedStoreIntact('.astro/data-store')) {
  console.warn('Chunked data store corrupt — Astro will rebuild it from source files automatically.');
}

Prevention

When it happens

Trigger: The .astro data-store directory is partially deleted or truncated (manifest present, some parts gone); an interrupted build left a half-written chunk; external tools (git clean, sync clients, antivirus) mutated .astro between runs.

Common situations: Manually deleting some (not all) files under .astro to 'refresh the cache'; two concurrent builds sharing one project directory; disk-full during a previous write.

Related errors


AI-assisted analysis of withastro/astro@157c500c38 (2026-08-18). Data as JSON: /api/errors/f504b5aff7494e8e. Report an issue: GitHub.