Closed albertshinBFG closed 1 year ago
@jaydenseric @mike-marcacci
I'm not familiar with Google Cloud Run, but maybe this issue is relevant:
https://github.com/jaydenseric/graphql-upload/issues/129
This comment generally applies for both the Google Cloud Functions and AWS Lambda issues:
https://github.com/jaydenseric/graphql-upload/issues/155#issuecomment-632998596
Just googling quickly, it seems Google Cloud run has a request size limit of 32 MB:
https://cloud.google.com/run/quotas
So, maybe it's cutting your requests off early if you are exceeding that?
Hey @jaydenseric Thank you for your response!
I should clarify my problem as I'm more clear as to what may be going wrong.
I have two express servers. The first one intercepts all requests from the Frontend prior to passing the request to the backend.
Locally, this first express server isn't in use and is only in use when deployed. This is where the issue is happening and hence the difference between local and deployed.
The issue is definitely happening in this client-side express server as I have graphqlUpload implemented in my backend server and without the client-side one this whole flow works perfectly.
How do you suggest passing this multipart form from one express server to another?
I've tried to use graphqlUploadExpress middleware in my client-side express server but it still doesn't work. Do I have to use multer here?
Here's a flow chart of when it is working:
Frontend GraphQL Request -> Apollo Client (with apollo-upload-client) -> Apollo Server Express (using graphql-upload-minimal) -> Resolver (using graphql-upload-minimal scalar)
This Flow works
Here's a flow chart of when its not working
Frontend is built using express.
Frontend GraphQL Request -> Apollo Client (with apollo-upload-client) -> Express Server (sends requests to backend after Google Auth Check) -> Apollo Server Express (using graphql-upload-minimal) -> Resolver (using graphql-upload-minimal scalar)
It errors out at the Express Server. Confused as to why this extra Express layer is causing "Unexpected End of Form at Multipart._final" errors from busboy.
Any ideas would be appreciated here
The problem of forwarding a GraphQL multipart request (or just part of a request) from one server to another is a well known, and in many cases a solved, problem that's particularly relevant for federated GraphQL API proxies/gateways that stitch together over HTTP multiple GraphQL APIs. This issue for example relates to that: https://github.com/jaydenseric/graphql-upload/issues/194 .
In your case, you might not need to do anything particularly complicated if you don't need to deconstruct the GraphQL request and only forward parts of it to other servers responsible for fulfilling those individual parts; you might be able to somehow pass through the entire multipart request stream without much effort. It's not something I've done before though, so I'm not sure exactly the best way to tackle it.
Helping out further with this is really beyond the scope of maintaining this package because it's more about setting up your particular server infrastructure. Feel free to share the final solution you come up with here, in case it helps others with a similar question.
Greetings!
Any help here would be appreciated... Super strange issue here. I have a React/Node.js application paired with Apollo GraphQL and Express. I've implemented
graphql-upload
in addition toapollo-upload-client
in the frontend to be able to upload files such as CSVs to Google Cloud Storage.When developing locally, everything works just fine. I'm able to select the file to upload and stream it up to GCS.
However, once I deployed my changes via Google Cloud Run, I started getting this error:
This error is only occurring when deployed on GCP. Any ideas as to why this could be happening?
Node Version: 14.20.1 apollo-upload-client: ^17.0.0 graphql-upload: ^16.0.2 apollo-server-express: ~2.14.3 express: ~4.17.1 graphql: ~15.5.0