Netlify Deployment fails

Hello RW Community,

I know that this is probably a better question to be asked in the netlify community but thought ask it here first to sanity check my setup.

Trying to follow instruction here for app deployment but encounter the message that I will paste shortly. Here is how my netlify.toml file looks like

[build]
command = "yarn rw deploy netlify"
publish = "web/dist"
functions = "api/dist/functions"

[dev]
  # To use [Netlify Dev](https://www.netlify.com/products/dev/),
  # install netlify-cli from https://docs.netlify.com/cli/get-started/#installation
  # and then use netlify link https://docs.netlify.com/cli/get-started/#link-and-unlink-sites
  # to connect your local project to a site already on Netlify
  # then run netlify dev and our app will be accessible on the port specified below
  framework = "redwoodjs"
  # Set targetPort to the [web] side port as defined in redwood.toml
  targetPort = 8910
  # Point your browser to this port to access your RedwoodJS app
  port = 8888

[[redirects]]
  from = "/*"
  to = "/200.html"
  status = 200






Also on the netlify side, here is the log:







6:57:50 AM: build-image version: d7b3813f01c06610bc1723ff1b22446513ee7941 (focal)
6:57:50 AM: build-image tag: v4.14.3
6:57:50 AM: buildbot version: 4f669c94b322d52f143cdcbb17e55d40094aa06d
6:57:50 AM: Building without cache
6:57:50 AM: Starting to prepare the repo for build
6:57:50 AM: No cached dependencies found. Cloning fresh repo
6:57:50 AM: git clone https://github.com/***/***
6:57:51 AM: Preparing Git Reference refs/heads/main
6:57:52 AM: Parsing package.json dependencies
6:57:53 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn rw deploy netlify' versus '' in the Netlify UI
6:57:53 AM: Section completed: initializing
6:57:53 AM: Starting build script
6:57:53 AM: Installing dependencies
6:57:53 AM: Python version set to 2.7
6:57:53 AM: Downloading and installing node v16.18.1...
6:57:54 AM: Downloading https://nodejs.org/dist/v16.18.1/node-v16.18.1-linux-x64.tar.xz...
6:57:54 AM: Computing checksum with sha256sum
6:57:54 AM: Checksums matched!
6:57:56 AM: Now using node v16.18.1 (npm v8.19.2)
6:57:56 AM: Enabling node corepack
6:57:56 AM: Started restoring cached build plugins
6:57:56 AM: Finished restoring cached build plugins
6:57:56 AM: Attempting ruby version 2.7.2, read from environment
6:57:57 AM: Using ruby version 2.7.2
6:57:57 AM: Using PHP version 8.0
6:57:57 AM: Started restoring cached yarn cache
6:57:57 AM: Finished restoring cached yarn cache
6:57:58 AM: Installing yarn at version 1.22.19
6:57:58 AM: Preparing yarn@1.22.19 for immediate activation...
6:57:58 AM: yarn workspaces detected
6:57:58 AM: Installing NPM modules using Yarn version 3.2.0
6:57:59 AM: ➤ YN0050: The cache-folder option has been deprecated; use rc settings instead
6:57:59 AM: ➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 👍
6:57:59 AM: ➤ YN0000: ┌ Resolution step
6:58:00 AM: ➤ YN0061: │ request@npm:2.88.2 is deprecated: request has been deprecated, see https://github.com/request/request/issues/3142
6:58:01 AM: ➤ YN0061: │ har-validator@npm:5.1.5 is deprecated: this library is no longer supported
6:58:01 AM: ➤ YN0061: │ uuid@npm:3.4.0 is deprecated: 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.
6:58:02 AM: ➤ YN0061: │ w3c-hr-time@npm:1.0.2 is deprecated: Use your platform's native performance.now() and performance.timeOrigin.➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
6:58:03 AM: ➤ YN0061: │ @npmcli/move-file@npm:2.0.1 is deprecated: This functionality has been moved to @npmcli/fs
6:58:05 AM: ➤ YN0061: │ urix@npm:0.1.0 is deprecated: Please see https://github.com/lydell/urix#deprecated
6:58:05 AM: ➤ YN0061: │ source-map-resolve@npm:0.5.3 is deprecated: See https://github.com/lydell/source-map-resolve#deprecated
6:58:05 AM: ➤ YN0061: │ stable@npm:0.1.8 is deprecated: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
6:58:05 AM: ➤ YN0061: │ resolve-url@npm:0.2.1 is deprecated: https://github.com/lydell/resolve-url#deprecated
6:58:05 AM: ➤ YN0061: │ source-map-url@npm:0.4.1 is deprecated: See https://github.com/lydell/source-map-url#deprecated
6:58:07 AM: ➤ YN0061: │ querystring@npm:0.2.0 is deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
6:58:07 AM: ➤ YN0061: │ chokidar@npm:2.1.8 is deprecated: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
6:58:07 AM: ➤ YN0061: │ fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
6:58:07 AM: ➤ YN0032: │ evp_bytestokey@npm:1.0.3: Implicit dependencies on node-gyp are discouraged
6:58:07 AM: ➤ YN0032: │ nan@npm:2.17.0: Implicit dependencies on node-gyp are discouraged
6:58:14 AM: ➤ YN0061: │ sane@npm:4.1.0 is deprecated: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
6:58:17 AM: ➤ YN0061: │ @npmcli/move-file@npm:1.1.2 is deprecated: This functionality has been moved to @npmcli/fs
6:58:27 AM: ➤ YN0002: │ @apollo/react-hooks@npm:4.0.0 doesn't provide graphql (pcd56f), requested by @apollo/client➤ YN0002: │ @graphql-codegen/cli@npm:2.13.7 [064c0] doesn't provide @types/node (p7a082), requested by cosmiconfig-typescript-loader➤ YN0002: │ @graphql-codegen/cli@npm:2.13.7 [064c0] doesn't provide ts-node (pf1a8f), requested by cosmiconfig-typescript-loader➤ YN0002: │ @graphql-codegen/cli@npm:2.13.7 [064c0] doesn't provide typescript (p91cbd), requested by cosmiconfig-typescript-loader➤ YN0002: │ @redwoodjs/api-server@npm:3.4.0 doesn't provide @babel/core (p2e556), requested by @babel/plugin-transform-runtime➤ YN0002: │ @redwoodjs/cli@npm:3.4.0 doesn't provide react (p9d942), requested by @redwoodjs/prerender➤ YN0002: │ @redwoodjs/cli@npm:3.4.0 doesn't provide react-dom (p96aeb), requested by @redwoodjs/prerender➤ YN0002: │ @redwoodjs/core@npm:3.4.0 doesn't provide @babel/eslint-parser (p4a60c), requested by @babel/eslint-plugin➤ YN0002: │ @redwoodjs/core@npm:3.4.0 doesn't provide eslint (p4fa1d), requested by @babel/eslint-plugin➤ YN0002: │ @redwoodjs/eslint-config@npm:3.4.0 doesn't provide babel-plugin-module-resolver (pbc309), requested by eslint-import-resolver-babel-module➤ YN0002: │ @redwoodjs/graphql-server@npm:3.4.0 doesn't provide @envelop/core (p20633), requested by @envelop/depth-limit➤ YN0002: │ @redwoodjs/graphql-server@npm:3.4.0 doesn't provide @envelop/core (pf4637), requested by @envelop/disable-introspection➤ YN0002: │ @redwoodjs/graphql-server@npm:3.4.0 doesn't provide @envelop/core (p55595), requested by @envelop/filter-operation-type➤ YN0002: │ @redwoodjs/graphql-server@npm:3.4.0 doesn't provide @envelop/core (p87eb1), requested by @envelop/parser-cache➤ YN0002: │ @redwoodjs/graphql-server@npm:3.4.0 doesn't provide @envelop/core (p73917), requested by @envelop/validation-cache➤ YN0002: │ @redwoodjs/internal@npm:3.4.0 doesn't provide @babel/core (pc69f8), requested by @babel/plugin-transform-typescript➤ YN0002: │ @redwoodjs/internal@npm:3.4.0 doesn't provide @babel/core (p63e2d), requested by @babel/register➤ YN0002: │ @redwoodjs/internal@npm:3.4.0 doesn't provide @babel/core (p843af), requested by babel-plugin-graphql-tag➤ YN0002: │ @redwoodjs/internal@npm:3.4.0 doesn't provide graphql-tag (p3f4ef), requested by @graphql-codegen/typescript-react-apollo➤ YN0002: │ @redwoodjs/internal@npm:3.4.0 doesn't provide graphql-tag (pb74b0), requested by babel-plugin-graphql-tag➤ YN0002: │ @redwoodjs/prerender@npm:3.4.0 [61f9d] doesn't provide prop-types (p09924), requested by @redwoodjs/web➤ YN0002: │ @redwoodjs/router@npm:3.4.0 doesn't provide react (pad839), requested by @reach/skip-nav➤ YN0002: │ @redwoodjs/router@npm:3.4.0 doesn't provide react-dom (p73954), requested by @reach/skip-nav➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide @babel/core (p41a6d), requested by @storybook/addon-essentials➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide @babel/core (p01d36), requested by babel-jest➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide @babel/core (p60201), requested by babel-plugin-inline-react-svg➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide @testing-library/dom (pc8a3e), requested by @testing-library/user-event➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide prop-types (p35367), requested by @redwoodjs/web➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react (p77a2e), requested by @redwoodjs/web➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react (pcd272), requested by @storybook/builder-webpack5➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react (p0e594), requested by @storybook/manager-webpack5➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react (pb915e), requested by @storybook/react➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react (pfa643), requested by @testing-library/react-hooks➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react (p1e253), requested by @testing-library/react➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react-dom (pf968a), requested by @redwoodjs/web➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react-dom (p9ac39), requested by @storybook/builder-webpack5➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react-dom (p884e2), requested by @storybook/manager-webpack5➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react-dom (pb7254), requested by @storybook/react➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide react-dom (p15ab2), requested by @testing-library/react➤ YN0002: │ @redwoodjs/testing@npm:3.4.0 doesn't provide require-from-string (p9e4dc), requested by @storybook/react➤ YN0002: │ @storybook/addon-docs@npm:6.5.12 [bb16a] doesn't provide @babel/core (pf4fc2), requested by @babel/preset-env➤ YN0002: │ @storybook/addon-docs@npm:6.5.12 [bb16a] doesn't provide @babel/core (p66011), requested by @babel/plugin-transform-react-jsx➤ YN0002: │ @storybook/addon-docs@npm:6.5.12 [bb16a] doesn't provide @babel/core (p6018b), requested by babel-loader➤ YN0002: │ @storybook/addon-docs@npm:6.5.12 [bb16a] doesn't provide webpack (p2a9e1), requested by babel-loader➤ YN0002: │ @storybook/docs-tools@npm:6.5.12 doesn't provide react (p5aa44), requested by @storybook/store➤ YN0002: │ @storybook/docs-tools@npm:6.5.12 doesn't provide react-dom (p7d1da), requested by @storybook/store➤ YN0002: │ @storybook/mdx1-csf@npm:0.0.1 doesn't provide @babel/core (p16a43), requested by @babel/preset-env➤ YN0002: │ @storybook/telemetry@npm:6.5.12 doesn't provide react (pba164), requested by @storybook/core-common➤ YN0002: │ @storybook/telemetry@npm:6.5.12 doesn't provide react-dom (p3ad01), requested by @storybook/core-common➤ YN0002: │ @tensorflow/tfjs@npm:3.21.0 doesn't provide seedrandom (p563bf), requested by @tensorflow/tfjs-data➤ YN0002: │ api@workspace:api doesn't provide immer (p40edd), requested by @xstate/immer➤ YN0002: │ api@workspace:api doesn't provide xstate (pc4c95), requested by @xstate/immer➤ YN0002: │ graphql-config@npm:4.3.6 [18625] doesn't provide @types/node (pa1507), requested by cosmiconfig-typescript-loader➤ YN0002: │ graphql-config@npm:4.3.6 [18625] doesn't provide @types/node (p03cae), requested by ts-node➤ YN0002: │ graphql-config@npm:4.3.6 [18625] doesn't provide typescript (p9c74d), requested by cosmiconfig-typescript-loader➤ YN0002: │ graphql-config@npm:4.3.6 [18625] doesn't provide typescript (pfeee2), requested by ts-node➤ YN0002: │ react-hot-toast@npm:2.4.0 [22f6a] doesn't provide csstype (pf4a8d), requested by goober➤ YN0002: │ react-hot-toast@npm:2.4.0 [bf325] doesn't provide csstype (p14449), requested by goober➤ YN0002: │ react-hot-toast@npm:2.4.0 [eafea] doesn't provide csstype (p2dd86), requested by goober➤ YN0002: │ react-loader-spinner@npm:6.0.0-0 [42b1e] doesn't provide react-is (pd263d), requested by styled-components➤ YN0002: │ web@workspace:web doesn't provide @mui/system (p34dd3), requested by @mui/x-data-grid➤ YN0002: │ web@workspace:web doesn't provide graphql (p86bd8), requested by @redwoodjs/forms➤ YN0002: │ web@workspace:web doesn't provide postcss (p8b30f), requested by @fullhuman/postcss-purgecss➤ YN0002: │ web@workspace:web doesn't provide postcss (p4e858), requested by autoprefixer➤ YN0002: │ web@workspace:web doesn't provide postcss (p02ace), requested by postcss-loader➤ YN0060: │ web@workspace:web provides react (pc1fd5) with version 17.0.2, which doesn't satisfy what react-autocomplete requests➤ YN0060: │ web@workspace:web provides react (pf2aad) with version 17.0.2, which doesn't satisfy what react-html-parser requests➤ YN0060: │ web@workspace:web provides react-dom (pc4267) with version 17.0.2, which doesn't satisfy what react-autocomplete requests➤ YN0002: │ web@workspace:web doesn't provide react-is (pc5bbb), requested by styled-components➤ YN0002: │ web@workspace:web doesn't provide webpack (pcfbfb), requested by postcss-loader➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
6:58:27 AM: ➤ YN0000: └ Completed in 28s 138ms
7:33:43 AM: Build exceeded maximum allowed runtime

