pasdo501 / gatsby-source-woocommerce

Gatsy Source Plugin for WooCommerce
34 stars 14 forks source link

openssl Error #33

Closed instantwpuserwin closed 3 years ago

instantwpuserwin commented 3 years ago

Hello

Thanks for the plugin.

Issue: My site has https enabled and it uses Lets encrypt.

gatsby-source-wordpress works well.

Bu for gatsby-source-woocommerce, I get error: ========== WARNING FOR FIELD products/categories =========== The following error status was produced: Error: write EPROTO 140013650892672:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

        ================== END WARNING ==================

Console:

$ gatsby develop success open and validate gatsby-configs - 0.053s success load plugins - 0.631s success onPreInit - 0.041s info One or more of your plugins have changed since the last time you ran Gatsby. As a precaution, we're deleting your site's cache to ensure there's no stale data. success initialize cache - 0.134s success copy gatsby files - 0.060s success onPreBootstrap - 0.022s success gatsby-source-wordpress ensuring plugin requirements are met - 8.385s ⠀ info gatsby-source-wordpress

    This is either your first build or the cache was cleared.
    Please wait while your WordPress data is synced to your Gatsby cache.

    Maybe now's a good time to get up and stretch? :D

success gatsby-source-wordpress ingest WPGraphQL schema - 6.135s success createSchemaCustomization - 14.569s success gatsby-source-wordpress Category - 8.777s - fetched 5 success gatsby-source-wordpress ContentType - 16.103s - fetched 3 success gatsby-source-wordpress PostFormat - 16.393s - fetched 0 success gatsby-source-wordpress Comment - 18.627s - fetched 0 success gatsby-source-wordpress fetch root fields - 19.908s success gatsby-source-wordpress Tag - 20.155s - fetched 2 success gatsby-source-wordpress UserRole - 20.145s - fetched 0 success gatsby-source-wordpress User - 20.241s - fetched 2 success gatsby-source-wordpress MenuItem - 20.398s - fetched 6 success gatsby-source-wordpress Taxonomy - 20.362s - fetched 3 success gatsby-source-wordpress Menu - 20.693s - fetched 1 success gatsby-source-wordpress Post - 21.394s - fetched 6 success gatsby-source-wordpress Page - 22.796s - fetched 11 success gatsby-source-wordpress MediaItem - 10.602s - fetched 27 success gatsby-source-wordpress creating nodes - 10.614s success gatsby-source-wordpress fetching nodes - 33.448s - 66 total success Downloading remote files - 6.799s - 27/27 3.97/s warn ========== WARNING FOR FIELD products =========== The following error status was produced: Error: write EPROTO 140013650892672:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

        ================== END WARNING ==================

12:27:50.522Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products 12:27:50.525Z > gatsby-source-woocommerce: Completed fetching nodes for field: products warn ========== WARNING FOR FIELD products/categories =========== The following error status was produced: Error: write EPROTO 140013650892672:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

        ================== END WARNING ==================

12:27:50.597Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products/categories 12:27:50.600Z > gatsby-source-woocommerce: Completed fetching nodes for field: products/categories warn ========== WARNING FOR FIELD products/attributes =========== The following error status was produced: Error: write EPROTO 140013650892672:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

        ================== END WARNING ==================

12:27:50.666Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products/attributes 12:27:50.669Z > gatsby-source-woocommerce: Completed fetching nodes for field: products/attributes 12:27:50.671Z > gatsby-source-woocommerce: Fetching product variations for 0 nodes 12:27:50.673Z > gatsby-source-woocommerce: 0 product variations retrieved for 0 nodes in 0s 12:27:50.675Z > gatsby-source-woocommerce: Fetching product attributes for 0 nodes 12:27:50.676Z > gatsby-source-woocommerce: 0 product attributes terms retrieved for 0 nodes in 0s 12:27:50.678Z > gatsby-source-woocommerce: 0 nodes mapped, processed, and created in 0s warn The @pasdo501/gatsby-source-woocommerce plugin has generated no Gatsby nodes. Do you need it? success Checking for changed pages - 0.001s success source and transform nodes - 33.782s success building schema - 0.621s info Total nodes: 165, SitePage nodes: 8 (use --verbose for breakdown) success createPages - 0.056s success Checking for changed pages - 0.001s success createPagesStatefully - 0.064s success update schema - 0.040s success write out redirect data - 0.002s success Build manifest and related icons - 0.202s success onPostBootstrap - 0.217s info bootstrap finished - 52.432s success onPreExtractQueries - 0.002s success extract queries from components - 0.998s success write out requires - 0.021s success run static queries - 0.026s - 3/3 115.98/s success run page queries - 0.035s - 3/3 85.71/s ⠀ info gatsby-source-wordpress Watching for WordPress changes ⠀ You can now view gatsby-starter-wordpress-blog in the browser. ⠀ http://localhost:8000/ ⠀ View GraphiQL, an in-browser IDE, to explore your site's data and schema ⠀ http://localhost:8000/___graphql ⠀ Note that the development build is not optimized. To create a production build, use gatsby build ⠀

