问:
Gatsby on Netlify build error There was an error in your GraphQL query: Data read, but end of buffer not reached
I have had to update my gatsby/headless wordpress site to the latest version and when trying to build I am getting the following error: There was an error in your GraphQL query: Data read, but end of buffer not reached.

When building locally the build fails but without that error message. I only get that on Netlify.

Node Version: 14.17.5
Gatsby Version: 4.6.1
WPGatsby Version: 2.2.0

Here is my full build log:

```2:55:34 PM: Build ready to start
2:55:36 PM: build-image version: c97e5a221e3fdb93dfecc4e878977417130d2bfc (xenial)
2:55:36 PM: build-image tag: v3.10.4
2:55:36 PM: buildbot version: 94cf4881e10a7b2d529971a176d6ede22bcaeb38
2:55:36 PM: Building without cache
2:55:36 PM: Starting to prepare the repo for build
2:55:37 PM: No cached dependencies found. Cloning fresh repo
2:55:37 PM: git clone git@bitbucket.org:gatsby-wordpress-base/frontend
2:55:38 PM: Preparing Git Reference refs/heads/festivalcoast
2:55:39 PM: Parsing package.json dependencies
2:55:40 PM: Starting build script
2:55:40 PM: Installing dependencies
2:55:40 PM: Python version set to 2.7
2:55:41 PM: Downloading and installing node v14.17.5...
2:55:42 PM: Downloading https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz...
2:55:42 PM: Computing checksum with sha256sum
2:55:42 PM: Checksums matched!
2:55:46 PM: Now using node v14.17.5 (npm v6.14.14)
2:55:46 PM: Started restoring cached build plugins
2:55:46 PM: Finished restoring cached build plugins
2:55:46 PM: Attempting ruby version 2.7.1, read from environment
2:55:47 PM: Required ruby-2.7.1 is not installed - installing.
2:55:47 PM: Searching for binary rubies, this might take some time.
2:55:48 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.7.1.tar.bz2
2:55:48 PM: Checking requirements for ubuntu.
2:55:48 PM: Requirements installation successful.
2:55:48 PM: ruby-2.7.1 - #configure
2:55:48 PM: ruby-2.7.1 - #download
2:55:49 PM: ruby-2.7.1 - #validate archive
2:55:54 PM: ruby-2.7.1 - #extract
2:55:57 PM: ruby-2.7.1 - #validate binary
2:55:58 PM: ruby-2.7.1 - #setup
2:55:59 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1@global
2:55:59 PM: ruby-2.7.1 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
2:55:59 PM: ruby-2.7.1 - #generating global wrappers........
2:55:59 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1
2:56:00 PM: ruby-2.7.1 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
2:56:00 PM: ruby-2.7.1 - #generating default wrappers........
2:56:01 PM: Using /opt/buildhome/.rvm/gems/ruby-2.7.1
2:56:01 PM: Using ruby version 2.7.1
2:56:01 PM: Using PHP version 5.6
2:56:01 PM: Started restoring cached node modules
2:56:01 PM: Finished restoring cached node modules
2:56:02 PM: Installing NPM modules using NPM version 6.14.14
2:56:50 PM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
2:56:50 PM: > msgpackr-extract@1.0.16 install /opt/build/repo/node_modules/msgpackr-extract
2:56:50 PM: > node-gyp-build
2:56:50 PM: > lmdb-store@1.6.14 install /opt/build/repo/node_modules/lmdb-store
2:56:50 PM: > node-gyp-build
2:56:51 PM: > sharp@0.29.3 install /opt/build/repo/node_modules/sharp
2:56:51 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
2:56:53 PM: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.11.3/libvips-8.11.3-linux-x64.tar.br
2:56:55 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
2:56:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:56:55 PM: > core-js@3.21.0 postinstall /opt/build/repo/node_modules/core-js
2:56:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:56:55 PM: > core-js-pure@3.21.0 postinstall /opt/build/repo/node_modules/core-js-pure
2:56:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:56:56 PM: > gatsby-telemetry@3.6.0 postinstall /opt/build/repo/node_modules/gatsby-telemetry
2:56:56 PM: > node src/postinstall.js || true
2:56:56 PM: > gatsby-cli@4.6.0 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
2:56:56 PM: > node scripts/postinstall.js
2:56:56 PM: > gatsby@4.6.1 postinstall /opt/build/repo/node_modules/gatsby
2:56:56 PM: > node scripts/postinstall.js
2:56:58 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
2:56:58 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2:56:58 PM: added 1885 packages from 1048 contributors and audited 1891 packages in 56.02s
2:57:00 PM: 186 packages are looking for funding
2:57:00 PM:   run `npm fund` for details
2:57:00 PM: found 21 vulnerabilities (13 moderate, 6 high, 2 critical)
2:57:00 PM:   run `npm audit fix` to fix them, or `npm audit` for details
2:57:00 PM: NPM modules installed
2:57:01 PM: Started restoring cached go cache
2:57:01 PM: Finished restoring cached go cache
2:57:01 PM: go version go1.14.4 linux/amd64
2:57:01 PM: go version go1.14.4 linux/amd64
2:57:01 PM: Installing missing commands
2:57:01 PM: Verify run directory
2:57:02 PM:
2:57:02 PM: ────────────────────────────────────────────────────────────────
2:57:02 PM:   Netlify Build
2:57:02 PM: ────────────────────────────────────────────────────────────────
2:57:02 PM:
2:57:02 PM: ❯ Version
2:57:02 PM:   @netlify/build 26.2.2
2:57:02 PM:
2:57:02 PM: ❯ Flags
2:57:02 PM:   baseRelDir: true
2:57:02 PM:   buildId: 61fa9b66bcf5840068d8c00e
2:57:02 PM:   deployId: 61fa9b66bcf5840068d8c010
2:57:03 PM:
2:57:03 PM: ❯ Current directory
2:57:03 PM:   /opt/build/repo
2:57:03 PM:
2:57:03 PM: ❯ Config file
2:57:03 PM:   No config file was defined: using default values.
2:57:03 PM:
2:57:03 PM: ❯ Context
2:57:03 PM:   production
2:57:03 PM:
2:57:03 PM: ❯ Installing plugins
2:57:03 PM:    - netlify-plugin-gatsby-cache@0.3.0
2:57:04 PM:
2:57:04 PM: ❯ Loading plugins
2:57:04 PM:    - netlify-plugin-gatsby-cache@0.3.0 from Netlify app
2:57:05 PM:
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:   1. netlify-plugin-gatsby-cache (onPreBuild event)
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:
2:57:05 PM: No Gatsby cache found. Building fresh.
2:57:05 PM:
2:57:05 PM: (netlify-plugin-gatsby-cache onPreBuild completed in 17ms)
2:57:05 PM:
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:   2. Build command from Netlify app
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:
2:57:05 PM: $ npm run build
2:57:05 PM: > gatsby-wordpress-base-frontend@1.0.0 build /opt/build/repo
2:57:05 PM: > gatsby build
2:57:10 PM: success open and validate gatsby-configs, load plugins - 2.353s
2:57:10 PM: success onPreInit - 0.005s
2:57:11 PM: success initialize cache - 0.224s
2:57:11 PM: success copy gatsby files - 0.076s
2:57:11 PM: success Compiling Gatsby Functions - 0.319s
2:57:11 PM: success onPreBootstrap - 0.331s
2:57:12 PM: success  gatsby-source-wordpress  ensuring plugin requirements are met - 1.353s
2:57:13 PM:
2:57:13 PM: info  gatsby-source-wordpress
2:57:13 PM:     This is either your first build or the cache was cleared.
2:57:13 PM:     Please wait while your WordPress data is synced to your Gatsby cache.
2:57:13 PM:     Maybe now's a good time to get up and stretch? :D
2:57:15 PM: success  gatsby-source-wordpress  ingest WPGraphQL schema - 2.031s
2:57:15 PM: success createSchemaCustomization - 3.420s
2:57:15 PM: success  gatsby-source-wordpress  Comment - 0.559s - fetched 0
2:57:15 PM: success  gatsby-source-wordpress  Category - 0.620s - fetched 2
2:57:15 PM: success  gatsby-source-wordpress  MenuItem - 0.649s - fetched 9
2:57:15 PM: success  gatsby-source-wordpress  PostFormat - 0.806s - fetched 0
2:57:15 PM: success  gatsby-source-wordpress  Menu - 0.818s - fetched 2
2:57:16 PM: success  gatsby-source-wordpress  Tag - 0.975s - fetched 0
2:57:16 PM: success  gatsby-source-wordpress  UserRole - 1.040s - fetched 0
2:57:16 PM: success  gatsby-source-wordpress  Page - 1.090s - fetched 4
2:57:16 PM: success  gatsby-source-wordpress  ContentType - 1.242s - fetched 3
2:57:16 PM: success  gatsby-source-wordpress  Taxonomy - 1.267s - fetched 3
2:57:16 PM: success  gatsby-source-wordpress  User - 1.326s - fetched 2
2:57:16 PM: success  gatsby-source-wordpress  Post - 1.675s - fetched 6
2:57:19 PM: success  gatsby-source-wordpress  MediaItems - 3.441s - fetched 0
2:57:19 PM: success  gatsby-source-wordpress  fetch root fields - 4.201s
2:57:25 PM: success  gatsby-source-wordpress  MediaItem - 8.924s - fetched 13
2:57:25 PM: success  gatsby-source-wordpress  creating nodes - 8.925s
2:57:25 PM: success  gatsby-source-wordpress  fetching nodes - 10.609s - 44 total
2:57:25 PM: success Downloading remote files - 9.218s - 17/17 1.84/s
2:57:25 PM: success Checking for changed pages - 0.000s
2:57:25 PM: success source and transform nodes - 10.800s
2:57:26 PM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
2:57:27 PM: success building schema - 2.089s
2:57:28 PM: warning You can't use childImageSharp together with bcp-logo.svg — use publicURL instead. The childImageSharp portion of the query in this file will return null:
undefined
2:57:29 PM: success createPages - 1.654s
2:57:32 PM: success createPagesStatefully - 3.225s
2:57:32 PM: info Total nodes: 146, SitePage nodes: 14 (use --verbose for breakdown)
2:57:32 PM: success Checking for changed pages - 0.000s
2:57:32 PM: success onPreExtractQueries - 0.001s
2:57:34 PM: success  gatsby-source-wordpress  diff schemas - 0.977s
2:57:37 PM: success  gatsby-source-wordpress  ingest WPGraphQL schema - 4.873s
2:57:48 PM: success extract queries from components - 15.504s
2:57:48 PM: success write out redirect data - 0.051s
2:57:57 PM: success Build manifest and related icons - 9.078s
2:57:57 PM: success onPostBootstrap - 9.102s
2:57:57 PM: info bootstrap finished - 51.563s
2:57:57 PM: success write out requires - 0.010s
2:58:31 PM: DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
2:58:31 PM: Recommendation: math.div(4em, 3) or calc(4em / 3)
2:58:31 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
2:58:31 PM:   ╷
2:58:31 PM: 6 │   font-size: (4em / 3);
2:58:31 PM:   │               ^^^^^^^
2:58:31 PM:   ╵
2:58:31 PM:     src/styles/fontawesome/_larger.scss 6:15     @import
2:58:31 PM:     src/styles/fontawesome/fontawesome.scss 8:9  @import
2:58:31 PM:     src/style.scss 5:9                           root stylesheet
2:58:31 PM: DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
2:58:31 PM: Recommendation: math.div(3em, 4) or calc(3em / 4)
2:58:31 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
2:58:31 PM:   ╷
2:58:31 PM: 7 │   line-height: (3em / 4);
2:58:31 PM:   │                 ^^^^^^^
2:58:31 PM:   ╵
2:58:31 PM:     src/styles/fontawesome/_larger.scss 7:17     @import
2:58:31 PM:     src/styles/fontawesome/fontawesome.scss 8:9  @import
2:58:31 PM:     src/style.scss 5:9                           root stylesheet
2:58:31 PM: DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
2:58:31 PM: Recommendation: math.div($fa-li-width * 5, 4) or calc($fa-li-width * 5 / 4)
2:58:31 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
2:58:31 PM:   ╷
2:58:31 PM: 6 │   margin-left: $fa-li-width * 5/4;
2:58:31 PM:   │                ^^^^^^^^^^^^^^^^^^
2:58:31 PM:   ╵
2:58:31 PM:     src/styles/fontawesome/_list.scss 6:16        @import
2:58:31 PM:     src/styles/fontawesome/fontawesome.scss 10:9  @import
2:58:31 PM:     src/style.scss 5:9                            root stylesheet
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/cover.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/columns.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/row.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/image.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/embed.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/media-text.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/gallery.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-archive-js
2:59:59 PM: success Building production JavaScript and CSS bundles - 121.595s
3:01:46 PM: success Building HTML renderer - 107.492s
3:01:46 PM: success Execute page configs - 0.035s
3:01:46 PM: success Caching Webpack compilations - 0.001s
3:01:49 PM: error There was an error in your GraphQL query:
3:01:49 PM: Data read, but end of buffer not reached
3:01:49 PM:   26 |       }
3:01:49 PM:   27 |       categories {
3:01:49 PM:   28 |         nodes {
3:01:49 PM:   29 |           link
3:01:49 PM:   30 |           name
3:01:49 PM:   31 |           slug
3:01:49 PM:   32 |         }
3:01:49 PM:   33 |       }
3:01:49 PM:   34 |     }
3:01:49 PM:   35 |   }
3:01:49 PM: > 36 |   allWpTermNode {
3:01:49 PM:      |   ^
3:01:49 PM:   37 |     categories: nodes {
3:01:49 PM:   38 |       ... on WpCategory {
3:01:49 PM:   39 |         id
3:01:49 PM:   40 |         name
3:01:49 PM:   41 |         link
3:01:49 PM:   42 |         slug
3:01:49 PM:   43 |       }
3:01:49 PM:   44 |     }
3:01:49 PM:   45 |   }
3:01:49 PM:   46 |   page: wpPage(id: {eq: $id}) {
3:01:49 PM: File path: /opt/build/repo/src/templates/blog-post-archive.js
3:01:49 PM: Url path: /blogs-news
3:01:49 PM: Plugin: none
3:01:49 PM:
3:01:49 PM:
3:01:49 PM:   Error: Data read, but end of buffer not reached
3:01:49 PM:
3:01:49 PM:   - node.cjs:178 checkedRead
3:01:49 PM:     [repo]/[msgpackr]/dist/node.cjs:178:10
3:01:49 PM:
3:01:49 PM:   - node.cjs:91 Packr.unpack
3:01:49 PM:     [repo]/[msgpackr]/dist/node.cjs:91:10
3:01:49 PM:
3:01:49 PM:   - node.cjs:150 Packr.decode
3:01:49 PM:     [repo]/[msgpackr]/dist/node.cjs:150:15
3:01:49 PM:
3:01:49 PM:   - index.js:440 Object.get
3:01:49 PM:     [repo]/[lmdb-store]/index.js:440:63
3:01:49 PM:
3:01:49 PM:   - caching.js:37 Object.get
3:01:49 PM:     [repo]/[lmdb-store]/caching.js:37:17
3:01:49 PM:
3:01:49 PM:   - lmdb-datastore.ts:148 getNode
3:01:49 PM:     [repo]/[gatsby]/src/datastore/lmdb/lmdb-datastore.ts:148:16
3:01:49 PM:
3:01:49 PM:   - lmdb-datastore.ts:127
3:01:49 PM:     [repo]/[gatsby]/src/datastore/lmdb/lmdb-datastore.ts:127:52
3:01:49 PM:
3:01:49 PM:   - ArrayLikeIterable.js:36 Object.next
3:01:49 PM:     [repo]/[lmdb-store]/util/ArrayLikeIterable.js:36:16
3:01:49 PM:
3:01:49 PM:   - ArrayLikeIterable.js:27 Object.value [as next]
3:01:49 PM:     [repo]/[lmdb-store]/util/ArrayLikeIterable.js:27:34
3:01:49 PM:
3:01:49 PM:   - iterable.ts:45 GatsbyIterable.forEach
3:01:49 PM:     [repo]/[gatsby]/src/datastore/common/iterable.ts:45:16
3:01:49 PM:
3:01:49 PM:   - indexing.ts:258 ensureEmptyFilterCache
3:01:49 PM:     [repo]/[gatsby]/src/datastore/in-memory/indexing.ts:258:8
3:01:49 PM:
3:01:49 PM:   - run-fast-filters.ts:336 convertAndApplyFastFilters
3:01:49 PM:     [repo]/[gatsby]/src/datastore/in-memory/run-fast-filters.ts:336:7
3:01:49 PM:
3:01:49 PM:   - run-fast-filters.ts:282 runFastFiltersAndSort
3:01:49 PM:     [repo]/[gatsby]/src/datastore/in-memory/run-fast-filters.ts:282:18
3:01:49 PM:
3:01:49 PM:   - lmdb-datastore.ts:176 Object.runQuery
3:01:49 PM:     [repo]/[gatsby]/src/datastore/lmdb/lmdb-datastore.ts:176:26
3:01:49 PM:
3:01:49 PM:   - node-model.js:347 LocalNodeModel._query
3:01:49 PM:     [repo]/[gatsby]/src/schema/node-model.js:347:58
3:01:49 PM:
3:01:49 PM:   - task_queues.js:95 processTicksAndRejections
3:01:49 PM:     internal/process/task_queues.js:95:5
3:01:49 PM:
3:01:49 PM:
3:01:49 PM: error An error occurred during parallel query running.
3:01:49 PM: Go here for troubleshooting tips: https://gatsby.dev/pqr-feedback
3:01:49 PM:
3:01:49 PM:
3:01:49 PM:   Error: Worker exited before finishing task
3:01:49 PM:
3:01:49 PM:   - index.js:113 ChildProcess.<anonymous>
3:01:49 PM:     [repo]/[gatsby-worker]/dist/index.js:113:45
3:01:49 PM:
3:01:49 PM:   - child_process.js:277 Process.ChildProcess._handle.onexit
3:01:49 PM:     internal/child_process.js:277:12
3:01:49 PM:
3:01:49 PM:
3:01:49 PM: not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 269.864s
3:01:49 PM: not finished run queries in workers - 2.771s
3:01:49 PM: npm ERR! code ELIFECYCLE
3:01:49 PM: npm ERR! errno 1
3:01:49 PM: npm ERR! gatsby-wordpress-base-frontend@1.0.0 build: `gatsby build`
3:01:49 PM: npm ERR! Exit status 1
3:01:49 PM: npm ERR!
3:01:49 PM: npm ERR! Failed at the gatsby-wordpress-base-frontend@1.0.0 build script.
3:01:49 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:01:49 PM: npm ERR! A complete log of this run can be found in:
3:01:49 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-02-02T15_01_49_927Z-debug.log
3:01:50 PM:
3:01:50 PM: ────────────────────────────────────────────────────────────────
3:01:50 PM:   "build.command" failed
3:01:50 PM: ────────────────────────────────────────────────────────────────
3:01:50 PM:
3:01:50 PM:   Error message
3:01:50 PM:   Command failed with exit code 1: npm run build
3:01:50 PM:
3:01:50 PM:   Error location
3:01:50 PM:   In Build command from Netlify app:
3:01:50 PM:   npm run build
3:01:50 PM:
3:01:50 PM:   Resolved config
3:01:50 PM:   build:
3:01:50 PM:     command: npm run build
3:01:50 PM:     commandOrigin: ui
3:01:50 PM:     environment:
3:01:50 PM:       - GATSBY_CPU_COUNT
3:01:50 PM:       - GATSBY_WPADMIN_URL
3:01:50 PM:       - GATSBY_WP_AJAX_URL
3:01:50 PM:       - NODE_VERSION
3:01:50 PM:       - WPGRAPHQL_URL
3:01:50 PM:     publish: /opt/build/repo/public
3:01:50 PM:     publishOrigin: ui
3:01:50 PM:   plugins:
3:01:50 PM:     - inputs: {}
3:01:50 PM:       origin: ui
3:01:50 PM:       package: netlify-plugin-gatsby-cache
3:01:50 PM: Caching artifacts
3:01:50 PM: Started saving node modules
3:01:50 PM: Finished saving node modules
3:01:50 PM: Started saving build plugins
3:01:50 PM: Finished saving build plugins
3:01:50 PM: Started saving pip cache
3:01:50 PM: Finished saving pip cache
3:01:50 PM: Started saving emacs cask dependencies
3:01:50 PM: Finished saving emacs cask dependencies
3:01:50 PM: Started saving maven dependencies
3:01:50 PM: Finished saving maven dependencies
3:01:50 PM: Started saving boot dependencies
3:01:50 PM: Finished saving boot dependencies
3:01:50 PM: Started saving rust rustup cache
3:01:50 PM: Finished saving rust rustup cache
3:01:50 PM: Started saving go dependencies
3:01:50 PM: Finished saving go dependencies
3:01:54 PM: Cached ruby version 2.7.1
3:01:54 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:01:54 PM: Creating deploy upload records
3:01:54 PM: Failing build: Failed to build site
3:01:54 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:01:54 PM: Finished processing build request in 6m18.406894694s
```

