datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

Gatsby Datocms Validating Engine Failed During Build #170

Closed omarshah0 closed 1 year ago

omarshah0 commented 2 years ago

While running gatsby build, it failed during "Engine Validation".

2:30:16 PM: Build ready to start 2:30:18 PM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0 2:30:18 PM: build-image tag: v4.3.2 2:30:18 PM: buildbot version: 65411f2e7f69c7fa96d0462983efb6ddda1b2bc8 2:30:18 PM: Fetching cached dependencies 2:30:19 PM: Failed to fetch cache, continuing with build 2:30:19 PM: Starting to prepare the repo for build 2:30:19 PM: No cached dependencies found. Cloning fresh repo 2:30:19 PM: git clone https://github.com/omarshah0/hussain-blog-test 2:30:19 PM: Preparing Git Reference refs/heads/master 2:30:20 PM: Parsing package.json dependencies 2:30:20 PM: Starting build script 2:30:21 PM: Installing dependencies 2:30:21 PM: Python version set to 2.7 2:30:21 PM: Downloading and installing node v16.12.0... 2:30:21 PM: Downloading https://nodejs.org/dist/v16.12.0/node-v16.12.0-linux-x64.tar.xz... 2:30:22 PM: Computing checksum with sha256sum 2:30:22 PM: Checksums matched! 2:30:25 PM: Now using node v16.12.0 (npm v8.1.0) 2:30:26 PM: Started restoring cached build plugins 2:30:26 PM: Finished restoring cached build plugins 2:30:26 PM: Attempting ruby version 2.7.2, read from environment 2:30:27 PM: Using ruby version 2.7.2 2:30:28 PM: Using PHP version 8.0 2:30:28 PM: Started restoring cached node modules 2:30:28 PM: Finished restoring cached node modules 2:30:28 PM: Installing NPM modules using NPM version 8.1.0 2:30:31 PM: npm WARN old lockfile 2:30:31 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm, 2:30:31 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry. 2:30:31 PM: npm WARN old lockfile 2:30:31 PM: npm WARN old lockfile This is a one-time fix-up, please be patient... 2:30:31 PM: npm WARN old lockfile 2:31:11 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported 2:31:17 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated 2:31:18 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated 2:31:22 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 2:31:24 PM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. 2:31:25 PM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. 2:31:35 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained 2:31:35 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained 2:31:35 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address' 2:31:38 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained 2:31:46 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi' 2:31:49 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. 2:32:02 PM: npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. 2:32:17 PM: added 1993 packages, and audited 1994 packages in 2m 2:32:17 PM: 269 packages are looking for funding 2:32:17 PM: run npm fund for details 2:32:17 PM: 45 vulnerabilities (11 moderate, 32 high, 2 critical) 2:32:17 PM: To address issues that do not require attention, run: 2:32:17 PM: npm audit fix 2:32:17 PM: To address all issues (including breaking changes), run: 2:32:17 PM: npm audit fix --force 2:32:17 PM: Run npm audit for details. 2:32:17 PM: NPM modules installed 2:32:18 PM: Started restoring cached go cache 2:32:18 PM: Finished restoring cached go cache 2:32:18 PM: go version go1.16.5 linux/amd64 2:32:18 PM: go version go1.16.5 linux/amd64 2:32:18 PM: Installing missing commands 2:32:18 PM: Verify run directory 2:32:19 PM: ​ 2:32:19 PM: ──────────────────────────────────────────────────────────────── 2:32:19 PM: Netlify Build
2:32:19 PM: ──────────────────────────────────────────────────────────────── 2:32:19 PM: ​ 2:32:19 PM: ❯ Version 2:32:19 PM: @netlify/build 18.17.6 2:32:19 PM: ​ 2:32:19 PM: ❯ Flags 2:32:19 PM: baseRelDir: true 2:32:19 PM: buildId: 61767928d1fb6b1d4e613dfb 2:32:19 PM: deployId: 61767928d1fb6b1d4e613dfd 2:32:19 PM: ​ 2:32:19 PM: ❯ Current directory 2:32:19 PM: /opt/build/repo 2:32:19 PM: ​ 2:32:19 PM: ❯ Config file 2:32:19 PM: No config file was defined: using default values. 2:32:19 PM: ​ 2:32:19 PM: ❯ Context 2:32:19 PM: production 2:32:20 PM: ​ 2:32:20 PM: ❯ Installing plugins 2:32:20 PM: - @netlify/plugin-gatsby@1.0.3 2:32:26 PM: ​ 2:32:26 PM: ❯ Loading plugins 2:32:26 PM: - @netlify/plugin-gatsby@1.0.3 from Netlify app 2:32:26 PM: ​ 2:32:26 PM: ──────────────────────────────────────────────────────────────── 2:32:26 PM: 1. @netlify/plugin-gatsby (onPreBuild event)
2:32:26 PM: ──────────────────────────────────────────────────────────────── 2:32:26 PM: ​ 2:32:27 PM: No Gatsby cache found. Building fresh. 2:32:27 PM: Add gatsby-plugin-netlify to gatsby-config.js if you would like to support Gatsby redirects. 🎉 2:32:27 PM: ​ 2:32:27 PM: (@netlify/plugin-gatsby onPreBuild completed in 245ms) 2:32:27 PM: ​ 2:32:27 PM: ──────────────────────────────────────────────────────────────── 2:32:27 PM: 2. Build command from Netlify app
2:32:27 PM: ──────────────────────────────────────────────────────────────── 2:32:27 PM: ​ 2:32:27 PM: $ npm run build 2:32:27 PM: > gatsby-starter-default@0.1.0 build 2:32:27 PM: > gatsby build 2:32:31 PM: success open and validate gatsby-configs, load plugins - 1.428s 2:32:31 PM: success onPreInit - 0.008s 2:32:32 PM: success initialize cache - 0.307s 2:32:32 PM: success copy gatsby files - 0.107s 2:32:32 PM: success Compiling Gatsby Functions - 0.417s 2:32:32 PM: success onPreBootstrap - 0.428s 2:32:33 PM: success loading DatoCMS schema - 0.750s 2:32:33 PM: success createSchemaCustomization - 0.849s 2:32:37 PM: success loading DatoCMS content - 3.281s 2:32:37 PM: success Checking for changed pages - 0.000s 2:32:37 PM: success source and transform nodes - 3.613s 2:32:37 PM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql 2:32:40 PM: success building schema - 3.273s 2:32:40 PM: success createPages - 0.021s 2:32:40 PM: success createPagesStatefully - 0.259s 2:32:40 PM: info Total nodes: 77, SitePage nodes: 7 (use --verbose for breakdown) 2:32:40 PM: success Checking for changed pages - 0.000s 2:32:40 PM: success onPreExtractQueries - 0.000s 2:32:45 PM: success loading DatoCMS schema - 0.000s 2:32:45 PM: success loading DatoCMS schema - 0.000s 2:32:45 PM: success loading DatoCMS schema - 0.000s 2:32:46 PM: success extract queries from components - 5.381s 2:32:46 PM: success write out redirect data - 0.001s 2:32:46 PM: success Build manifest and related icons - 0.529s 2:32:46 PM: success onPostBootstrap - 0.533s 2:32:46 PM: info bootstrap finished - 19.215s 2:32:46 PM: success write out requires - 0.007s 2:33:02 PM: success Building production JavaScript and CSS bundles - 16.095s 2:33:34 PM: success Building Rendering Engines - 31.195s 2:33:56 PM: success Building HTML renderer - 22.532s 2:33:58 PM: warning Native extraction module not loaded, msgpackr will still run, but with decreased performance. Generated engines use disallowed import "msgpackr-extract". Only allowed imports are to Node.js builtin modules or engines internals. 2:33:58 PM: error "gatsby-source-datocms" threw an error while running the createSchemaCustomization lifecycle: 2:33:58 PM: ENOENT: no such file or directory, mkdir '//.cache/datocms-assets' 2:33:58 PM: 2:33:58 PM: 2:33:58 PM: Error: ENOENT: no such file or directory, mkdir '//.cache/datocms-assets' 2:33:58 PM:
2:33:58 PM: - node:fs:1334 Object.mkdirSync 2:33:58 PM: node:fs:1334:3 2:33:58 PM:
2:33:58 PM: - index.js:361786 _callee$ 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:361786:18 2:33:58 PM:
2:33:58 PM: - index.js:309935 tryCatch 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:309935:40 2:33:58 PM:
2:33:58 PM: - index.js:310166 Generator.invoke [as _invoke] 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:310166:22 2:33:58 PM:
2:33:58 PM: - index.js:309991 Generator.next 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:309991:21 2:33:58 PM:
2:33:58 PM: - index.js:361731 asyncGeneratorStep 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:361731:103 2:33:58 PM:
2:33:58 PM: - index.js:361733 _next 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:361733:194 2:33:58 PM:
2:33:58 PM: - index.js:361733 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:361733:364 2:33:58 PM:
2:33:58 PM: - new Promise 2:33:58 PM:
2:33:58 PM: - index.js:361733 Module. 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:361733:97 2:33:58 PM:
2:33:58 PM: - index.js:361822 Module. 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:361822:18 2:33:58 PM:
2:33:58 PM: - index.js:210326 runAPI 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:210326:37 2:33:58 PM:
2:33:58 PM: - index.js:210477 Promise.catch.decorateEvent.pluginName 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:210477:17 2:33:58 PM:
2:33:58 PM: - index.js:213761 Promise._execute 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:213761:9 2:33:58 PM:
2:33:58 PM: - index.js:211787 Promise._resolveFromExecutor 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:211787:18 2:33:58 PM:
2:33:58 PM: - index.js:211372 new Promise 2:33:58 PM: /opt/build/repo/.cache/query-engine/index.js:211372:10 2:33:58 PM:
2:33:58 PM: 2:33:58 PM: failed Validating Rendering Engines - 1.978s 2:33:58 PM: error Built Rendering Engines failed validation failed validation. 2:33:58 PM: Please open an issue with a reproduction at https://github.com/gatsbyjs/gatsby/issues/new for more help 2:33:58 PM: 2:33:58 PM: 2:33:58 PM: Error: Worker exited before finishing task 2:33:58 PM:
2:33:58 PM: - index.js:112 ChildProcess. 2:33:58 PM: [repo]/[gatsby-worker]/dist/index.js:112:45 2:33:58 PM:
2:33:58 PM: - node:events:390 ChildProcess.emit 2:33:58 PM: node:events:390:28 2:33:58 PM:
2:33:58 PM: - child_process:290 Process.ChildProcess._handle.onexit 2:33:58 PM: node:internal/child_process:290:12 2:33:58 PM:
2:33:58 PM: 2:33:58 PM: ​ 2:33:58 PM: ──────────────────────────────────────────────────────────────── 2:33:58 PM: "build.command" failed
2:33:58 PM: ──────────────────────────────────────────────────────────────── 2:33:58 PM: ​ 2:33:58 PM: Error message 2:33:58 PM: Command failed with exit code 1: npm run build 2:33:58 PM: ​ 2:33:58 PM: Error location 2:33:58 PM: In Build command from Netlify app: 2:33:58 PM: npm run build 2:33:58 PM: ​ 2:33:58 PM: Resolved config 2:33:58 PM: build: 2:33:58 PM: command: npm run build 2:33:58 PM: commandOrigin: ui 2:33:58 PM: publish: /opt/build/repo/public 2:33:58 PM: publishOrigin: ui 2:33:58 PM: plugins: 2:33:58 PM: - inputs: {} 2:33:58 PM: origin: ui 2:33:58 PM: package: '@netlify/plugin-gatsby' 2:33:59 PM: Caching artifacts 2:33:59 PM: Started saving node modules 2:33:59 PM: Finished saving node modules 2:33:59 PM: Started saving build plugins 2:33:59 PM: Finished saving build plugins 2:33:59 PM: Started saving pip cache 2:33:59 PM: Finished saving pip cache 2:33:59 PM: Started saving emacs cask dependencies 2:33:59 PM: Finished saving emacs cask dependencies 2:33:59 PM: Started saving maven dependencies 2:33:59 PM: Finished saving maven dependencies 2:33:59 PM: Started saving boot dependencies 2:33:59 PM: Finished saving boot dependencies 2:33:59 PM: Started saving rust rustup cache 2:33:59 PM: Finished saving rust rustup cache 2:33:59 PM: Started saving go dependencies 2:33:59 PM: Finished saving go dependencies 2:34:02 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 2:34:02 PM: Creating deploy upload records 2:34:02 PM: Failing build: Failed to build site 2:34:02 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 2:34:02 PM: Finished processing build request in 3m43.455831651s

