{"record":{"id":"61e3dea6b3428163","repo":"gatsbyjs/gatsby","slug":"the-sync-with-contentful-failed-using-pagelimit","errorCode":null,"errorMessage":"The sync with Contentful failed using pageLimit ${lastCurrentPageLimit} as the reponse size limit of the API is exceeded.\n\nRetrying sync with pageLimit of ${currentPageLimit}","messagePattern":"The sync with Contentful failed using pageLimit (.+?) as the reponse size limit of the API is exceeded\\.\n\nRetrying sync with pageLimit of (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-contentful/src/fetch.js","lineNumber":306,"sourceCode":"  try {\n    while (!syncSuccess) {\n      try {\n        const query = syncToken\n          ? { nextSyncToken: syncToken }\n          : { initial: true, limit: currentPageLimit }\n        currentSyncData = await syncClient.sync(query)\n        syncSuccess = true\n      } catch (e) {\n        // Back off page limit if responses content length exceeds Contentfuls limits.\n        if (\n          e.response?.data?.message.includes(`Response size too big`) &&\n          currentPageLimit > 1\n        ) {\n          lastCurrentPageLimit = currentPageLimit\n          // Reduce page limit by a arbitrary 1/3 of the current limit to ensure\n          // the new and bigger entries are synced without exceeding the reponse size limit\n          currentPageLimit = Math.floor((currentPageLimit / 3) * 2) || 1\n          reporter.warn(\n            [\n              `The sync with Contentful failed using pageLimit ${lastCurrentPageLimit} as the reponse size limit of the API is exceeded.`,\n              `Retrying sync with pageLimit of ${currentPageLimit}`,\n            ].join(`\\n\\n`)\n          )\n          continue\n        }\n        throw e\n      }\n      if (currentPageLimit !== pageLimit) {\n        reporter.warn(\n          `We recommend you to set your pageLimit in gatsby-config.js to ${currentPageLimit} to avoid failed synchronizations.`\n        )\n      }\n    }\n  } catch (e) {\n    reporter.panic({\n      id: CODES.SyncError,","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-source-contentful/src/fetch.js#L288-L324","documentation":"Error \"The sync with Contentful failed using pageLimit ${lastCurrentPageLimit} as the reponse size limit of the API is exceeded.\n\nRetrying sync with pageLimit of ${currentPageLimit}\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby-source-contentful/src/fetch.js:306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed: the sync automatically retries with a smaller pageLimit","Optionally configure a lower pageLimit in the plugin options to avoid oversized API responses"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}