答:
I just resolved this issue very easily.

```<code>For npm =  npm run clean
&&
For Yarn = yarn clean.
</code>```

I just resolved the issue by yarn clean and than yarn start than issue just vanished.

Body:
I have had to update my gatsby/headless wordpress site to the latest version and when trying to build I am getting the following error: There was an error in your GraphQL query: Data read, but end of buffer not reached.

When building locally the build fails but without that error message. I only get that on Netlify.

Node Version: 14.17.5
Gatsby Version: 4.6.1
WPGatsby Version: 2.2.0

Here is my full build log:

2:55:34 PM: Build ready to start
2:55:36 PM: build-image version: c97e5a221e3fdb93dfecc4e878977417130d2bfc (xenial)
2:55:36 PM: build-image tag: v3.10.4
2:55:36 PM: buildbot version: 94cf4881e10a7b2d529971a176d6ede22bcaeb38
2:55:36 PM: Building without cache
2:55:36 PM: Starting to prepare the repo for build
2:55:37 PM: No cached dependencies found. Cloning fresh repo
2:55:37 PM: git clone git@bitbucket.org:gatsby-wordpress-base/frontend
2:55:38 PM: Preparing Git Reference refs/heads/festivalcoast
2:55:39 PM: Parsing package.json dependencies
2:55:40 PM: Starting build script
2:55:40 PM: Installing dependencies
2:55:40 PM: Python version set to 2.7
2:55:41 PM: Downloading and installing node v14.17.5...
2:55:42 PM: Downloading https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz...
2:55:42 PM: Computing checksum with sha256sum
2:55:42 PM: Checksums matched!
2:55:46 PM: Now using node v14.17.5 (npm v6.14.14)
2:55:46 PM: Started restoring cached build plugins
2:55:46 PM: Finished restoring cached build plugins
2:55:46 PM: Attempting ruby version 2.7.1, read from environment
2:55:47 PM: Required ruby-2.7.1 is not installed - installing.
2:55:47 PM: Searching for binary rubies, this might take some time.
2:55:48 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.7.1.tar.bz2
2:55:48 PM: Checking requirements for ubuntu.
2:55:48 PM: Requirements installation successful.
2:55:48 PM: ruby-2.7.1 - #configure
2:55:48 PM: ruby-2.7.1 - #download
2:55:49 PM: ruby-2.7.1 - #validate archive
2:55:54 PM: ruby-2.7.1 - #extract
2:55:57 PM: ruby-2.7.1 - #validate binary
2:55:58 PM: ruby-2.7.1 - #setup
2:55:59 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1@global
2:55:59 PM: ruby-2.7.1 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
2:55:59 PM: ruby-2.7.1 - #generating global wrappers........
2:55:59 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1
2:56:00 PM: ruby-2.7.1 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
2:56:00 PM: ruby-2.7.1 - #generating default wrappers........
2:56:01 PM: Using /opt/buildhome/.rvm/gems/ruby-2.7.1
2:56:01 PM: Using ruby version 2.7.1
2:56:01 PM: Using PHP version 5.6
2:56:01 PM: Started restoring cached node modules
2:56:01 PM: Finished restoring cached node modules
2:56:02 PM: Installing NPM modules using NPM version 6.14.14
2:56:50 PM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
2:56:50 PM: > msgpackr-extract@1.0.16 install /opt/build/repo/node_modules/msgpackr-extract
2:56:50 PM: > node-gyp-build
2:56:50 PM: > lmdb-store@1.6.14 install /opt/build/repo/node_modules/lmdb-store
2:56:50 PM: > node-gyp-build
2:56:51 PM: > sharp@0.29.3 install /opt/build/repo/node_modules/sharp
2:56:51 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
2:56:53 PM: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.11.3/libvips-8.11.3-linux-x64.tar.br
2:56:55 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
2:56:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:56:55 PM: > core-js@3.21.0 postinstall /opt/build/repo/node_modules/core-js
2:56:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:56:55 PM: > core-js-pure@3.21.0 postinstall /opt/build/repo/node_modules/core-js-pure
2:56:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:56:56 PM: > gatsby-telemetry@3.6.0 postinstall /opt/build/repo/node_modules/gatsby-telemetry
2:56:56 PM: > node src/postinstall.js || true
2:56:56 PM: > gatsby-cli@4.6.0 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
2:56:56 PM: > node scripts/postinstall.js
2:56:56 PM: > gatsby@4.6.1 postinstall /opt/build/repo/node_modules/gatsby
2:56:56 PM: > node scripts/postinstall.js
2:56:58 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
2:56:58 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2:56:58 PM: added 1885 packages from 1048 contributors and audited 1891 packages in 56.02s
2:57:00 PM: 186 packages are looking for funding
2:57:00 PM:   run `npm fund` for details
2:57:00 PM: found 21 vulnerabilities (13 moderate, 6 high, 2 critical)
2:57:00 PM:   run `npm audit fix` to fix them, or `npm audit` for details
2:57:00 PM: NPM modules installed
2:57:01 PM: Started restoring cached go cache
2:57:01 PM: Finished restoring cached go cache
2:57:01 PM: go version go1.14.4 linux/amd64
2:57:01 PM: go version go1.14.4 linux/amd64
2:57:01 PM: Installing missing commands
2:57:01 PM: Verify run directory
2:57:02 PM:
2:57:02 PM: ────────────────────────────────────────────────────────────────
2:57:02 PM:   Netlify Build
2:57:02 PM: ────────────────────────────────────────────────────────────────
2:57:02 PM:
2:57:02 PM: ❯ Version
2:57:02 PM:   @netlify/build 26.2.2
2:57:02 PM:
2:57:02 PM: ❯ Flags
2:57:02 PM:   baseRelDir: true
2:57:02 PM:   buildId: 61fa9b66bcf5840068d8c00e
2:57:02 PM:   deployId: 61fa9b66bcf5840068d8c010
2:57:03 PM:
2:57:03 PM: ❯ Current directory
2:57:03 PM:   /opt/build/repo
2:57:03 PM:
2:57:03 PM: ❯ Config file
2:57:03 PM:   No config file was defined: using default values.
2:57:03 PM:
2:57:03 PM: ❯ Context
2:57:03 PM:   production
2:57:03 PM:
2:57:03 PM: ❯ Installing plugins
2:57:03 PM:    - netlify-plugin-gatsby-cache@0.3.0
2:57:04 PM:
2:57:04 PM: ❯ Loading plugins
2:57:04 PM:    - netlify-plugin-gatsby-cache@0.3.0 from Netlify app
2:57:05 PM:
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:   1. netlify-plugin-gatsby-cache (onPreBuild event)
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:
2:57:05 PM: No Gatsby cache found. Building fresh.
2:57:05 PM:
2:57:05 PM: (netlify-plugin-gatsby-cache onPreBuild completed in 17ms)
2:57:05 PM:
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:   2. Build command from Netlify app
2:57:05 PM: ────────────────────────────────────────────────────────────────
2:57:05 PM:
2:57:05 PM: $ npm run build
2:57:05 PM: > gatsby-wordpress-base-frontend@1.0.0 build /opt/build/repo
2:57:05 PM: > gatsby build
2:57:10 PM: success open and validate gatsby-configs, load plugins - 2.353s
2:57:10 PM: success onPreInit - 0.005s
2:57:11 PM: success initialize cache - 0.224s
2:57:11 PM: success copy gatsby files - 0.076s
2:57:11 PM: success Compiling Gatsby Functions - 0.319s
2:57:11 PM: success onPreBootstrap - 0.331s
2:57:12 PM: success  gatsby-source-wordpress  ensuring plugin requirements are met - 1.353s
2:57:13 PM:
2:57:13 PM: info  gatsby-source-wordpress
2:57:13 PM:     This is either your first build or the cache was cleared.
2:57:13 PM:     Please wait while your WordPress data is synced to your Gatsby cache.
2:57:13 PM:     Maybe now's a good time to get up and stretch? :D
2:57:15 PM: success  gatsby-source-wordpress  ingest WPGraphQL schema - 2.031s
2:57:15 PM: success createSchemaCustomization - 3.420s
2:57:15 PM: success  gatsby-source-wordpress  Comment - 0.559s - fetched 0
2:57:15 PM: success  gatsby-source-wordpress  Category - 0.620s - fetched 2
2:57:15 PM: success  gatsby-source-wordpress  MenuItem - 0.649s - fetched 9
2:57:15 PM: success  gatsby-source-wordpress  PostFormat - 0.806s - fetched 0
2:57:15 PM: success  gatsby-source-wordpress  Menu - 0.818s - fetched 2
2:57:16 PM: success  gatsby-source-wordpress  Tag - 0.975s - fetched 0
2:57:16 PM: success  gatsby-source-wordpress  UserRole - 1.040s - fetched 0
2:57:16 PM: success  gatsby-source-wordpress  Page - 1.090s - fetched 4
2:57:16 PM: success  gatsby-source-wordpress  ContentType - 1.242s - fetched 3
2:57:16 PM: success  gatsby-source-wordpress  Taxonomy - 1.267s - fetched 3
2:57:16 PM: success  gatsby-source-wordpress  User - 1.326s - fetched 2
2:57:16 PM: success  gatsby-source-wordpress  Post - 1.675s - fetched 6
2:57:19 PM: success  gatsby-source-wordpress  MediaItems - 3.441s - fetched 0
2:57:19 PM: success  gatsby-source-wordpress  fetch root fields - 4.201s
2:57:25 PM: success  gatsby-source-wordpress  MediaItem - 8.924s - fetched 13
2:57:25 PM: success  gatsby-source-wordpress  creating nodes - 8.925s
2:57:25 PM: success  gatsby-source-wordpress  fetching nodes - 10.609s - 44 total
2:57:25 PM: success Downloading remote files - 9.218s - 17/17 1.84/s
2:57:25 PM: success Checking for changed pages - 0.000s
2:57:25 PM: success source and transform nodes - 10.800s
2:57:26 PM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
2:57:27 PM: success building schema - 2.089s
2:57:28 PM: warning You can't use childImageSharp together with bcp-logo.svg — use publicURL instead. The childImageSharp portion of the query in this file will return null:
undefined
2:57:29 PM: success createPages - 1.654s
2:57:32 PM: success createPagesStatefully - 3.225s
2:57:32 PM: info Total nodes: 146, SitePage nodes: 14 (use --verbose for breakdown)
2:57:32 PM: success Checking for changed pages - 0.000s
2:57:32 PM: success onPreExtractQueries - 0.001s
2:57:34 PM: success  gatsby-source-wordpress  diff schemas - 0.977s
2:57:37 PM: success  gatsby-source-wordpress  ingest WPGraphQL schema - 4.873s
2:57:48 PM: success extract queries from components - 15.504s
2:57:48 PM: success write out redirect data - 0.051s
2:57:57 PM: success Build manifest and related icons - 9.078s
2:57:57 PM: success onPostBootstrap - 9.102s
2:57:57 PM: info bootstrap finished - 51.563s
2:57:57 PM: success write out requires - 0.010s
2:58:31 PM: DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
2:58:31 PM: Recommendation: math.div(4em, 3) or calc(4em / 3)
2:58:31 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
2:58:31 PM:   ╷
2:58:31 PM: 6 │   font-size: (4em / 3);
2:58:31 PM:   │               ^^^^^^^
2:58:31 PM:   ╵
2:58:31 PM:     src/styles/fontawesome/_larger.scss 6:15     @import
2:58:31 PM:     src/styles/fontawesome/fontawesome.scss 8:9  @import
2:58:31 PM:     src/style.scss 5:9                           root stylesheet
2:58:31 PM: DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
2:58:31 PM: Recommendation: math.div(3em, 4) or calc(3em / 4)
2:58:31 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
2:58:31 PM:   ╷
2:58:31 PM: 7 │   line-height: (3em / 4);
2:58:31 PM:   │                 ^^^^^^^
2:58:31 PM:   ╵
2:58:31 PM:     src/styles/fontawesome/_larger.scss 7:17     @import
2:58:31 PM:     src/styles/fontawesome/fontawesome.scss 8:9  @import
2:58:31 PM:     src/style.scss 5:9                           root stylesheet
2:58:31 PM: DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
2:58:31 PM: Recommendation: math.div($fa-li-width * 5, 4) or calc($fa-li-width * 5 / 4)
2:58:31 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
2:58:31 PM:   ╷
2:58:31 PM: 6 │   margin-left: $fa-li-width * 5/4;
2:58:31 PM:   │                ^^^^^^^^^^^^^^^^^^
2:58:31 PM:   ╵
2:58:31 PM:     src/styles/fontawesome/_list.scss 6:16        @import
2:58:31 PM:     src/styles/fontawesome/fontawesome.scss 10:9  @import
2:58:31 PM:     src/style.scss 5:9                            root stylesheet
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/cover.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/columns.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/row.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/image.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/embed.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/media-text.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-archive-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
2:59:59 PM: warning chunk styles [mini-css-extract-plugin]
2:59:59 PM: Conflicting order. Following module has been added:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/components/post-tease.scss
2:59:59 PM: despite it was not able to fulfill desired ordering with these modules:
2:59:59 PM:  * css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[11].oneOf[1].use[3]!./src/styles/blocks/gallery.scss
2:59:59 PM:    - couldn't fulfill desired order of chunk group(s) component---src-templates-blog-post-js, component---src-templates-page-js
   - while fulfilling desired order of chunk group(s) component---src-templates-blog-post-archive-js
