Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netlify Request must be smaller than 69905067 bytes for the CreateFunction operation #1196

Closed
KrisCoulson opened this issue Sep 23, 2020 · 6 comments
Labels
bug/needs-info More information is needed for reproduction topic/prisma

Comments

@KrisCoulson
Copy link
Contributor

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

@thedavidprice
Copy link
Contributor

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 thedavidprice added bug/needs-info More information is needed for reproduction topic/prisma labels Sep 24, 2020
@KrisCoulson
Copy link
Contributor Author

@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! ;)

@noire-munich
Copy link
Collaborator

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?

@Tobbe
Copy link
Member

Tobbe commented Nov 8, 2020

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 🙁

@Tobbe
Copy link
Member

Tobbe commented Nov 8, 2020

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

This is related #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: redwoodjs/playground-auth#9

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

@noire-munich
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction topic/prisma
Projects
None yet
Development

No branches or pull requests

4 participants