stefanoverna commented 2 years ago

Hello, can you please upgrade to v3.0.5 of the plugin? If that doesn't work, please share your yarn.lock file, thanks.

dw-srohrlack commented 2 years ago

I'd like to add to this issue:

When using gatsby4 deferred static generation (DSG), builds fail in the "Validating Rendering Engines" step with the message "Error: ENOENT: no such file or directory, mkdir '//.cache/datocms-assets'".

I've set up a fresh gatsby 4 project (gatsby 4.1.0), installed and set up "gatsby-source-datocms" 3.0.6 and enabled DSG in gatsby-node.js for a single page like so:

createPage({ path: '/test', component: path.resolve('./src/templates/test.js'), defer: true, })

package-lock.json.zip

emkeythekeyem commented 2 years ago

Any news? I am having the same issue

stefanoverna commented 2 years ago

Working on it!

stefanoverna commented 2 years ago

@dw-srohrlack could you share the complete repo of the basic gatsby 4 project you're having issues with?

dw-srohrlack commented 2 years ago

@stefanoverna here you go https://github.com/dw-srohrlack/gatsby4-datocms-example

stefanoverna commented 2 years ago

Thanks @dw-srohrlack! Hopefully the newly released v3.0.8 should solve the issue you guys are having! Let us know how it goes!

dw-srohrlack commented 2 years ago

@stefanoverna The test project is building now. I haven't testet Gatsby-Cloud builds (yet).