netlify-plugin-amp-server-side-rendering icon indicating copy to clipboard operation
netlify-plugin-amp-server-side-rendering copied to clipboard

Out of memory errors

Open ehmicky opened this issue 5 years ago • 5 comments
trafficstars

It looks like this repository (which is using itself as a plugin) has experiencing the following error:

┌──────────────────────────────────────────────────────────────────────┐
│ 2. onPostBuild command from netlify-plugin-amp-server-side-rendering │
└──────────────────────────────────────────────────────────────────────┘

AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
AMP Optimizer AddMandatoryTags WARNING No canonical param is given. Setting canonical href to `.`
<--- Last few GCs --->
[1373:0x3d5ec30] 25775 ms: Mark-sweep 2047.3 (2051.1) -> 2047.3 (2051.1) MB, 202.5 / 0.1 ms (average mu = 0.233, current mu = 0.000) last resort GC in old space requested
[1373:0x3d5ec30] 25974 ms: Mark-sweep 2047.3 (2051.1) -> 2047.3 (2051.1) MB, 198.7 / 0.1 ms (average mu = 0.128, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x0e2c636408d1 <JSObject>
0: builtin exit frame: utf8Slice(this=0x08898baa21f1 <Uint8Array map = 0x320084a646a9>,4636033,0,0x08898baa21f1 <Uint8Array map = 0x320084a646a9>)
1: slice [0x3a0cb0292851] [buffer.js:603] [bytecode=0x12e1144d0b51 offset=7](this=0x3a0cb0291631 <Object map = 0x320084a65199>,0x08898baa21f1 <Uint8Array map = 0x320084a646a9>,0,4636033)
2: toString [0x33b85575f2c9] [buffer.js:800] [bytec...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0xa09830 node::Abort() [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
2: 0xa09c55 node::OnFatalError(char const*, char const*) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
3: 0xb7d71e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
4: 0xb7da99 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
5: 0xd2a1f5 [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
6: 0xd3ab08 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
7: 0xd0891c v8::internal::Factory::NewRawOneByteString(int, v8::internal::AllocationType) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
8: 0xd090dd v8::internal::Factory::NewStringFromUtf8(v8::internal::Vector<char const> const&, v8::internal::AllocationType) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
9: 0xb95a7f v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
10: 0xacde40 node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding, v8::Local<v8::Value>*) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
11: 0x9e3986 [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
12: 0xbe96a9 [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
13: 0xbeb497 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
14: 0x13c5c79 [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]

Did you figure out what happened? Wondering whether this might be experienced by other users, or this was a development-only error. :)

ehmicky avatar May 29 '20 14:05 ehmicky

@ehmicky Can’t say I saw this when testing.

It looks like this repository (which is using itself as a plugin)

I don’t really follow. Which repository? What project is that build output from?

martinbean avatar May 29 '20 14:05 martinbean

Sorry, my bad: this was a different repository (which is private) that was using this plugin. They ran into the out-of-memory error above. Do you know what might be the problem?

ehmicky avatar May 29 '20 15:05 ehmicky

@ehmicky Not sure off the top of my head. A guess would be the AMP optimizer is either processing files in parallel, or something’s not getting cleaned up when running.

I’ll try the run the plugin against a directory with lots of HTML files to try and replicate this and then put a fix together.

martinbean avatar May 29 '20 16:05 martinbean

Another error happened which might be also due to out of memory. The process crashed while running this plugin:

8:37:45 AM: Build ready to start
8:37:47 AM: build-image version: 30f629161c0736b1a3ecd8b418e5eeffab5c0faf
8:37:47 AM: build-image tag: v3.3.14
8:37:47 AM: buildbot version: a383ed3390159974f55f285b04457b44cb49efb0
8:37:47 AM: Fetching cached dependencies
8:37:47 AM: Starting to download cache of 1.3GB
8:38:20 AM: Finished downloading cache in 32.808116728s
8:38:20 AM: Starting to extract cache
8:38:56 AM: Finished extracting cache in 36.466674866s
8:38:56 AM: Finished fetching cache in 1m9.610052487s
8:38:56 AM: Starting to prepare the repo for build
8:38:57 AM: Preparing Git Reference refs/heads/master
8:38:59 AM: Different build dir detected, going to use the one specified in the Netlify configuration file: 'site' versus 'goodhere/site' in the Netlify UI
8:38:59 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'site/public' versus 'public' in the Netlify UI
8:38:59 AM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'sh this-always-fails'
8:38:59 AM: sh: 0: Can't open this-always-fails
8:38:59 AM: Starting build script
8:38:59 AM: Installing dependencies
8:39:00 AM: Started restoring cached node version
8:39:03 AM: Finished restoring cached node version
8:39:04 AM: v12.16.3 is already installed.
8:39:04 AM: Now using node v12.16.3 (npm v6.14.4)
8:39:04 AM: Started restoring cached build plugins
8:39:04 AM: Finished restoring cached build plugins
8:39:05 AM: Attempting ruby version 2.6.2, read from environment
8:39:06 AM: Using ruby version 2.6.2
8:39:07 AM: Using PHP version 5.6
8:39:07 AM: 5.2 is already installed.
8:39:07 AM: Using Swift version 5.2
8:39:07 AM: Started restoring cached node modules
8:39:07 AM: Finished restoring cached node modules
8:39:07 AM: Started restoring cached go cache
8:39:07 AM: Finished restoring cached go cache
8:39:07 AM: go version go1.12 linux/amd64
8:39:07 AM: go version go1.12 linux/amd64
8:39:07 AM: Installing missing commands
8:39:07 AM: Verify run directory
8:39:09 AM: ​
8:39:09 AM: ┌─────────────────────────────┐
8:39:09 AM: │        Netlify Build        │
8:39:09 AM: └─────────────────────────────┘
8:39:09 AM: ​
8:39:09 AM: ❯ Version
8:39:09 AM:   @netlify/build 1.0.16
8:39:09 AM: ​
8:39:09 AM: ❯ Flags
8:39:09 AM:   mode: buildbot
8:39:09 AM: ​
8:39:09 AM: ❯ Current directory
8:39:09 AM:   /opt/build/repo/site
8:39:09 AM: ​
8:39:09 AM: ❯ Config file
8:39:09 AM:   /opt/build/repo/netlify.toml
8:39:09 AM: ​
8:39:09 AM: ❯ Context
8:39:09 AM:   production
8:39:09 AM: ​
8:39:09 AM: ❯ Loading plugins
8:39:09 AM:    - [email protected] from Netlify app
8:39:09 AM:    - @netlify/[email protected] from Netlify app
8:39:09 AM:    - [email protected] from Netlify app
8:39:09 AM:    - [email protected] from Netlify app
8:39:12 AM: ​
8:39:12 AM: ┌────────────────────────────────────────────────────────┐
8:39:12 AM: │ 1. onPreBuild command from netlify-plugin-gatsby-cache │
8:39:12 AM: └────────────────────────────────────────────────────────┘
8:39:12 AM: ​
8:39:25 AM: Found a Gatsby cache. We’re about to go FAST. ⚡️
8:39:25 AM: ​
8:39:25 AM: (netlify-plugin-gatsby-cache onPreBuild completed in 12.9s)
8:39:25 AM: ​
8:39:25 AM: ┌────────────────────────────────────┐
8:39:25 AM: │ 2. build.command from netlify.toml │
8:39:25 AM: └────────────────────────────────────┘
8:39:25 AM: ​
8:39:25 AM: $ npm run build
8:39:26 AM: > [email protected] build /opt/build/repo/site
8:39:26 AM: > gatsby build
8:39:29 AM: success open and validate gatsby-configs - 0.026s
8:39:32 AM: 
8:39:32 AM: success load plugins - 1.181s
8:39:32 AM: 
8:39:32 AM: success onPreInit - 0.007s
8:39:33 AM: 
8:39:33 AM: success delete html and css files from previous builds - 0.634s
8:39:33 AM: 
8:39:33 AM: success initialize cache - 0.037s
8:39:33 AM: 
8:39:33 AM: success copy gatsby files - 0.058s
8:39:33 AM: 
8:39:33 AM: success onPreBootstrap - 0.012s
8:39:33 AM: success createSchemaCustomization - 0.005s
8:39:42 AM: 
8:39:42 AM: 
8:39:42 AM: fetch all Airtable rows from 8 tables: 8805.164ms
8:40:18 AM: success source and transform nodes - 44.981s
8:40:19 AM: 
8:40:19 AM: 
8:40:19 AM: warning Multiple node fields resolve to the same GraphQL field `Airtable.data.Capital_Type` - [`Capital_Type`, `Capital_Type___NODE`]. Gatsby will use `Capital_Type___NODE`.
8:40:19 AM: 
8:40:19 AM: warning Multiple node fields resolve to the same GraphQL field `Airtable.data.Organization` - [`Organization___NODE`, `Organization`]. Gatsby will use `Organization___NODE`.
8:40:20 AM: 
8:40:20 AM: success building schema - 2.448s
8:40:22 AM: success createPages - 1.951s
8:40:22 AM: success createPagesStatefully - 0.080s
8:40:22 AM: success onPreExtractQueries - 0.000s
8:40:22 AM: 
8:40:22 AM: success update schema - 0.084s
8:40:23 AM: success extract queries from components - 0.837s
8:40:23 AM: 
8:40:23 AM: success write out requires - 0.018s
8:40:23 AM: 
8:40:23 AM: success write out redirect data - 0.001s
8:40:23 AM: 
8:40:23 AM: success onPostBootstrap - 0.000s
8:40:23 AM: 
8:40:23 AM: 
8:40:23 AM: ⠀
8:40:23 AM: 
8:40:23 AM: info bootstrap finished - 57.330 s
8:40:23 AM: 
8:40:23 AM: ⠀
8:41:22 AM: 
8:41:22 AM: 
8:41:22 AM: success Building production JavaScript and CSS bundles - 58.635s
8:41:22 AM: 
8:41:22 AM: success Rewriting compilation hashes - 0.002s
8:41:44 AM: 
8:41:44 AM: 
8:41:44 AM: warning You can't use childImageSharp together with paepeixcnmh1owb4jmx8.svg — use publicURL instead. The childImageSharp portion of the query in this file will return null:
8:41:44 AM: /opt/build/repo/site/src/templates/organizations.js
8:42:04 AM: 
8:42:04 AM: 
8:42:04 AM: warning You can't use childImageSharp together with paepeixcnmh1owb4jmx8.svg — use publicURL instead. The childImageSharp portion of the query in this file will return null:
8:42:04 AM: /opt/build/repo/site/src/templates/organizations.js
8:42:05 AM: 
8:42:05 AM: warning You can't use childImageSharp together with paepeixcnmh1owb4jmx8.svg — use publicURL instead. The childImageSharp portion of the query in this file will return null:
8:42:05 AM: /opt/build/repo/site/src/templates/organizations.js
8:44:13 AM: 
8:44:13 AM: 
8:44:13 AM: warning You can't use childImageSharp together with paepeixcnmh1owb4jmx8.svg — use publicURL instead. The childImageSharp portion of the query in this file will return null:
8:44:13 AM: /opt/build/repo/site/src/templates/organization.js
8:47:51 AM: success run queries - 448.170s - 2654/2654 5.92/s
8:48:13 AM: 
8:48:13 AM: 
8:48:13 AM: success Building static HTML for pages - 21.030s - 2654/2654 126.20/s
8:48:13 AM: 
8:48:13 AM: 
8:48:13 AM: success onPostBuild - 0.002s
8:48:13 AM: info Done building in 527.536769311 sec
8:48:14 AM: ​
8:48:14 AM: (build.command completed in 8m 48.5s)
8:48:14 AM: ​
8:48:14 AM: ┌─────────────────────────────────────────────────────────┐
8:48:14 AM: │ 3. onPostBuild command from netlify-plugin-gatsby-cache │
8:48:14 AM: └─────────────────────────────────────────────────────────┘
8:48:14 AM: ​
8:48:30 AM: Stored the Gatsby cache to speed up future builds.
8:48:30 AM: ​
8:48:30 AM: (netlify-plugin-gatsby-cache onPostBuild completed in 16.1s)
8:48:30 AM: ​
8:48:30 AM: ┌─────────────────────────────────────────────────────┐
8:48:30 AM: │ 4. onPostBuild command from @netlify/plugin-sitemap │
8:48:30 AM: └─────────────────────────────────────────────────────┘
8:48:30 AM: ​
8:48:30 AM: Creating sitemap from files...
8:48:31 AM: Sitemap Built! sitemap.xml
8:48:31 AM: ​
8:48:31 AM: (@netlify/plugin-sitemap onPostBuild completed in 1.2s)
8:48:31 AM: ​
8:48:31 AM: ┌──────────────────────────────────────────────────────────┐
8:48:31 AM: │ 5. onPostBuild command from netlify-plugin-algolia-index │
8:48:31 AM: └──────────────────────────────────────────────────────────┘
8:48:31 AM: ​
8:49:06 AM: Search Index JSON generated at /searchIndex.json!
8:49:06 AM: ​
8:49:06 AM: (netlify-plugin-algolia-index onPostBuild completed in 34.6s)
8:49:06 AM: ​
8:49:06 AM: ┌──────────────────────────────────────────────────────────────────────┐
8:49:06 AM: │ 6. onPostBuild command from netlify-plugin-amp-server-side-rendering │
8:49:06 AM: └──────────────────────────────────────────────────────────────────────┘
8:49:06 AM: ​
8:50:19 AM: ​
8:50:19 AM: ┌──────────────────────────────────────────────────────────────────┐
8:50:19 AM: │ Plugin "netlify-plugin-amp-server-side-rendering" internal error │
8:50:19 AM: └──────────────────────────────────────────────────────────────────┘
8:50:19 AM: ​
8:50:19 AM:   Error message
8:50:19 AM:   Plugin exited with exit code null and signal SIGKILL.
8:50:19 AM:   The plugin might have exited due to a bug terminating the process, such as an infinite loop.
8:50:19 AM:   The plugin might also have explicitly terminated the process, for example with process.exit().
8:50:19 AM:   Plugin methods should instead:
8:50:19 AM:     - on success: return
8:50:19 AM:     - on failure: call utils.build.failPlugin() or utils.build.failBuild()
8:50:19 AM: ​
8:50:19 AM:   Plugin details
8:50:19 AM:   Package:        netlify-plugin-amp-server-side-rendering
8:50:19 AM:   Version:        1.0.2
8:50:19 AM:   Repository:     git+https://github.com/martinbean/netlify-plugin-amp-server-side-rendering.git
8:50:19 AM:   npm link:       https://www.npmjs.com/package/netlify-plugin-amp-server-side-rendering
8:50:19 AM:   Report issues:  https://github.com/martinbean/netlify-plugin-amp-server-side-rendering
8:50:19 AM: ​
8:50:19 AM:   Error location
8:50:19 AM:   In "onPostBuild" event in "netlify-plugin-amp-server-side-rendering" from Netlify app
8:50:19 AM: ​
8:50:19 AM:   Resolved config
8:50:19 AM:   build:
8:50:19 AM:     base: /opt/build/repo/site
8:50:19 AM:     command: npm run build
8:50:19 AM:     ignore: sh this-always-fails
8:50:19 AM:     publish: /opt/build/repo/site/public
8:50:19 AM:   plugins:
8:50:19 AM:     - inputs: {}
8:50:19 AM:       origin: ui
8:50:19 AM:       package: netlify-plugin-gatsby-cache
8:50:19 AM:     - inputs: {}
8:50:19 AM:       origin: ui
8:50:19 AM:       package: '@netlify/plugin-sitemap'
8:50:19 AM:     - inputs: {}
8:50:19 AM:       origin: ui
8:50:19 AM:       package: netlify-plugin-algolia-index
8:50:19 AM:     - inputs: {}
8:50:19 AM:       origin: ui
8:50:19 AM:       package: netlify-plugin-amp-server-side-rendering
8:50:19 AM: Caching artifacts
8:50:19 AM: Started saving node modules
8:50:19 AM: Finished saving node modules
8:50:19 AM: Started saving build plugins
8:50:19 AM: Finished saving build plugins
8:50:19 AM: Started saving pip cache
8:50:19 AM: Finished saving pip cache
8:50:19 AM: Started saving emacs cask dependencies
8:50:19 AM: Finished saving emacs cask dependencies
8:50:19 AM: Started saving maven dependencies
8:50:19 AM: Finished saving maven dependencies
8:50:19 AM: Started saving boot dependencies
8:50:19 AM: Finished saving boot dependencies
8:50:19 AM: Started saving go dependencies
8:50:19 AM: Finished saving go dependencies
8:50:19 AM: Error running command: Build script returned non-zero exit code: 1
8:50:19 AM: Failing build: Failed to build site
8:50:19 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
8:50:19 AM: Finished processing build request in 12m32.643282248s

The commit was this one.

ehmicky avatar Jun 15 '20 11:06 ehmicky

@ehmicky Thanks. I’ll check that repo out and run the plugin against it, and try and diagnose the issue.

martinbean avatar Jun 15 '20 17:06 martinbean