Home
Support Forums

Timeout on upload stage for Gatsby site

I have tried two times to publish my Gatsby site but on both occasions, it timed out during upload.

The site has around 22k pages and 41k files (1.5 GB) to upload after the build completes.

2:12:54 PM: 40965 new files to upload
2:12:54 PM: 0 new functions to upload
2:35:10 PM: Build exceeded maximum allowed runtime

Netlify site name
gastby-test-xyz.netlify.app

Build log

2:04:01 PM: Build ready to start
2:04:03 PM: build-image version: 081db65c3e4ce8423fedb40e7689a87de6f84667
2:04:03 PM: build-image tag: v4.3.1
2:04:03 PM: buildbot version: 2cc7c0ccf754e7f302de1daa4d80d9968804770c
2:04:03 PM: Fetching cached dependencies
2:04:03 PM: Failed to fetch cache, continuing with build
2:04:03 PM: Starting to prepare the repo for build
2:04:03 PM: No cached dependencies found. Cloning fresh repo
2:04:03 PM: git clone https://github.com/ownchoice/codigospostales.xyz
2:04:11 PM: Preparing Git Reference refs/heads/main
2:04:13 PM: Parsing package.json dependencies
2:04:13 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'gatsby/public' versus 'public' in the Netlify UI
2:04:13 PM: Starting build script
2:04:13 PM: Installing dependencies
2:04:13 PM: Python version set to 2.7
2:04:14 PM: Downloading and installing node v16.10.0...
2:04:14 PM: Downloading https://nodejs.org/dist/v16.10.0/node-v16.10.0-linux-x64.tar.xz...
2:04:15 PM: Computing checksum with sha256sum
2:04:15 PM: Checksums matched!
2:04:18 PM: Now using node v16.10.0 (npm v7.24.0)
2:04:18 PM: Started restoring cached build plugins
2:04:18 PM: Finished restoring cached build plugins
2:04:18 PM: Attempting ruby version 2.7.2, read from environment
2:04:20 PM: Using ruby version 2.7.2
2:04:20 PM: Using PHP version 8.0
2:04:20 PM: Started restoring cached node modules
2:04:20 PM: Finished restoring cached node modules
2:04:20 PM: Installing NPM modules using NPM version 7.24.0
2:04:43 PM: npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
2:04:43 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
2:04:43 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
2:04:43 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
2:04:45 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:04:45 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:04:45 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:04:45 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:04:45 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:04:45 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:04:45 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:04:46 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
2:04:49 PM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
2:04:56 PM: npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
2:05:00 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
2:05:00 PM: npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
2:05:02 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
2:05:02 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
2:05:03 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
2:05:04 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
2:05:05 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
2:05:09 PM: npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
2:05:10 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
2:05:13 PM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
2:05:25 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:05:42 PM: added 2895 packages, and audited 2896 packages in 1m
2:05:42 PM: 425 packages are looking for funding
2:05:42 PM:   run `npm fund` for details
2:05:42 PM: 46 vulnerabilities (30 moderate, 16 high)
2:05:42 PM: To address issues that do not require attention, run:
2:05:42 PM:   npm audit fix
2:05:42 PM: To address all issues possible (including breaking changes), run:
2:05:42 PM:   npm audit fix --force
2:05:42 PM: Some issues need review, and may require choosing
2:05:42 PM: a different dependency.
2:05:42 PM: Run `npm audit` for details.
2:05:42 PM: NPM modules installed
2:05:42 PM: Started restoring cached go cache
2:05:42 PM: Finished restoring cached go cache
2:05:42 PM: go version go1.16.5 linux/amd64
2:05:42 PM: go version go1.16.5 linux/amd64
2:05:42 PM: Installing missing commands
2:05:42 PM: Verify run directory
2:05:44 PM: ​
2:05:44 PM: ────────────────────────────────────────────────────────────────
2:05:44 PM:   Netlify Build                                                 
2:05:44 PM: ────────────────────────────────────────────────────────────────
2:05:44 PM: ​
2:05:44 PM: ❯ Version
2:05:44 PM:   @netlify/build 18.13.5
2:05:44 PM: ​
2:05:44 PM: ❯ Flags
2:05:44 PM:   baseRelDir: true
2:05:44 PM:   buildId: 61549c81294c2500d89f5bf0
2:05:44 PM:   deployId: 61549c81294c2500d89f5bf2
2:05:44 PM: ​
2:05:44 PM: ❯ Current directory
2:05:44 PM:   /opt/build/repo/gatsby
2:05:44 PM: ​
2:05:44 PM: ❯ Config file
2:05:44 PM:   No config file was defined: using default values.
2:05:44 PM: ​
2:05:44 PM: ❯ Context
2:05:44 PM:   production
2:05:44 PM: ​
2:05:44 PM: ────────────────────────────────────────────────────────────────
2:05:44 PM:   1. Build command from Netlify app                             
2:05:44 PM: ────────────────────────────────────────────────────────────────
2:05:44 PM: ​
2:05:44 PM: $ npm run build
2:05:44 PM: > codigos-postales@2.0.0 build
2:05:44 PM: > gatsby build
2:05:50 PM: success open and validate gatsby-configs, load plugins - 2.969s
2:05:50 PM: success onPreInit - 0.004s
2:05:50 PM: success initialize cache - 0.068s
2:05:50 PM: success copy gatsby files - 0.077s
2:05:50 PM: success Compiling Gatsby Functions - 0.339s
2:05:50 PM: success onPreBootstrap - 0.355s
2:05:51 PM: success createSchemaCustomization - 0.028s
2:05:51 PM: success Checking for changed pages - 0.000s
2:05:51 PM: success source and transform nodes - 0.767s
2:05:54 PM: success building schema - 2.416s
2:05:54 PM: Querying locations on DB
2:05:57 PM: Asigning nearby locations (.closeTo prop)
2:07:37 PM: New way: 1:39.384 (m:ss.mmm)
2:07:37 PM: Done
2:07:37 PM: Total locations:  20260
2:07:46 PM: success createPages - 112.032s
2:07:46 PM: success createPagesStatefully - 0.211s
2:07:46 PM: info Total nodes: 20826, SitePage nodes: 20674 (use --verbose for breakdown)
2:07:46 PM: success Checking for changed pages - 0.003s
2:07:47 PM: success update schema - 0.846s
2:07:47 PM: success onPreExtractQueries - 0.000s
2:07:49 PM: success extract queries from components - 1.771s
2:07:49 PM: warning The GraphQL query in the non-page component "/opt/build/repo/gatsby/src/unused/argentina.jsx" will not be run.
2:07:49 PM: warning The GraphQL query in the non-page component "/opt/build/repo/gatsby/src/unused/index.jsx" will not be run.
2:07:49 PM: Exported queries are only executed for Page components. It's possible you're
2:07:49 PM: trying to create pages in your gatsby-node.js and that's failing for somereason.
2:07:49 PM: If the failing component(s) is a regular component and not intended to be a page
2:07:49 PM: component, you generally want to use a <StaticQuery> (https://gatsbyjs.org/docs/static-query)
2:07:49 PM: instead of exporting a page query.
2:07:49 PM: If you're more experienced with GraphQL, you can also export GraphQLfragments from components and compose the fragments in the Page component
2:07:49 PM: query and pass data down into the child component β€” https://graphql.org/learn/queries/#fragments
2:07:49 PM: success write out redirect data - 0.005s
2:07:49 PM: success Build manifest and related icons - 0.412s
2:07:49 PM: success onPostBootstrap - 0.415s
2:07:49 PM: info bootstrap finished - 124.855s
2:07:58 PM: success run page queries - 8.997s - 20674/20674 2298.00/s
2:07:58 PM: success write out requires - 0.083s
2:08:45 PM: success Building production JavaScript and CSS bundles - 46.407s
2:08:45 PM: success Rewriting compilation hashes - 0.011s
2:09:00 PM: success Writing page-data.json files to public directory - 15.492s - 20674/20674 1334.49/s
2:09:09 PM: 
2:09:09 PM: gatsby-plugin-purgecss:
2:09:09 PM:  Previous CSS Size: 174.09 KB
2:09:09 PM:  New CSS Size: 26.27 KB (-84.91%)
2:09:09 PM:  Removed ~147.82 KB of CSS
2:09:09 PM: 
2:09:16 PM: success Building HTML renderer - 7.454s
2:10:08 PM: success Caching JavaScript and CSS webpack compilation - 83.500s
2:10:27 PM: success Caching HTML renderer compilation - 71.089s
2:12:16 PM: success Building static HTML for pages - 180.118s - 20674/20674 114.78/s
2:12:20 PM: info Generated public/sw.js, which will precache 7 files, totaling 317517 bytes.
2:12:20 PM: The following pages will be precached:
2:12:20 PM: /offline-plugin-app-shell-fallback/index.html
2:12:20 PM: success onPostBuild - 3.924s
2:12:24 PM: info Done building in 399.586773502 sec
2:12:24 PM: ​
2:12:24 PM: (build.command completed in 6m 40.3s)
2:12:24 PM: ​
2:12:24 PM: ────────────────────────────────────────────────────────────────
2:12:24 PM:   2. Deploy site                                                
2:12:24 PM: ────────────────────────────────────────────────────────────────
2:12:24 PM: ​
2:12:24 PM: Starting to deploy site from 'gatsby/public'
2:12:29 PM: Creating deploy tree asynchronously
2:12:29 PM: Creating deploy upload records
2:12:54 PM: 40965 new files to upload
2:12:54 PM: 0 new functions to upload
2:35:10 PM: Build exceeded maximum allowed runtime
2:35:14 PM: Failed to upload file: page-data/argentina/santiago-del-estero/envidia-4205/page-data.json
2:35:29 PM: Failed to upload file: page-data/argentina/santiago-del-estero/escalera-4317/page-data.json
2:35:39 PM: Failed to upload file: page-data/argentina/santiago-del-estero/esperanza-ojo-de-agua-dpto-ojo-de-agua-5250/page-data.json
2:35:51 PM: Failed to upload file: page-data/argentina/santiago-del-estero/esperanza-villa-atamisqui-dpto-atamisqui-4317/page-data.json
2:35:58 PM: Failed to upload file: page-data/argentina/santiago-del-estero/esperanza-choya-dpto-choya-4233/page-data.json
2:35:58 PM: Execution timed out after 31m44.787344136s
2:35:58 PM: Error running command: Command did not finish within the time limit
2:35:58 PM: Failing build: Failed to build site
2:35:58 PM: Finished processing build request in 31m55.580192267s

Hi there, @MotionlessFinger :wave:

Welcome to the Netlify Forums, and thanks for reaching out. Looking at your build log, it looks like your build is failing due to exceeding the allotted build time limit. Our default build time limit is 15 minutes. We can increase it to 30-45 for you, but will need you to add a credit card to your account first.

Additionally, we have some great resources in the Forums for optimizing your build time! A great starting point would be here: