gatsby: Proxy problems preventing access to Contentful space

Description

Hi, I followed the steps: https://www.gatsbyjs.org/docs/sourcing-from-contentful/ && https://www.gatsbyjs.org/packages/gatsby-source-contentful/ and kept facing issues with fetching data from Contentful

Plugin version: “gatsby-source-contentful”: “^2.3.16”,

Steps to reproduce

  {
      resolve: `gatsby-source-contentful`,
      options: {
        spaceId: `w1o2zojv27gs`,
        accessToken: `fjXk1QrVG7g7RkrFearmzuww1vzHddcAcJCld_cJtj0`, // OLD-KEY provided in example
      },
    },

Expected result

Succesful build

Actual result

Accessing your Contentful space failed.
Try setting GATSBY_CONTENTFUL_OFFLINE=true to see if we can serve from cache.

Used options:
spaceId: "*********7gs"
accessToken: "***************************************Jtj0"
host (default value): "cdn.contentful.com"
environment (default value): "master"
downloadLocal (default value): false
localeFilter (default value): [Function]
forceFullSync (default value): false
pageLimit (default value): 100
useNameForId (default value): true

not finished source and transform nodes - 0.732s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! the-fearless-group-app@0.1.0 dev: `gatsby develop`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the the-fearless-group-app@0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/s121003/.npm/_logs/2020-06-20T10_10_09_565Z-debug.log
s121003@MacBook-Pro TFG-app % 

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 27 (4 by maintainers)

Most upvoted comments

Same problem, but it only fails when using the preview access token and contentful host. CURL to contentful works just fine.

  1. Visit https://app.contentful.com/
  2. Switch to the master environment at the sidebar on left
  3. Select Settings (gear icon) menu item in the header
  4. Select API keys in dropdown menu
  5. Select your API_KEY in Content delivery/preview tokens tab
  6. Scroll to down and check your new environment https://prnt.sc/u9qpw5

Hey, I’m unfamiliar with “curl”, so what I’m going to do is look at that, and then try this project on a few other computers to see if it’s consistent.

I’ll report back later