2:59:59 PM: success Building production JavaScript and CSS bundles - 121.595s
3:01:46 PM: success Building HTML renderer - 107.492s
3:01:46 PM: success Execute page configs - 0.035s
3:01:46 PM: success Caching Webpack compilations - 0.001s
3:01:49 PM: error There was an error in your GraphQL query:
3:01:49 PM: Data read, but end of buffer not reached
3:01:49 PM:   26 |       }
3:01:49 PM:   27 |       categories {
3:01:49 PM:   28 |         nodes {
3:01:49 PM:   29 |           link
3:01:49 PM:   30 |           name
3:01:49 PM:   31 |           slug
3:01:49 PM:   32 |         }
3:01:49 PM:   33 |       }
3:01:49 PM:   34 |     }
3:01:49 PM:   35 |   }
3:01:49 PM: > 36 |   allWpTermNode {
3:01:49 PM:      |   ^
3:01:49 PM:   37 |     categories: nodes {
3:01:49 PM:   38 |       ... on WpCategory {
3:01:49 PM:   39 |         id
3:01:49 PM:   40 |         name
3:01:49 PM:   41 |         link
3:01:49 PM:   42 |         slug
3:01:49 PM:   43 |       }
3:01:49 PM:   44 |     }
3:01:49 PM:   45 |   }
3:01:49 PM:   46 |   page: wpPage(id: {eq: $id}) {
3:01:49 PM: File path: /opt/build/repo/src/templates/blog-post-archive.js
3:01:49 PM: Url path: /blogs-news
3:01:49 PM: Plugin: none
3:01:49 PM:
3:01:49 PM:
3:01:49 PM:   Error: Data read, but end of buffer not reached
3:01:49 PM:
3:01:49 PM:   - node.cjs:178 checkedRead
3:01:49 PM:     [repo]/[msgpackr]/dist/node.cjs:178:10
3:01:49 PM:
3:01:49 PM:   - node.cjs:91 Packr.unpack
3:01:49 PM:     [repo]/[msgpackr]/dist/node.cjs:91:10
3:01:49 PM:
3:01:49 PM:   - node.cjs:150 Packr.decode
3:01:49 PM:     [repo]/[msgpackr]/dist/node.cjs:150:15
3:01:49 PM:
3:01:49 PM:   - index.js:440 Object.get
3:01:49 PM:     [repo]/[lmdb-store]/index.js:440:63
3:01:49 PM:
3:01:49 PM:   - caching.js:37 Object.get
3:01:49 PM:     [repo]/[lmdb-store]/caching.js:37:17
3:01:49 PM:
3:01:49 PM:   - lmdb-datastore.ts:148 getNode
3:01:49 PM:     [repo]/[gatsby]/src/datastore/lmdb/lmdb-datastore.ts:148:16
3:01:49 PM:
3:01:49 PM:   - lmdb-datastore.ts:127
3:01:49 PM:     [repo]/[gatsby]/src/datastore/lmdb/lmdb-datastore.ts:127:52
3:01:49 PM:
3:01:49 PM:   - ArrayLikeIterable.js:36 Object.next
3:01:49 PM:     [repo]/[lmdb-store]/util/ArrayLikeIterable.js:36:16
3:01:49 PM:
3:01:49 PM:   - ArrayLikeIterable.js:27 Object.value [as next]
3:01:49 PM:     [repo]/[lmdb-store]/util/ArrayLikeIterable.js:27:34
3:01:49 PM:
3:01:49 PM:   - iterable.ts:45 GatsbyIterable.forEach
3:01:49 PM:     [repo]/[gatsby]/src/datastore/common/iterable.ts:45:16
3:01:49 PM:
3:01:49 PM:   - indexing.ts:258 ensureEmptyFilterCache
3:01:49 PM:     [repo]/[gatsby]/src/datastore/in-memory/indexing.ts:258:8
3:01:49 PM:
3:01:49 PM:   - run-fast-filters.ts:336 convertAndApplyFastFilters
3:01:49 PM:     [repo]/[gatsby]/src/datastore/in-memory/run-fast-filters.ts:336:7
3:01:49 PM:
3:01:49 PM:   - run-fast-filters.ts:282 runFastFiltersAndSort
3:01:49 PM:     [repo]/[gatsby]/src/datastore/in-memory/run-fast-filters.ts:282:18
3:01:49 PM:
3:01:49 PM:   - lmdb-datastore.ts:176 Object.runQuery
3:01:49 PM:     [repo]/[gatsby]/src/datastore/lmdb/lmdb-datastore.ts:176:26
3:01:49 PM:
3:01:49 PM:   - node-model.js:347 LocalNodeModel._query
3:01:49 PM:     [repo]/[gatsby]/src/schema/node-model.js:347:58
3:01:49 PM:
3:01:49 PM:   - task_queues.js:95 processTicksAndRejections
3:01:49 PM:     internal/process/task_queues.js:95:5
3:01:49 PM:
3:01:49 PM:
3:01:49 PM: error An error occurred during parallel query running.
3:01:49 PM: Go here for troubleshooting tips: https://gatsby.dev/pqr-feedback
3:01:49 PM:
3:01:49 PM:
3:01:49 PM:   Error: Worker exited before finishing task
3:01:49 PM:
3:01:49 PM:   - index.js:113 ChildProcess.<anonymous>
3:01:49 PM:     [repo]/[gatsby-worker]/dist/index.js:113:45
3:01:49 PM:
3:01:49 PM:   - child_process.js:277 Process.ChildProcess._handle.onexit
3:01:49 PM:     internal/child_process.js:277:12
3:01:49 PM:
3:01:49 PM:
3:01:49 PM: not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 269.864s
3:01:49 PM: not finished run queries in workers - 2.771s
3:01:49 PM: npm ERR! code ELIFECYCLE
3:01:49 PM: npm ERR! errno 1
3:01:49 PM: npm ERR! gatsby-wordpress-base-frontend@1.0.0 build: `gatsby build`
3:01:49 PM: npm ERR! Exit status 1
3:01:49 PM: npm ERR!
3:01:49 PM: npm ERR! Failed at the gatsby-wordpress-base-frontend@1.0.0 build script.
3:01:49 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:01:49 PM: npm ERR! A complete log of this run can be found in:
3:01:49 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-02-02T15_01_49_927Z-debug.log
3:01:50 PM:
3:01:50 PM: ────────────────────────────────────────────────────────────────
3:01:50 PM:   "build.command" failed
3:01:50 PM: ────────────────────────────────────────────────────────────────
3:01:50 PM:
3:01:50 PM:   Error message
3:01:50 PM:   Command failed with exit code 1: npm run build
3:01:50 PM:
3:01:50 PM:   Error location
3:01:50 PM:   In Build command from Netlify app:
3:01:50 PM:   npm run build
3:01:50 PM:
3:01:50 PM:   Resolved config
3:01:50 PM:   build:
3:01:50 PM:     command: npm run build
3:01:50 PM:     commandOrigin: ui
3:01:50 PM:     environment:
3:01:50 PM:       - GATSBY_CPU_COUNT
3:01:50 PM:       - GATSBY_WPADMIN_URL
3:01:50 PM:       - GATSBY_WP_AJAX_URL
3:01:50 PM:       - NODE_VERSION
3:01:50 PM:       - WPGRAPHQL_URL
3:01:50 PM:     publish: /opt/build/repo/public
3:01:50 PM:     publishOrigin: ui
3:01:50 PM:   plugins:
3:01:50 PM:     - inputs: {}
3:01:50 PM:       origin: ui
3:01:50 PM:       package: netlify-plugin-gatsby-cache
3:01:50 PM: Caching artifacts
3:01:50 PM: Started saving node modules
3:01:50 PM: Finished saving node modules
3:01:50 PM: Started saving build plugins
3:01:50 PM: Finished saving build plugins
3:01:50 PM: Started saving pip cache
3:01:50 PM: Finished saving pip cache
3:01:50 PM: Started saving emacs cask dependencies
3:01:50 PM: Finished saving emacs cask dependencies
3:01:50 PM: Started saving maven dependencies
3:01:50 PM: Finished saving maven dependencies
3:01:50 PM: Started saving boot dependencies
3:01:50 PM: Finished saving boot dependencies
3:01:50 PM: Started saving rust rustup cache
3:01:50 PM: Finished saving rust rustup cache
3:01:50 PM: Started saving go dependencies
3:01:50 PM: Finished saving go dependencies
3:01:54 PM: Cached ruby version 2.7.1
3:01:54 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:01:54 PM: Creating deploy upload records
3:01:54 PM: Failing build: Failed to build site
3:01:54 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:01:54 PM: Finished processing build request in 6m18.406894694s

Body:
I just resolved this issue very easily.

For npm =  npm run clean
&&
For Yarn = yarn clean.

I just resolved the issue by yarn clean and than yarn start than issue just vanished.


来源: stackexchange

问:
How to build a Go app that can cross-macOS-version?
Here is my recently created macOS app: https://github.com/evillt/macmineable-release

and here is my facing issue: https://github.com/evillt/macmineable-release/issues/18

I built the app on my machine it can run normally on any BigSur device, even M1 devices, but can not run on Catalina(10.15).

So what I want is to build a version that can run on multi-macOS-version with a single app.

Huge thanks for any suggestions!

update

My device is MacBook Pro 2015, Intel I5 chip, Big Sur 11.5.2.

I build this app on my device, it can run normally on:

My device

MacBook 12-inch Big Sur 11.0

Other M1 devices (Big Sur 11.0 or above)

But can not run on MacBook Pro Intel I7 Catalina 10.15.7. The issue here.

That is all I know.

答:
I have good experience building as a Unix executable and packaging as a Mac app, by using the instructions manual at
https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5

```<code>build Unix exec file
go build -o bin/{program} {program}
</code>```

Packaging the application on macOS (Big Sur) and installing it on macOS (High Sierra) was successful.

ContentLicense: CC BY-SA 4.0

Body:
I have good experience building as a Unix executable and packaging as a Mac app, by using the instructions manual at
https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5

build Unix exec file
go build -o bin/{program} {program}

Packaging the application on macOS (Big Sur) and installing it on macOS (High Sierra) was successful.


问:
boost::pool_allocator significantly slower than std::allocator
I am learning about memory pool, and trying to utilize boost::pool_allocator in my project. According to the documment, I made a small test about time cost:

template <typename Alloc>
void test()
{
    using namespace std::chrono;
    auto t0 = high_resolution_clock::now();
    for (int i = 0; i < 1000; ++i) {
        std::vector<int, Alloc> vec;
        for (int j = 0; j < 10000; ++j)
            vec.push_back(i + j);
    }
    auto t1 = high_resolution_clock::now();
    auto time_ms = duration<double>(t1 - t0).count() * 1e3;
    cout << "time cost: " << time_ms << " ms" << endl;
}

int main()
{
    test<std::allocator<int>>();
    test<boost::pool_allocator<int>>();
}
```
<p>And the result is:</p>
```time cost: 3.97602 ms
time cost: 91.3943 ms
```

The Boost doc says:

Pools are generally used when there is a lot of allocation and deallocation of small objects.

So I expect boost::pool_allocator cost less time than std::allocator in the code above, but the test result shows it's much worse.

Am I using boost::pool_allocator wrong? In what situation can I obtain a speedup by using memory pool (or just Boost pool/pool_allocator)?

答:
Pools are generally used when there is a lot of allocation and deallocation of small objects.

vector does not allocate "small objects". vector<T> allocates arrays. Or more specifically, a single array allocated in a slab of memory big enough to hold (at least) sizeof(T) * size bytes.

Pool allocators are fantastically bad at this allocation pattern.

Body:
I am learning about memory pool, and trying to utilize boost::pool_allocator in my project. According to the documment, I made a small test about time cost:

template <typename Alloc>
void test()
{
    using namespace std::chrono;
    auto t0 = high_resolution_clock::now();
    for (int i = 0; i < 1000; ++i) {
        std::vector<int, Alloc> vec;
        for (int j = 0; j < 10000; ++j)
            vec.push_back(i + j);
    }
    auto t1 = high_resolution_clock::now();
    auto time_ms = duration<double>(t1 - t0).count() * 1e3;
    cout << "time cost: " << time_ms << " ms" << endl;
}

int main()
{
    test<std::allocator<int>>();
    test<boost::pool_allocator<int>>();
}

And the result is:

time cost: 3.97602 ms
time cost: 91.3943 ms

The Boost doc says:

Pools are generally used when there is a lot of allocation and deallocation of small objects.

So I expect boost::pool_allocator cost less time than std::allocator in the code above, but the test result shows it's much worse.

Am I using boost::pool_allocator wrong? In what situation can I obtain a speedup by using memory pool (or just Boost pool/pool_allocator)?


问:
How to have a private Crude application in Laravel (Shows inputs created by specific user)
I am trying to create a job board, I am using Crud application for the cv part of the portal, i don want everyone to see other user's cvs.

So the user inputs his data, then only sees his data to apply, edit, show etc. A possible way is to add a created by, but I am not sure if it is the best option.

Users migration
<?php

```<code>use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->boolean('status')->default(1);
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
</code>```

cv migrations

```<code><?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCvTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cv', function (Blueprint $table) {
            $table->index('user_id');
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->string ('FName');
            $table->string ('Nationality');
            $table->string ('Residence');
            $table->string ('email');
            $table->string ('Phone');
            $table->string('DOB');
            $table->string ('Gender');
            $table->string ('EmploymentStatus');
            $table->string ('EducationLevel');
            $table->string ('MajorField');
            $table->string ('Major');
            $table->string ('university');
            $table->string ('GradCounrty');
            $table->string ('GPA');
            $table->string ('ProfCertifications');
            $table->string ('PrevJobTitle');
            $table->date('PrevJobStart');
            $table->date('PrefJobEnd');
            $table->integer('WorkExp');
            $table->string('fileCV');
            $table->boolean('status')->default(0);
            $table->boolean('trash')->default(0);
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cv');
    }
}
</code>```

CV controller

```<code><?php

