NodeJS / Express Request Entity Too Large - Heroku

I searched everywhere and cannot find an explanation about this, this is what Heroku shows in my magazines:

45:45+00:00 app[web.7]: Error: Request Entity Too Large
45:45+00:00 app[web.7]:     at Object.error (/app/node_modules/express/node_modules/connect/lib/utils.js:44:13)
45:45+00:00 app[web.7]:     at Object.limit [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/limit.js:45:47)
45:45+00:00 app[web.7]:     at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
45:45+00:00 app[web.7]:     at Object.logger [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/logger.js:157:5)
45:45+00:00 app[web.7]:     at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
45:45+00:00 app[web.7]:     at Object.favicon [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/favicon.js:78:7)
45:45+00:00 app[web.7]:     at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
45:45+00:00 app[web.7]:     at Object.expressInit [as handle] (/app/node_modules/express/lib/middleware.js:31:5)
45:45+00:00 app[web.7]:     at next (/app/node_modules/express/node_modules/connect/lib/proto.js:190:15)
45:45+00:00 app[web.7]:     at Object.query [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/query.js:44:5)
45:45+00:00 app[web.7]: POST /mls 413 1ms - 980

I turned on the last log entry because I'm not sure if it indicates the HTTP URL where these errors occurred, or if the URL of the next request is processed by the Heroku processor (we get hundreds of requests per second so it's a little crazy to keep track of).

My application ( ExpressJS ) requires large POST requests, so I set

app.use(express.limit('5mb'));

at the top of the application to allow large mail requests (usually less than 2 MB). I am not sure if the above errors are caused by receiving a request that is too large or is trying to send a request to S3 that is too large or something else. Any ideas?

Thank!

+5
2

Express v4 +,

app.use(bodyParser({limit: '5mb'}));

,

app.use(bodyParser.json());

+3

, , , - , . , , -

node_modules\ \ node_modules\ \index.js

if (typeof options.limit === 'number')       limit = options.limit

option.limit , whatevr . limit = 10024

-1

All Articles