{"record":{"id":"0af5de77038616fc","repo":"gatsbyjs/gatsby","slug":"accessing-your-contentful-space-failed-createco","errorCode":null,"errorMessage":"Accessing your Contentful space failed: ${createContentfulErrorMessage(e)}\n\nTry setting GATSBY_CONTENTFUL_OFFLINE=true to see if we can serve from cache.\n${details ? `\\n${details}\\n` : ``}\nUsed options:\n${formatPluginOptionsForCLI(pluginConfig.getOriginalPluginOptions(), errors)}","messagePattern":"Accessing your Contentful space failed: (.+?)\n\nTry setting GATSBY_CONTENTFUL_OFFLINE=true to see if we can serve from cache\\.\n(.+?)\\\\n` : ``\\}\nUsed options:\n(.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-contentful/src/fetch.js","lineNumber":216,"sourceCode":"        `host`\n      )} and ${chalk.yellow(`spaceId`)} settings are correct`\n      errors = {\n        host: `Check if setting is correct`,\n        spaceId: `Check if setting is correct`,\n      }\n    } else if (e.responseData.status === 401) {\n      // authorization error\n      details = `Authorization error. Check if ${chalk.yellow(\n        `accessToken`\n      )} and ${chalk.yellow(`environment`)} are correct`\n      errors = {\n        accessToken: `Check if setting is correct`,\n        environment: `Check if setting is correct`,\n      }\n    }\n  }\n\n  reporter.panic({\n    context: {\n      sourceMessage: `Accessing your Contentful space failed: ${createContentfulErrorMessage(\n        e\n      )}\n\nTry setting GATSBY_CONTENTFUL_OFFLINE=true to see if we can serve from cache.\n${details ? `\\n${details}\\n` : ``}\nUsed options:\n${formatPluginOptionsForCLI(pluginConfig.getOriginalPluginOptions(), errors)}`,\n    },\n  })\n}\n\n/**\n * Fetches:\n * * Locales with default locale\n * * Entries and assets\n * * Tags","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-source-contentful/src/fetch.js#L198-L234","documentation":"Error \"Accessing your Contentful space failed: ${createContentfulErrorMessage(e)}\n\nTry setting GATSBY_CONTENTFUL_OFFLINE=true to see if we can serve from cache.\n${details ? `\\n${details}\\n` : ``}\nUsed options:\n${formatPluginOptionsForCLI(pluginConfig.getOriginalPluginOptions(), errors)}\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby-source-contentful/src/fetch.js:216 when the library encounters an invalid state.","commonSituations":"Occurs when the initial Contentful space access request fails (wrong spaceId, accessToken, environment, or network). Double-check credentials in gatsby-config.js and the environment name; try GATSBY_CONTENTFUL_OFFLINE=true to build from cache.","solutions":["Double check the spaceId, accessToken, and environment options in gatsby-config.js match your Contentful space settings.","Verify the access token has permission to read the target environment.","Set GATSBY_CONTENTFUL_OFFLINE=true to serve from cache while debugging."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}