1
votes

I'm recieving a 502 error on Google App Engine when trying to upload an image to my NodeJS API.

My image is sent via base64. It works perfectly on my local machine, although has failed since moving it to production at Google App Engine. My guess was that maybe GAE was not accepting the request from the client since the payload was too large.

I have the following code within my server.js file that fixed the problem on my local machine, although does not fix it at GAE:

app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));

Is there a setting or something I need to add to my app.yaml file to allow larger data requests to my POST APIs?

1

1 Answers

2
votes

See the AppEngine docs for Node.js under "Concepts->How Requests are Handled". Does your request take longer than a second to upload? It may be running up against a 1 second limit as mentioned in that documentation (emphasis mine):

App Engine reserves automatic scaling capacity for applications with low latency, where the application responds to requests in less than one second. Applications with very high latency, such as over one second per request for many requests, and high throughput require Silver, Gold, or Platinum support. Customers with this level of support can request higher throughput limits by contacting their support representative.