namespace App\Http\Controllers;
use App\Models\cv;
use Illuminate\Http\Request;

class cvController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    function __construct()
    {
         $this->middleware('permission:cv-list|cv-create|cv-edit|cv-delete', ['only' => ['index', 'show']]);
         $this->middleware('permission:cv-create', ['only' => ['create', 'store']]);
         $this->middleware('permission:cv-edit', ['only' => ['edit', 'update']]);
         $this->middleware('permission:cv-delete', ['only' => ['destroy']]);
    }

    public function index(Request $request)
    {
        $data = cv::all();

        return view('cv.index',compact('data'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return view('cv.create');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $this->validate($request, [

            'FName' => 'required',

        ]);

        $input = $request->all();
        if ($image = $request->file('image')) {
            $imageDestinationPath = 'uploads/images/sliders';
            $postImage = date('YmdHis') . "." . $image->getClientOriginalExtension();
            $image->move($imageDestinationPath, $postImage);
            $input['image'] = "$postImage";
        }

        cv::create($input);

        return redirect()->route('cv.index')
            ->with('success','CV Upladed successfully.');
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        $cv = cv::find($id);

        return view('cv.show', compact('cv'));
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {

        $cv = cv::find($id);

        return view('cv.edit',compact('cv'));
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {

        $cv = cv::find($id);
        $this->validate($request, [

            'FName' => 'required',

        ]);

        $input=$request->all();
        if ($image = $request->file('image')) {
            $imageDestinationPath = 'uploads/images/sliders';
            $postImage = date('YmdHis') . "." . $image->getClientOriginalExtension();
            $image->move($imageDestinationPath, $postImage);
            //dd($path);
            $input['image'] = "$postImage";
        }
        else{
            unset($input['image']);
        }
        $cv->update($input);

        return redirect()->route('cv.index')
            ->with('success', 'CV updated successfully.');
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        cv::find($id)->delete();

        return redirect()->route('cv.index')
            ->with('success', 'CV deleted successfully.');
    }

    public $gender = [
        "0" => "Female",
        "1" => "Male",
    ];

}
</code>```

答:
when you use authentication you can retrieve info of each user by his token so you can get only his CVs by the id_user

this is the example without token

```<code>    public function example(Request $request)
{
    $data = cv::where('user_id', $request->user()->id)->get();
    return view('cv.index', compact('data'));
}
</code>```

this is the example with token and authentication

```<code>    public function example()
{
    $data = cv::where('user_id', auth()->user()->id)->get();
    return view('cv.index', compact('data'));
}
</code>```

Body:
I am trying to create a job board, I am using Crud application for the cv part of the portal, i don want everyone to see other user's cvs.

So the user inputs his data, then only sees his data to apply, edit, show etc. A possible way is to add a created by, but I am not sure if it is the best option.

Users migration
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->boolean('status')->default(1);
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}

cv migrations

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCvTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cv', function (Blueprint $table) {
            $table->index('user_id');
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->string ('FName');
            $table->string ('Nationality');
            $table->string ('Residence');
            $table->string ('email');
            $table->string ('Phone');
            $table->string('DOB');
            $table->string ('Gender');
            $table->string ('EmploymentStatus');
            $table->string ('EducationLevel');
            $table->string ('MajorField');
            $table->string ('Major');
            $table->string ('university');
            $table->string ('GradCounrty');
            $table->string ('GPA');
            $table->string ('ProfCertifications');
            $table->string ('PrevJobTitle');
            $table->date('PrevJobStart');
            $table->date('PrefJobEnd');
            $table->integer('WorkExp');
            $table->string('fileCV');
            $table->boolean('status')->default(0);
            $table->boolean('trash')->default(0);
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cv');
    }
}

CV controller

<?php

namespace App\Http\Controllers;
use App\Models\cv;
use Illuminate\Http\Request;

class cvController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    function __construct()
    {
         $this->middleware('permission:cv-list|cv-create|cv-edit|cv-delete', ['only' => ['index', 'show']]);
         $this->middleware('permission:cv-create', ['only' => ['create', 'store']]);
         $this->middleware('permission:cv-edit', ['only' => ['edit', 'update']]);
         $this->middleware('permission:cv-delete', ['only' => ['destroy']]);
    }

    public function index(Request $request)
    {
        $data = cv::all();

        return view('cv.index',compact('data'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return view('cv.create');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $this->validate($request, [

            'FName' => 'required',

        ]);

        $input = $request->all();
        if ($image = $request->file('image')) {
            $imageDestinationPath = 'uploads/images/sliders';
            $postImage = date('YmdHis') . "." . $image->getClientOriginalExtension();
            $image->move($imageDestinationPath, $postImage);
            $input['image'] = "$postImage";
        }

        cv::create($input);

        return redirect()->route('cv.index')
            ->with('success','CV Upladed successfully.');
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        $cv = cv::find($id);

        return view('cv.show', compact('cv'));
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {

        $cv = cv::find($id);

        return view('cv.edit',compact('cv'));
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {

        $cv = cv::find($id);
        $this->validate($request, [

            'FName' => 'required',

        ]);

        $input=$request->all();
        if ($image = $request->file('image')) {
            $imageDestinationPath = 'uploads/images/sliders';
            $postImage = date('YmdHis') . "." . $image->getClientOriginalExtension();
            $image->move($imageDestinationPath, $postImage);
            //dd($path);
            $input['image'] = "$postImage";
        }
        else{
            unset($input['image']);
        }
        $cv->update($input);

        return redirect()->route('cv.index')
            ->with('success', 'CV updated successfully.');
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        cv::find($id)->delete();

        return redirect()->route('cv.index')
            ->with('success', 'CV deleted successfully.');
    }

    public $gender = [
        "0" => "Female",
        "1" => "Male",
    ];

}

Body:
when you use authentication you can retrieve info of each user by his token so you can get only his CVs by the id_user

this is the example without token

    public function example(Request $request)
{
    $data = cv::where('user_id', $request->user()->id)->get();
    return view('cv.index', compact('data'));
}

this is the example with token and authentication

    public function example()
{
    $data = cv::where('user_id', auth()->user()->id)->get();
    return view('cv.index', compact('data'));
}


问:
WIX not converting virtual directory to web application
I am using the following code to install a web application. It creates the virtual directory just fine, but doesn't convert the virtual directory in application. I am running IIS 7
I have searched a lot but couldn't find anything different in order to make an application of virtual directory. Can someone point what's wrong with the following code?</p>

```<code>    <Component Id="WebAppVDirComponent"
               Guid="C7A4B0E8-2389-4A2A-B285-96960BEE1C51"
               KeyPath="yes">
      <iis:WebVirtualDir Id="VDir"
                         Alias="[WEB_APP_NAME]"
                         Directory="INSTALLDIR"
                         WebSite="TheWebSite" >

        <!-- Turn the Virtual Directory into a web application. -->
        <iis:WebApplication Id="WebApplication"
                            Name="[WEB_APP_NAME])"
                            WebAppPool="TheAppPool"/>
      </iis:WebVirtualDir>
      <CreateFolder/>
    </Component>
</code>```

答:
Try this out. This is working perfectly fine for me.</p>

```<code><Component Id="VDProductCenter" Guid="493E3487-AA4C-4476-8CC0-4B1C763AF6F7" Permanent="no">
  <File Id="Dummy" KeyPath="yes" Name="Dummy.txt" Source="Files/dummy.txt"></File>
  <iis:WebVirtualDir Id="PCVDir" Alias="[VDNAME]" Directory="dir_Application_0" WebSite="PCWebSelectedWebSite">
    <iis:WebApplication Id="PCWebApp" Name="[VDNAME]" />
  </iis:WebVirtualDir>
  <RegistryKey Root="HKLM" Action="createAndRemoveOnUninstall" Key="SOFTWARE\CompanyName\[ProductCode]\VirtualDirectory">
    <RegistryValue Name="VDName" Type="string" Value="[VDNAME]"/>
  </RegistryKey>
</Component>
<Component Id="PersistWebSiteValues" Guid="C3DAE2E2-FB49-48ba-ACB0-B2B5B726AE65" Permanent="no">
  <File Id="Dummy1" KeyPath="yes" Name="Dummy1.txt" Source="Files/dummy.txt"></File>
  <RegistryKey Root="HKLM" Action="createAndRemoveOnUninstall" Key="SOFTWARE\CompanyName\[ProductCode]\WebSiteValues">
    <RegistryValue Name="WebSiteDescription" Type="string" Value="[WEB_WEBSITE_DESCRIPTION]"/>
    <RegistryValue Name="WebSitePort" Type="string" Value="[WEB_WEBSITE_PORT]"/>
    <RegistryValue Name="WebSiteIP" Type="string" Value="[WEB_WEBSITE_IP]"/>
    <RegistryValue Name="WebSiteHeader" Type="string" Value="[WEB_WEBSITE_HEADER]"/>
  </RegistryKey>
</Component>

<iis:WebSite Id="PCWebSelectedWebSite" Description="[PCWEB_WEBSITE_DESCRIPTION]">
    <iis:WebAddress Id="AllUnassigned1" Port="[WEB_WEBSITE_PORT]" IP="[WEB_WEBSITE_IP]" Header="[WEB_WEBSITE_HEADER]" />
</iis:WebSite>
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I am using the following code to install a web application. It creates the virtual directory just fine, but doesn't convert the virtual directory in application. I am running IIS 7
I have searched a lot but couldn't find anything different in order to make an application of virtual directory. Can someone point what's wrong with the following code?

    <Component Id="WebAppVDirComponent"
               Guid="C7A4B0E8-2389-4A2A-B285-96960BEE1C51"
               KeyPath="yes">
      <iis:WebVirtualDir Id="VDir"
                         Alias="[WEB_APP_NAME]"
                         Directory="INSTALLDIR"
                         WebSite="TheWebSite" >

        <iis:WebApplication Id="WebApplication"
                            Name="[WEB_APP_NAME])"
                            WebAppPool="TheAppPool"/>
      </iis:WebVirtualDir>
      <CreateFolder/>
    </Component>

Body:
Try this out. This is working perfectly fine for me.

<Component Id="VDProductCenter" Guid="493E3487-AA4C-4476-8CC0-4B1C763AF6F7" Permanent="no">
  <File Id="Dummy" KeyPath="yes" Name="Dummy.txt" Source="Files/dummy.txt"></File>
  <iis:WebVirtualDir Id="PCVDir" Alias="[VDNAME]" Directory="dir_Application_0" WebSite="PCWebSelectedWebSite">
    <iis:WebApplication Id="PCWebApp" Name="[VDNAME]" />
  </iis:WebVirtualDir>
  <RegistryKey Root="HKLM" Action="createAndRemoveOnUninstall" Key="SOFTWARE\CompanyName\[ProductCode]\VirtualDirectory">
    <RegistryValue Name="VDName" Type="string" Value="[VDNAME]"/>
  </RegistryKey>
</Component>
<Component Id="PersistWebSiteValues" Guid="C3DAE2E2-FB49-48ba-ACB0-B2B5B726AE65" Permanent="no">
  <File Id="Dummy1" KeyPath="yes" Name="Dummy1.txt" Source="Files/dummy.txt"></File>
  <RegistryKey Root="HKLM" Action="createAndRemoveOnUninstall" Key="SOFTWARE\CompanyName\[ProductCode]\WebSiteValues">
    <RegistryValue Name="WebSiteDescription" Type="string" Value="[WEB_WEBSITE_DESCRIPTION]"/>
    <RegistryValue Name="WebSitePort" Type="string" Value="[WEB_WEBSITE_PORT]"/>
    <RegistryValue Name="WebSiteIP" Type="string" Value="[WEB_WEBSITE_IP]"/>
    <RegistryValue Name="WebSiteHeader" Type="string" Value="[WEB_WEBSITE_HEADER]"/>
  </RegistryKey>
</Component>

<iis:WebSite Id="PCWebSelectedWebSite" Description="[PCWEB_WEBSITE_DESCRIPTION]">
    <iis:WebAddress Id="AllUnassigned1" Port="[WEB_WEBSITE_PORT]" IP="[WEB_WEBSITE_IP]" Header="[WEB_WEBSITE_HEADER]" />
</iis:WebSite>


问:
Access object values in array nested in JSON object
I have a GET request that sends back a JSON object structured like this:

```<code>{"ID":5176,
"DateFrom":"8/29/2018",
"DateTo":"8/29/2018",
"Units":[{"Key":"Value","Key2": "Value2"}]
}
</code>```

I cannot access Units[0] value.  I have tried the following:

```<code>testFunction(){
this.service.getJSON(params)
.subscribe((data) => {
  this.model = data;
  this.dateFrom = this.model.DateFrom;
  this.dateTo = this.model.DateTo;
  this.unit = this.model.Units.Key;
  console.log(this.unit); //undefined
  });
 }
}
ngOnInit() {
this.testFunction();

}
</code>```

What am I missing?

答:
Since Units is an array of JSONs and the array contains only one element.
It should be accessed by Units[0].

Units[0] is now a JSON, Key property is needed now.
There are 2 ways to access it

Units[0].Key

Units[0]['Key']

The final code should look like

testFunction(){
this.service.getJSON(params)
.subscribe((data) => {
  this.model = data;
  this.dateFrom = this.model.DateFrom;
  this.dateTo = this.model.DateTo;
  //first method
  //this.unit = this.model.Units[0].Key;
  // second method
  // this.unit = this.model.Units[0]['Key'];

  console.log(this.unit); //undefined
  });
 }
}
ngOnInit() {
this.testFunction();

}```

Body:
I have a GET request that sends back a JSON object structured like this:

{"ID":5176,
"DateFrom":"8/29/2018",
"DateTo":"8/29/2018",
"Units":[{"Key":"Value","Key2": "Value2"}]
}

I cannot access Units[0] value.  I have tried the following:

testFunction(){
this.service.getJSON(params)
.subscribe((data) => {
  this.model = data;
  this.dateFrom = this.model.DateFrom;
  this.dateTo = this.model.DateTo;
  this.unit = this.model.Units.Key;
  console.log(this.unit); //undefined
  });
 }
}
ngOnInit() {
this.testFunction();

}

What am I missing?


问:
JSON output format for Hive Query results
Is there any way to convert the Hive query result in JSON format?</p>

答:
Top answer works. However I'm a bit too lazy to explicitly convert to named_struct with all the column names. Also brickhouse UDF crashes when I use create table as select. To solve this issue, I developed a similar UDF which can support select to_json(*) from tbl;

Usage:

ADD JAR ivy://org.jsonex:HiveUDF:0.1.22?transitive=true;
CREATE TEMPORARY FUNCTION to_json AS 'org.jsonex.hiveudf.ToJsonUDF';
SELECT to_json(*) FROM tbl
```


问:
Replace values from a string if they are present in an array of variables
Having the following array of objects:

```<code>const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' }
];
</code>```

And the input string:

```<code>const inputString = `Hi, my name is %NAME%, I like %HOBBY%, you can contact me at %EMAIL%`;
</code>```

The function should take as arguments variables and inputString and return the following sting:

```<code>'Hi, my name is joe, I like tennis, you can contact me at joe@mail.com'
</code>```

Here is the function so far:

```<code>function doMagic(variables, inputString) {
  let output = inputString;
  for (let i = 0; i < variables.length; i++) {
     output = inputString.replace(variables[i].name, variables[i].value);
  }
  return output;
}
</code>```

Unfortunatelly, this only finds one occurrence, in case there are more, and it doesn't go into nested variables, like %EMAIL%.

Any ideas to improve?

答:
You can use replaceAll method to replace all the occurrence and loop twice.</p>
```<code>function doMagic(variables, inputString) {
  let output = inputString;
  for (let i = 0; i < variables.length; i++) {
     output = output.replaceAll(variables[i].name, variables[i].value);
  }
  for (let i = 0; i < variables.length; i++) {
     output = output.replaceAll(variables[i].name, variables[i].value);
  }
  return output;
}
</code>```

Body:
Having the following array of objects:

const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' }
];

And the input string:

const inputString = `Hi, my name is %NAME%, I like %HOBBY%, you can contact me at %EMAIL%`;

The function should take as arguments variables and inputString and return the following sting:

'Hi, my name is joe, I like tennis, you can contact me at joe@mail.com'

Here is the function so far:

function doMagic(variables, inputString) {
  let output = inputString;
  for (let i = 0; i < variables.length; i++) {
     output = inputString.replace(variables[i].name, variables[i].value);
  }
  return output;
}

Unfortunatelly, this only finds one occurrence, in case there are more, and it doesn't go into nested variables, like %EMAIL%.

Any ideas to improve?

Body:
You can use replaceAll method to replace all the occurrence and loop twice.

function doMagic(variables, inputString) {
  let output = inputString;
  for (let i = 0; i < variables.length; i++) {
     output = output.replaceAll(variables[i].name, variables[i].value);
  }
  for (let i = 0; i < variables.length; i++) {
     output = output.replaceAll(variables[i].name, variables[i].value);
  }
  return output;
}


问:
vb6 array with -1 for upper bound
Some functions such as Split() will return an array with -1 for the upper bound and zero for the lower bound if the array has no items, eg:

```<code>Dim s() As String
s = Split("", ",")
Debug.Print UBound(s)
Debug.Pring LBound(s)
</code>```

In this case UBound(s) will equal -1 and LBound(s) will equal 0. I have a fair amount of code checking for -1 on the upper bound to see if the array has values or not. This works great.

The problem is that I now want to change the array data type from string to long. I cannot seem to create an array of longs with an upper bound of -1 and a lower bound of 0, and the Split() and Join() functions only operate on string arrays.

I would like to be able to return a long array with an upper bound of -1. Is this possible?

答:
You could write your own split function to do this:</p>

```<code>Private Sub SplitLongs(ByVal strData As String, ByRef lng() As Long)
    Dim i As Integer
    Dim s() As String
    s = Split(strData, ",")
    If UBound(s) = -1 Then
        ReDim lng(-1 To -1)
    Else
        ReDim lng(LBound(s) To UBound(s))
        For i = LBound(s) To UBound(s)
            If IsNumeric(s(i)) Then lng(i) = s(i)
        Next
    End If
End Sub
</code>```

Title: vb6 array with -1 for upper bound

Body:
Some functions such as Split() will return an array with -1 for the upper bound and zero for the lower bound if the array has no items, eg:

Dim s() As String
s = Split("", ",")
Debug.Print UBound(s)
Debug.Pring LBound(s)

In this case UBound(s) will equal -1 and LBound(s) will equal 0. I have a fair amount of code checking for -1 on the upper bound to see if the array has values or not. This works great.

The problem is that I now want to change the array data type from string to long. I cannot seem to create an array of longs with an upper bound of -1 and a lower bound of 0, and the Split() and Join() functions only operate on string arrays.

I would like to be able to return a long array with an upper bound of -1. Is this possible?

Body:
You could write your own split function to do this:

Private Sub SplitLongs(ByVal strData As String, ByRef lng() As Long)
    Dim i As Integer
    Dim s() As String
    s = Split(strData, ",")
    If UBound(s) = -1 Then
        ReDim lng(-1 To -1)
    Else
        ReDim lng(LBound(s) To UBound(s))
        For i = LBound(s) To UBound(s)
            If IsNumeric(s(i)) Then lng(i) = s(i)
        Next
    End If
End Sub


问:
React-tooltip displays twice when using MUI icon
Whenever I add a tooltip to an SVG (using react-toolip), the tooltip shows twice:

The Code:

```<code><HelpIcon data-tip='This field represents all sales (or revenues) generated by the company.'></HelpIcon>
<ReactTooltip effect='solid' place='left' multiline={true}/>
</code>```

While using the HelpIcon from @mui:

```<code>import HelpIcon from '@mui/icons-material/Help';
import ReactTooltip from 'react-tooltip';
</code>```

答:
To solve this, define the data-for attribute and the id for the regarding tooltip:</p>
```<code><div data-tip='This field represents all sales (or revenues) generated by the company.' data-for='questionMarkToolTip'>
    <HelpIcon></HelpIcon>
    <ReactTooltip effect='solid' place='left' multiline={true} id='questionMarkToolTip'/>
</div>
</code>```

Body:
Whenever I add a tooltip to an SVG (using react-toolip), the tooltip shows twice:

The Code:

<HelpIcon data-tip='This field represents all sales (or revenues) generated by the company.'></HelpIcon>
<ReactTooltip effect='solid' place='left' multiline={true}/>

While using the HelpIcon from @mui:

import HelpIcon from '@mui/icons-material/Help';
import ReactTooltip from 'react-tooltip';

Body:
To solve this, define the data-for attribute and the id for the regarding tooltip:

<div data-tip='This field represents all sales (or revenues) generated by the company.' data-for='questionMarkToolTip'>
    <HelpIcon></HelpIcon>
    <ReactTooltip effect='solid' place='left' multiline={true} id='questionMarkToolTip'/>
</div>


问:
Parallel execution using TestNg Selenium in a POM framework overwriting the data object class
I am trying to run two test classes in parallel both are using data providers pointing to different excel sheets. Sequentially it runs fine, but while running it in parallel it seems like the test object class which is holding all the test data is getting overwritten. Below is the data provider

Class 1

```<code>  @DataProvider(name = "tradeData"  )
   public Object[][] createMessage() {
   return ExcelUtils
    .getDataFromExcelSheet("TestSheet1", LOADTESTDATAPROVIDER);
    }}
</code>```

Class 2

```<code> @DataProvider(name = "tradeData")
   public Object[][] createMessage() {
   return ExcelUtils
    .getDataFromExcelSheet("TestSheet2", LOADTESTDATAPROVIDER);
    }
</code>```

The data is being returned correctly from the excel but it seems like it is getting overwritten when placed into the object class. The data object class is being initialized from both test classes something like this

```<code> @Test(dataProvider = "tradeData")
  public void connectAndPushMessage(String sellerName,
   String buyerName,
   String SIN){

testMessage tMessage = new testMessage();
tMessage.setSellerName(sellerName);
tMessage.setBuyerName(buyerName);
tMessage.setSIN(SIN);
    }
</code>```

Below is the testng.xml that I have used.

```<code><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
  <suite name="Parallel Testing" parallel="classes" thread-count="2">
    <test name="Test run 1">
    <classes>
        <class name="test.xxx.performance.InjectTrades_TestRun1"/>
        <class name="test.xxx.performance.InjectTrades_TestRun2"/>
    </classes>
  </test>
 </suite>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
  <suite name="Parallel Testing" parallel="tests" thread-count="2">
     <test name="Test run 1">
       <classes>
         <class name="test.xxx.performance.InjectTrades_TestRun1"/>
        </classes>
     </test>

<test name="test run 2">
    <classes>
  <class name="test.xxx.performance.InjectTrades_TestRun2"/>
    </classes>
</test>
</code>```

I am getting the same result from both xmls so rather six distinct messages being created/pushed into the system(based on two excel sheets) the code is pushing three distinct messages repeated twice. I was/am under the impression that testNg should have take care of this as both classes/tests are running as separate threads.

EDIT
Below is the snippet of the Test object class. All attributes are declared private

```<code>public class testMessage{

private String currentBusinessDate;
private String sellerName = "";
private String buyerName= "";
private String sin= "";
....
public testMessage() {
cTradeID = "T" + CommonUtils.randomNumber(12);
sRef = CommonUtils.randomNumber(12);
requestId = "1" + CommonUtils.randomNumber(5);
settlementRequestStateCode = "New";
currencyTypeCode = "USD";
 }

public String getCurrentBusinessDate() {
return currentBusinessDate;
  }

public void setCurrentBusinessDate(String currentBusinessDate) {
this.currentBusinessDate = currentBusinessDate;
}
 public String getsellerName () {
return currentBusinessDate;
}

 public void setsellerName (String currentBusinessDate) {
  this.currentBusinessDate = currentBusinessDate;
 }
 public String getBuyerName () {
  return currentBusinessDate;
  }

  public void setBuyerName (String currentBusinessDate) {
   this.currentBusinessDate = currentBusinessDate;
   }
   ....
</code>```

答:
Used TestNG version is not mentioned, also ExcelUtils.getDataFromExcelSheet implementation is not shared, but both these 2 things might be related to such unexpected behavior.

I'm going to share my experiment result in order to confirm, that there is no issue with the TestNG parallelization itself, at least for TestNG 7.5.

Test Class 1

```<code>class T1 {

    @Test(dataProvider = "tradeData")
    public void connectAndPushMessage(String arg) {
        System.out.println(arg);
    }

    @DataProvider(name = "tradeData")
    public Object[][] createMessage() {
        return new Object[]{
                { "T1.createMessage-data-1" },
                { "T1.createMessage-data-2" },
                { "T1.createMessage-data-3" },
        };
    }
}
</code>```

Test Class 2

```<code>class T2 {

    @Test(dataProvider = "tradeData")
    public void connectAndPushMessage(String arg) {
        System.out.println(arg);
    }

    @DataProvider(name = "tradeData")
    public Object[][] createMessage() {
        return new Object[]{
                { "T2.createMessage-data-1" },
                { "T2.createMessage-data-2" },
                { "T2.createMessage-data-3" },
        };
    }
}
</code>```

testng.xml

```<code><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel Testing" parallel="tests" thread-count="2">
    <test name="Test run 1">
        <classes>
            <class name="samples.T1"/>
        </classes>
    </test>

    <test name="test run 2">
        <classes>
            <class name="samples.T2"/>
        </classes>
    </test>
</suite>
</code>```

Output:

```<code>T1.createMessage-data-1
T2.createMessage-data-1
T2.createMessage-data-2
T1.createMessage-data-2
T2.createMessage-data-3
T1.createMessage-data-3
</code>```

The same for

```<code><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel Testing" parallel="classes" thread-count="2">
    <test name="Test run 1">
        <classes>
            <class name="samples.T1"/>
            <class name="samples.T2"/>
        </classes>
    </test>
</suite>
</code>```

Try to recheck this with TestNG 7.5, and look at your ExcelUtils.getDataFromExcelSheet method implementation, it should be thread-safe.

Body:
I am trying to run two test classes in parallel both are using data providers pointing to different excel sheets. Sequentially it runs fine, but while running it in parallel it seems like the test object class which is holding all the test data is getting overwritten. Below is the data provider

Class 1

  @DataProvider(name = "tradeData"  )
   public Object[][] createMessage() {
   return ExcelUtils
    .getDataFromExcelSheet("TestSheet1", LOADTESTDATAPROVIDER);
    }}

