Gatsby-source-wordpress-experimental: Feat: Add error message about self signed certs

Created on 15 Jul 2020  路  2Comments  路  Source: gatsbyjs/gatsby-source-wordpress-experimental

When using https with a self signed cert, Node will error out. The error message should include a note about turning this off for local development (NODE_TLS_REJECT_UNAUTHORIZED=0 gatsby develop).

Additionally, image downloads shouldn't be retried if they return this error.
RequestError: self signed certificate

This work will need to be done in src/steps/source-nodes/fetch-nodes/fetch-referenced-media-items.js somewhere below line 62.

info pushing https://gatsby.local/wp-content/uploads/2020/06/gesture-ranges.png to the end of the request queue.
info Previously retried 4 times already.
info
already re-queued https://gatsby.local/wp-content/uploads/2019/05/gatsby6.png 5 times :( sorry.
Try lowering process.env.GATSBY_CONCURRENT_DOWNLOAD.
It's currently set to 12
 ERROR 
failed to process https://gatsby.local/wp-content/uploads/2019/05/gatsby6.png
RequestError: self signed certificate
not finished source and transform nodes - 1937.489s
not finished Generating image thumbnails - 1930.883s
not finished  gatsby-source-wordpress  fetching nodes - 1879.031s - 528 total
not finished  gatsby-source-wordpress  creating nodes - 1863.170s
not finished  gatsby-source-wordpress  MediaItem - 1863.173s - fetched 143
not finished Downloading remote files - 17.005s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
good first issue help wanted todo after v4 release

Most helpful comment

Is this why on Local by Flywheel Gatsby throws this:

`gatsby-source-wordpress self signed certificate

GraphQL request to https://sitetherapy.local/graphql failed.

Please ensure the following statements are true

  • your WordPress URL is correct in gatsby-config.js
  • your server is responding to requests
  • WPGraphQL and WPGatsby are installed in your WordPress backend`

One of the issues with this is that Local defaults to SSL enabled sites and has no UI for disabling SSL. Altering the URL in gatsby-config.js to read http:// works, but it's non-obvious.

I'll look at the above code and see if I can help, too.

All 2 comments

Is this why on Local by Flywheel Gatsby throws this:

`gatsby-source-wordpress self signed certificate

GraphQL request to https://sitetherapy.local/graphql failed.

Please ensure the following statements are true

  • your WordPress URL is correct in gatsby-config.js
  • your server is responding to requests
  • WPGraphQL and WPGatsby are installed in your WordPress backend`

One of the issues with this is that Local defaults to SSL enabled sites and has no UI for disabling SSL. Altering the URL in gatsby-config.js to read http:// works, but it's non-obvious.

I'll look at the above code and see if I can help, too.

@rickgregory I'm not 100% sure but I would guess that is why. Help would be very appreciated :D

Was this page helpful?
0 / 5 - 0 ratings