# Request entity too large 413

**URL:** <https://discourse.nodered.org/t/request-entity-too-large-413/2397>\
**Category:** General\
**Created:** [18 August 2018 23:39 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397 "2018-08-18T23:39:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![highlow](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/highlow/32/20476_2.png) [@highlow](https://discourse.nodered.org/u/highlow)\
**Post date:** [18 August 2018 23:39 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397/1 "2018-08-18T23:39:13Z")

</div>

Hi,  
I have a relatively big flow and I can't deploy anymore.  
I'm still receiving this error "Request entity too large 413"  
I don't know what to do... I've tried the following:

//httpAdminRoot:"/admin",  
debugMaxLength: 1000,  
apiMaxLength:"5mb",  
in the settings obj

and the lines in the app.js  
app.use(bodyParser.json({limit: '50mb'}));  
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));

I'm using:  
Node-RED version: v0.17.5  
and  
node --version  
v6.9.1

nothing seems to work... could you tell me what to do?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 August 2018 23:43 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397/2 "2018-08-18T23:43:24Z")

</div>

Hi,

what version of Node-RED are you using?

When you say you've tried the follow, some of those are settings and some of those are lines of code... so are you embedding node-red in your own app?

In general, the relevant setting here is `apiMaxLength` - however, prior to 0.19, if you had set `httpAdminRoot` to move the admin root away from `/` then `apiMaxLength` might not get applied properly.

Nick

---

<div class="post-metadata">

**Author:** ![highlow](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/highlow/32/20476_2.png) [@highlow](https://discourse.nodered.org/u/highlow)\
**Post date:** [18 August 2018 23:47 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397/3 "2018-08-18T23:47:30Z")

</div>

I'm using:  
Node-RED version: v0.17.5

and  
node --version  
v6.9.1

and I'm embeddin node red in my app

Still no result. I need to move the `httpAdminRoot` to other than "/" ... and it seems that  
`apiMaxLength` is not working

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [19 August 2018 00:08 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397/4 "2018-08-19T00:08:58Z")

</div>

> [@highlow](#):
>
> I need to move the `httpAdminRoot` to other than "/" ... and it seems that  
> `apiMaxLength` is not working

Yes, as I said, that was broken until the 0.19 release. If you moved the admin handler, then the parser attached to the node root would get first look at the request - and that parser does not honour apiMaxLength.

---

<div class="post-metadata">

**Author:** ![highlow](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/highlow/32/20476_2.png) [@highlow](https://discourse.nodered.org/u/highlow)\
**Post date:** [20 August 2018 11:59 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397/5 "2018-08-20T11:59:20Z")

</div>

Problem solved!  
I've upgraded to 0.19.1\_git version.  
Added the  
debugMaxLength: 1000,  
apiMaxLength:"5mb",  
in the settings object

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

but take care to declare the above lines before the RED.init line

thanks for the hint

---

<div class="post-metadata">

**Author:** ![thanhle2013](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thanhle2013/32/69777_2.png) [@thanhle2013](https://discourse.nodered.org/u/thanhle2013)\
**Post date:** [27 October 2022 06:43 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397/6 "2022-10-27T06:43:19Z")

</div>

> [@highlow](#):
>
> Problem solved!

this solution is good. thanks

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [27 October 2022 07:11 UTC](https://discourse.nodered.org/t/request-entity-too-large-413/2397/7 "2022-10-27T07:11:08Z")

</div>


