Redwood: Netlify Request must be smaller than 69905067 bytes for the CreateFunction operation

Created on 23 Sep 2020  ยท  6Comments  ยท  Source: redwoodjs/redwood

Not exactly sure where the documentation lives so I figured here would be the next best place to leave an issue.

netlify deployment documentation is missing a step. When trying to deploy today I kept receiving this error

Request must be smaller than 69905067 bytes for the CreateFunction operation

After a bunch of googling I couldn't find a real answer so I went back to the documentation. Still no luck. Luckily @cannikin has those amazing 4k godlike quality videos. He mentions needing the BINARY_TARGET env variable to be set on netlify so that prisma knows to compile to the right target. And then everything deployed smoothly.

So I think it would be a nice addition to add this to the tutorial/text documentation and in the meantime, I put the error in the issue title in case anyone comes here looking.

rob

bu0-needs-info prisma

All 6 comments

Hi @KrisCoulson! Thanks for checking in about this. And if you'd ever like to help fix things like this in the future and become a RedwoodJS contributor, a couple of quick things to help:

re: setting the Binary Target

Could you copy+paste the generator client section of your api/prisma/schema.prisma file? For example, the code in a default installation is:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = "native"
}

Things have changed a lot with both Prisma and Netlify (and Vercel) over the past 3-4 months. Setting "native" in the schema.prisma is all that's now required. I'm curious if you've upgraded from an earlier version and these code changes weren't reflected in your project.

If not, something ๐ŸŸ is definitely going on.

@thedavidprice for sure I am looking forward to contributing. Actually got a baby PR merged in the other day. To be fair this was probably on me because this was a project that I started a while ago and picked back up. So it looks like the binaryTargets = env("BINARY_TARGET") in the schema.prisma was the culprit. That is good to know. I can be update this to native to remove the env dependency. Thanks for pointing me to the docs about contributing to the docs! ;)

Hello here,

Ok so I stumbled on this issue pretty recently and after a check, my schema.prisma looks ok :

datasource DS {
  // optionally set multiple providers
  // example: provider = ["sqlite", "postgresql"]
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider      = "prisma-client-js"
  binaryTargets = "native"
}
...

But! Being most of the time on the fishy side of things, it was not enough. I believe it was @jtoar who posted on another thread ( can't find which :-\ ) the very useful following commands to investigate :

$ yarn workspace api add -D @netlify/zip-it-and-ship-it
$ yarn rw build api
$ yarn zip-it-and-ship-it api/dist/functions/ zipped

Which showed that my graphql.zip is 52mb, 2mb above the limit set by AWS apparently.

Investigating the archive, I can see the .prisma is fat of a 23.7mb ( unzipped ), thanks to its query-engine-debian-openssl-1.1.x included.

Is it normal, or is there any way to reduce this?

I've seen this come up a few times recently. (About the size limit.) Can't remember exactly where though ๐Ÿค” And the binaryTarget value has been back and forth between "native" and "rhel-openssl-1.0.x". There has also been some deployment issues with Netlify with different versions of Prisma ๐Ÿคทโ€โ™‚๏ธ To be honest I don't know what the current status is ๐Ÿ™

posted on another thread ( can't find which :-\ )
Look at the issue link posted right above your comment, to issue #1385 ๐Ÿ˜‰

This is related https://github.com/redwoodjs/redwood/issues/1345

This is probably even more related, this discussion on Discord https://discord.com/channels/679514959968993311/716252919875240007/772837339059716137
TL;DR: Switch to Vercel ๐Ÿ™
Someone else said "All I had to do was rebuild without cache on netlify"

Another one: https://github.com/redwoodjs/playground-auth/pull/9

Ohh, and also this about binaryTarget: https://github.com/redwoodjs/redwoodjs.com/issues/446

AFAIK the current status is "solved but still poppin' ", I fixed it using different binaries on local and on prod - until we have a reliable fix provided :-.

On prod, the "rhel-openssl-1.0.x" seems to be the one to use. Both make for a good 29mb in the archive, so it's best to pick only one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peterp picture peterp  ยท  4Comments

thedavidprice picture thedavidprice  ยท  3Comments

cannikin picture cannikin  ยท  3Comments

wispyco picture wispyco  ยท  3Comments

jtoar picture jtoar  ยท  4Comments