# How to solve - PayloadTooLargeError

**URL:** <https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295>\
**Category:** General\
**Created:** [9 May 2023 08:37 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295 "2023-05-09T08:37:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Talkatoo](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Talkatoo](https://discourse.nodered.org/u/Talkatoo)\
**Post date:** [9 May 2023 08:37 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/1 "2023-05-09T08:37:43Z")

</div>

Hi Node rode,

I am using lot of svg images in my project. When I try to added flow, I am getting below error,

```auto
PayloadTooLargeError: request entity too large
    at readStream (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\raw-body\index.js:156:17)
    at getRawBody (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\raw-body\index.js:109:12)
    at read (C:\Users\\AppData\Roaming\npm\node_modules\node-red\node_modules\body-parser\lib\read.js:79:3)
    at jsonParser (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\body-parser\lib\types\json.js:135:5)
    at Layer.handle [as handle_request] (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:328:13)
    at C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:286:9
    at Function.process_params (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:346:12)
    at next (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:280:10)
    at cors (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\cors\lib\index.js:188:7)
    at C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\cors\lib\index.js:224:17
    at originCallback (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\cors\lib\index.js:214:15)
    at C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\cors\lib\index.js:219:13
    at optionsCallback (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\cors\lib\index.js:199:9)
    at corsMiddleware (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\cors\lib\index.js:204:7)
    at Layer.handle [as handle_request] (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:328:13)
    at C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:286:9
    at Function.process_params (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:346:12)
    at next (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\index.js:280:10)
    at expressInit (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\middleware\init.js:40:5)
    at Layer.handle [as handle_request] (C:\Users\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\router\layer.js:95:5)

```

Am I exceeded the node red project size ?.  
Please provide your suggestion.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 May 2023 08:51 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/2 "2023-05-09T08:51:46Z")

</div>

I'm confused.

> [@Talkatoo](#):
>
> I am using lot of svg images in my project.

In what manner are they being used?

> [@Talkatoo](#):
>
> When I try to added flow, I am getting below error,

Add a flow?

What do you mean by that?

Adding a flow is not the same as a `payload is too big` error.

---

<div class="post-metadata">

**Author:** ![Talkatoo](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Talkatoo](https://discourse.nodered.org/u/Talkatoo)\
**Post date:** [9 May 2023 09:09 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/3 "2023-05-09T09:09:18Z")

</div>

@Trying_to_learn .

I am working on a beer brewing project which has 8 tanks for various purposes. So, I need to use 8 SVG images to display the content of the tank and control the valves of each tank

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 May 2023 09:17 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/4 "2023-05-09T09:17:53Z")

</div>

Errrrr..  
Ok.

Then I think there is a fundamental problem with what you are doing.  
Or wanting to do.

Why do you specifically need to use those _images_?  
the `dashboard` has a `gauge` node that can do fill amounts that have inbuilt animation amounts.

As SVG is supposed to be designed for this sort of stuff there shouldn't be a problem.  
However: I don't know the full story.

Maybe not the best example, but o offer an alternative:

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/0241dd9c480fbb666ef68876498c4e277bb3610f.jpeg "Node-red Episode 02: How to change the color of level gauge in Node-red-dashboard?") ](https://www.youtube.com/watch?v=cVzPFOwjEBw)

---

<div class="post-metadata">

**Author:** ![Talkatoo](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Talkatoo](https://discourse.nodered.org/u/Talkatoo)\
**Post date:** [9 May 2023 09:22 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/5 "2023-05-09T09:22:20Z")

</div>

Ok.. Thanks for the info. .  
After update new svg file to my each tank, I am getting this error.  
With old svg file, I am not getting any error.  
The delta between new and old svg file, addition of colors and some graphcis.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 May 2023 09:28 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/6 "2023-05-09T09:28:47Z")

</div>

If the old ones work and the new ones don't: I'd check there isn't/aren't any problem with the files.

They are _picture_ files - yes?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 May 2023 10:00 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/8 "2023-05-09T10:00:14Z")

</div>

I am low on the knowledge ladder.

Even lower on the SVG knowledge ladder. In fact I don't even think I am on that ladder.  
I'm not the right person to give help on that part.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 May 2023 10:30 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/9 "2023-05-09T10:30:50Z")

</div>

It is always worth searching the forum when you get such problems, particularly when you can search for an unusual string such as payloadtoolargeerror.  
This may be helpful. If not then look at the other hits in the search.

> [@PayloadTooLargeError at deploy](https://discourse.nodered.org/t/payloadtoolargeerror-at-deploy/67053):
>
> This error is clearly related to the size of the flows within the instance since I can reduce the size of the flow file (by removing a node or 2 from the flow). I've attached a screen shot of the error. [PayloadTooLargeError] The post seems to refer nicely: The answer is to increase the limit in express, however no matter what I've tried setting httpServerOptions has no effect. I do note that express.json and express.urlencoded are methods Is anyone able to provide the correct syntax to se…

---

<div class="post-metadata">

**Author:** ![Talkatoo](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Talkatoo](https://discourse.nodered.org/u/Talkatoo)\
**Post date:** [9 May 2023 10:59 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/10 "2023-05-09T10:59:42Z")

</div>

@Colin. .. Thanks for the info.

Even I have increased the size of apiMaxLength like this,

```auto
apiMaxLength: '50mb',

```

Still observing same error, ` PayloadTooLargeError: request entity too large`.  
After making changes in `settings.js`, do I need to restart my PC to reflect the changes in the project ?.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 May 2023 11:00 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/11 "2023-05-09T11:00:56Z")

</div>

You will need to restart node-red.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 May 2023 11:08 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/12 "2023-05-09T11:08:12Z")

</div>

If a restart doesn't fix it then post the output you see when you start node red (with the Welcome to node red message) and post your settings.js file. The file is the one mentioned in the log.

---

<div class="post-metadata">

**Author:** ![Talkatoo](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Talkatoo](https://discourse.nodered.org/u/Talkatoo)\
**Post date:** [9 May 2023 11:59 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/13 "2023-05-09T11:59:15Z")

</div>

@Colin... After restart, I am not observing the issue.

Thanks for your guidance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 July 2023 12:00 UTC](https://discourse.nodered.org/t/how-to-solve-payloadtoolargeerror/78295/14 "2023-07-08T12:00:13Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
