{"record":{"id":"afb4bc7edcb1a0c5","repo":"vercel/next.js","slug":"failed-to-set-fetch-cache","errorCode":null,"errorMessage":"Failed to set fetch cache","messagePattern":"Failed to set fetch cache","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/lib/patch-fetch.ts","lineNumber":312,"sourceCode":"        body: bodyBuffer.toString('base64'),\n        status: cloned1.status,\n        url: cloned1.url,\n      }\n\n      serverComponentsHmrCache?.set(cacheKey, fetchedData)\n\n      if (incrementalCacheContext) {\n        await incrementalCache.set(\n          cacheKey,\n          { kind: CachedRouteKind.FETCH, data: fetchedData, revalidate },\n          incrementalCacheContext\n        )\n      }\n    })\n    .catch((error) => {\n      // Don't warn if the request was aborted intentionally.\n      if (!signal?.aborted) {\n        console.warn(`Failed to set fetch cache`, input, error)\n      }\n    })\n    .finally(handleUnlock)\n\n  const pendingRevalidateKey = `cache-set-${cacheKey}`\n  const pendingRevalidates = (workStore.pendingRevalidates ??= {})\n\n  let pendingRevalidatePromise = Promise.resolve()\n  if (pendingRevalidateKey in pendingRevalidates) {\n    // There is already a pending revalidate entry that we need to await to\n    // avoid race conditions.\n    pendingRevalidatePromise = pendingRevalidates[pendingRevalidateKey]\n  }\n\n  pendingRevalidates[pendingRevalidateKey] = pendingRevalidatePromise\n    .then(() => cacheSetPromise)\n    .finally(() => {\n      // If the pending revalidate is not present in the store, then we have","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/lib/patch-fetch.ts#L294-L330","documentation":"In patched fetch's cache-write path, the incrementalCache.set() call (storing the fetched response in the Data Cache) is chained with a .catch that logs this warning instead of throwing; it fires when writing the cache entry fails, and is suppressed when the request was aborted intentionally.","triggerScenarios":"Thrown at packages/next/src/server/lib/patch-fetch.ts:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the incremental cache backend for errors (disk, network, permissions); the fetch result was not persisted."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}