@thedavid and @rob , Hi and sorry for cold-tagging here :slight_smile:
I was wondering if you guys have any suggestions?
Thank you in advance.

It tries to deploy for ~30 minutes?

And then it times out.

Are you pre-rendering any files?

Correct. The first part takes about 1 minute and then it stalls for 30 minutes and times out.
I don’t think I am pre-rendering. Simply following instructions here.
The app works fine on my local environment.

my rw version is 2.2.5

You are on RedwoodJS 2.2.5?

That’s rather old but shouldn’t necessarily be a problem.

Do you have any large functions or files that get imported as part of your build?

I’d also suggest trying to clear the cache when triggering a Netlify build. Maybe there are some artifacts from prior builds to clean up.

Also you should try a local Netlify build.

To do that, install the Netlify cli.

Then run

“netlify link” to associate your local dev with your deploy site

Then run

“netlify build”

And it will build using pretty much the same environment as it does on their cloud build runtime

That can give you more error messages sometimes to track down issues.

Okay - I tried what you suggested locally.
The build succeeded. Next I assume I have to try netlify deploy in order to deploy it?
At this step, it’s been 15 minutes and its stuck at ⠸ (26/27) Uploading stripeWebhooks... and then throws the error below
Here is the full log:
$netlify deploy

Deploy path:        /Users/rouzbeh/redwood/my-site/web/dist
Functions path:     /Users/rouzbeh/redwood/my-site/api/dist/functions
Configuration path: /Users/rouzbeh/redwood/my-site/netlify.toml
Deploying to draft URL...
✔ Ignored invalid or expired functions cache
✔ Finished hashing 37 files and 5 functions
✔ CDN requesting 21 files and 5 functions
⠋ (26/27) Uploading stripeWebhooks... ›   Warning: JSONHTTPError:  500
 ›   Warning: 
{
  "name": "JSONHTTPError",
  "status": 500,
  "json": {
    "status": 500,
    "error": "Internal Server Error"
  }
}

 ›   JSONHTTPError: Internal Server Error

I checked the .netlify folder. It turned out my graphql.zip file was notoriusly large. Something like 200MB. Mainly because of tensorflow in node_modules. I replaced the tensorflow package with something else and was able to deploy.
Any idea what someone might do if they really need to have large packages like tensorflow?

Hey rouzbeh :slight_smile:

Not sure if browsing this informs your file size limit topic… Exploring AWS Lambda Deployment Limits - DZone Cloud.

Deployment Packages

We’ll be working with a Machine Learning model as our deployment package,§ creating a random data of specified size to test the limit with varying sizes. We’ll test the following limits as described in the documentation:

50 MB: Maximum deployment package size

250 MB: Size of code/dependencies that you can zip into a deployment package (uncompressed .zip/.jar size)

For this test, we’ll be using our machine learning model that we created in our last article. It’s an image recognition deep learning model based on TensorFlow Inception-v3 model. Although our data is not so compressed. The overall file size is about 150 MB which is much beyond the specified limit of 50 MB.

Also - you may be able to bundle individual tensorflowjs packages to trim the file size.

Finally - the 10sec limit might hit if you are running long processes with tensorflow.