Class 2

 @DataProvider(name = "tradeData")
   public Object[][] createMessage() {
   return ExcelUtils
    .getDataFromExcelSheet("TestSheet2", LOADTESTDATAPROVIDER);
    }

The data is being returned correctly from the excel but it seems like it is getting overwritten when placed into the object class. The data object class is being initialized from both test classes something like this

 @Test(dataProvider = "tradeData")
  public void connectAndPushMessage(String sellerName,
   String buyerName,
   String SIN){

testMessage tMessage = new testMessage();
tMessage.setSellerName(sellerName);
tMessage.setBuyerName(buyerName);
tMessage.setSIN(SIN);
    }

Below is the testng.xml that I have used.

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
  <suite name="Parallel Testing" parallel="classes" thread-count="2">
    <test name="Test run 1">
    <classes>
        <class name="test.xxx.performance.InjectTrades_TestRun1"/>
        <class name="test.xxx.performance.InjectTrades_TestRun2"/>
    </classes>
  </test>
 </suite>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
  <suite name="Parallel Testing" parallel="tests" thread-count="2">
     <test name="Test run 1">
       <classes>
         <class name="test.xxx.performance.InjectTrades_TestRun1"/>
        </classes>
     </test>

<test name="test run 2">
    <classes>
  <class name="test.xxx.performance.InjectTrades_TestRun2"/>
    </classes>