success Building development bundle - 12.174s

pasdo501 commented 3 years ago

Hi there,

If you're able to, could you post the relevant section from your gatsby-config.js file? Might help see where the problem is!

instantwpuserwin commented 3 years ago

Thanks for looking into this. Appreciate it.

Here's my gatsby-config.js

instantwpuserwin commented 3 years ago

=================================== module.exports = {

plugins: [

{ resolve: gatsby-source-wordpress-experimental, options: { schema: { perPage: 50, }, production: { allow404Images: true, }, // the only required plugin option for WordPress is the GraphQL url. url: process.env.WPGRAPHQL_URL || https://notmyrealmydomain.com/graphql, }, },

{ resolve: gatsby-source-filesystem, options: { name: assets, path: ${__dirname}/content/assets, }, },

gatsby-transformer-sharp, gatsby-plugin-sharp,

{ resolve: gatsby-plugin-manifest, options: { name: Gatsby Starter WordPress Blog, short_name: GatsbyJS & WP, start_url: /, background_color: #ffffff, theme_color: #663399, display: minimal-ui, icon: content/assets/gatsby-icon.png, }, },

{
resolve: '@pasdo501/gatsby-source-woocommerce', options: { // Base URL of Wordpress site api: 'notmyrealmydomain.com',

  // set to false to not see verbose output during build 
  // default: true
  verbose: true,

  // true if using https. otherwise false.
  https: true,
  api_keys: {
    consumer_key: "ck_xxxxxx",
    consumer_secret: "cs_xxxxxx",
  },
  // Array of strings with fields you'd like to create nodes for...
  fields: ['products', 'products/categories', 'products/attributes'],
  // Send the API keys as query string parameters instead of using the authorization header
  // OPTIONAL: defaults to false
  query_string_auth: false,
  // Version of the woocommerce API to use
  // OPTIONAL: defaults to 'wc/v3'
  api_version: 'wc/v3',
  // OPTIONAL: How many results to retrieve *per request*
  per_page: 100,
  // OPTIONAL: Custom WP REST API url prefix, only needed if not using 
  // the default wp-json prefix.
  wpAPIPrefix: 'wp-rest',
  // OPTIONAL: Support for URLs with ports, e.g. 8080; defaults to no port
  port: '8080',
  // OPTIONAL: Encoding; default to 'utf8'
  encoding: 'utf8',
  // OPTIONAL: Custom Axios config (see https://github.com/axios/axios) - note that this can override other options.
  axios_config: {
    // Axios config options
  }
}

}, /**

=================

pasdo501 commented 3 years ago

Thanks for that! Based on the above - I believe the issue is the port setting - in the config, it's set to port: '8080', but the domain you've provided doesn't work when I try to reach it on that port. I would suggest commenting out / removing that config setting and see if that works. While you're at it, I see your wpAPIPrefix setting is also set to 'wp-rest' -- I would recommend double checking that setting next (the default for wordpress is wp-json, so if you haven't changed the wp-rest base, this will lead to another problem.

instantwpuserwin commented 3 years ago

Thanks a million! That worked.

I disabled both port: and wpAPIPrefix and it worked.

First I tried disabling port alone and it gave me 404 errors. then I disabled wpAPIPrefix as well and now it works.

Once again, thanks and appreciate your help and contribution.

pasdo501 commented 3 years ago

Great, glad to hear it! I think I'll actually change the example config to make more sense in terms of not setting those values by default (and especially to not set them to something other than the default in the case of the rest api prefix) to avoid that sort of thing in the future. In hindsight the way it is right now is not the most intuitive.