1

my gatsby project suddenly stopped working after this error as it was working fine previously

ERROR #gatsby-source-wordpress_111002

gatsby-source-wordpress Error: Request failed with status code 429 at createError (D:\Projects\Project1\oclouds\node_modules\gatsby-source-wordpress\node_modules\axios\lib\core\createError.js:16:15) at settle (D:\Projects\Project1\oclouds\node_modules\gatsby-source-wordpress\node_modules\axios\lib\core\settle.js:17:12) at IncomingMessage.handleStreamEnd (D:\Projects\Project1\oclouds\node_modules\gatsby-source-wordpress\node_modules\axios\lib\adapters\http.js:269:11) at IncomingMessage.emit (events.js:412:35) at endReadableNT (internal/streams/readable.js:1317:12) at processTicksAndRejections (internal/process/task_queues.js:82:21)

Error occurred while fetching nodes of the "Post" type.`

i have tried all solution found online including decreasing the number in schema.requestConcurrency

here is my plugin code in gatsby-config.js

{
  resolve: `gatsby-source-wordpress`,
  options: {
    url: process.env.WPGRAPHQL_URL,
  },
  schema: {
    timeout: 1000000,
    perPage: 10,
    requestConcurrency: 5,
  },
},

3 Answers3

1

i have tried all solution found online including decreasing the number in schema.requestConcurrency

Your schema object is not properly set. You should do something like:

{
  resolve: `gatsby-source-wordpress`,
  options: {
    url: process.env.WPGRAPHQL_URL,
    schema: {
      timeout: 1000000,
      perPage: 10,
      requestConcurrency: 5,
    },
  },
}

schema is a property from options, as you can see in the docs.

I'm not sure if this will fix your issue since there are not many details but this certainly will fix your trial.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
1

If code is 429 then that means too many requests. Just increase the request limit in your graphql query.

Ashwani Panwar
  • 3,819
  • 3
  • 46
  • 66
0

A few things that could be causing this issue:

  1. Wrong URL. Ensure that the URL is in the following format:
    {
      resolve: `gatsby-source-wordpress`,
      options: {
        url: `https://myurl.com/graphql`,
      },
    },
  1. Self-signed certificate error when developing locally. To fix it, simply add the following code to the top of your gatsby-node.js file:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"

  1. Ensure you do have the WP Gatsby and WP Graphql plugins installed. Deactivate all the other plugins temporarily to make sure they're not causing an issue. In my case, for some reason the WPGraphQL WooCommerce (WooGraphQL) plugin was problematic.

Here is more information that may helpful:

Quick start guide for Gatsby + Wordpress

Fixing gatsby-wordpress-source error

Diego Fortes
  • 8,830
  • 3
  • 32
  • 42