</test>

I am getting the same result from both xmls so rather six distinct messages being created/pushed into the system(based on two excel sheets) the code is pushing three distinct messages repeated twice. I was/am under the impression that testNg should have take care of this as both classes/tests are running as separate threads.

EDIT
Below is the snippet of the Test object class. All attributes are declared private

public class testMessage{

private String currentBusinessDate;
private String sellerName = "";
private String buyerName= "";
private String sin= "";
....
public testMessage() {
cTradeID = "T" + CommonUtils.randomNumber(12);
sRef = CommonUtils.randomNumber(12);
requestId = "1" + CommonUtils.randomNumber(5);
settlementRequestStateCode = "New";
currencyTypeCode = "USD";
 }

public String getCurrentBusinessDate() {
return currentBusinessDate;
  }

public void setCurrentBusinessDate(String currentBusinessDate) {
this.currentBusinessDate = currentBusinessDate;
}
 public String getsellerName () {
return currentBusinessDate;
}

 public void setsellerName (String currentBusinessDate) {
  this.currentBusinessDate = currentBusinessDate;
 }
 public String getBuyerName () {
  return currentBusinessDate;
  }

  public void setBuyerName (String currentBusinessDate) {
   this.currentBusinessDate = currentBusinessDate;
   }
   ....

Body:
Used TestNG version is not mentioned, also ExcelUtils.getDataFromExcelSheet implementation is not shared, but both these 2 things might be related to such unexpected behavior.

I'm going to share my experiment result in order to confirm, that there is no issue with the TestNG parallelization itself, at least for TestNG 7.5.

Test Class 1

class T1 {

