{"record":{"id":"19d1412f8aec9c2d","repo":"gatsbyjs/gatsby","slug":"error-fetching-tags-createcontentfulerrormessag","errorCode":null,"errorMessage":"Error fetching tags: ${createContentfulErrorMessage(e)}","messagePattern":"Error fetching tags: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-contentful/src/fetch.js","lineNumber":354,"sourceCode":"      !currentSyncData?.deletedEntries.length &&\n      !currentSyncData?.deletedAssets.length\n    ) {\n      syncProgress.tick()\n      syncProgress.total = 1\n    }\n\n    syncProgress.done()\n  }\n\n  // We need to fetch tags with the non-sync API as the sync API doesn't support this.\n  let tagItems = []\n  if (pluginConfig.get(`enableTags`)) {\n    try {\n      const tagsResult = await pagedGet(client, `getTags`, pageLimit)\n      tagItems = tagsResult.items\n      reporter.verbose(`Tags fetched ${tagItems.length}`)\n    } catch (e) {\n      reporter.panic({\n        id: CODES.FetchTags,\n        context: {\n          sourceMessage: `Error fetching tags: ${createContentfulErrorMessage(\n            e\n          )}`,\n        },\n      })\n    }\n  }\n\n  const result = {\n    currentSyncData,\n    tagItems,\n    defaultLocale,\n    locales,\n    space,\n  }\n","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-source-contentful/src/fetch.js#L336-L372","documentation":"In fetchContent, when enableTags is set, fetching tags via the non-sync paged API threw. The catch converts it to a structured reporter.panic with the FetchTags error code; the raw SDK error is embedded via createContentfulErrorMessage.","triggerScenarios":"Thrown at packages/gatsby-source-contentful/src/fetch.js:354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify API credentials can read tags","Retry the build (transient Contentful API failures)","Disable enableTags if tags are not needed"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T05:17:10.506Z"}