    @Test(dataProvider = "tradeData")
    public void connectAndPushMessage(String arg) {
        System.out.println(arg);
    }

    @DataProvider(name = "tradeData")
    public Object[][] createMessage() {
        return new Object[]{
                { "T1.createMessage-data-1" },
                { "T1.createMessage-data-2" },
                { "T1.createMessage-data-3" },
        };
    }
}

Test Class 2

class T2 {

    @Test(dataProvider = "tradeData")
    public void connectAndPushMessage(String arg) {
        System.out.println(arg);
    }

    @DataProvider(name = "tradeData")
    public Object[][] createMessage() {
        return new Object[]{
                { "T2.createMessage-data-1" },
                { "T2.createMessage-data-2" },
                { "T2.createMessage-data-3" },
        };
    }
}

testng.xml

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel Testing" parallel="tests" thread-count="2">
    <test name="Test run 1">
        <classes>
            <class name="samples.T1"/>
        </classes>
    </test>

    <test name="test run 2">
        <classes>
            <class name="samples.T2"/>
        </classes>
    </test>
</suite>

Output:

T1.createMessage-data-1
T2.createMessage-data-1
T2.createMessage-data-2
T1.createMessage-data-2
T2.createMessage-data-3
T1.createMessage-data-3

The same for

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Parallel Testing" parallel="classes" thread-count="2">
    <test name="Test run 1">
        <classes>
            <class name="samples.T1"/>
            <class name="samples.T2"/>
        </classes>
    </test>
</suite>

Try to recheck this with TestNG 7.5, and look at your ExcelUtils.getDataFromExcelSheet method implementation, it should be thread-safe.