PayloadTooLargeError

hi all , i got this error with current state node in home assistant’s node red

PayloadTooLargeError: request entity too large
at readStream (/opt/node_modules/body-parser/node_modules/raw-body/index.js:163:17)
at getRawBody (/opt/node_modules/body-parser/node_modules/raw-body/index.js:116:12)
at read (/opt/node_modules/body-parser/lib/read.js:79:3)
at jsonParser (/opt/node_modules/body-parser/lib/types/json.js:138:5)
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/node_modules/express/lib/router/index.js:328:13)
at /opt/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/opt/node_modules/express/lib/router/index.js:346:12)
at next (/opt/node_modules/express/lib/router/index.js:280:10)
at cors (/opt/node_modules/cors/lib/index.js:188:7)
at /opt/node_modules/cors/lib/index.js:224:17
at originCallback (/opt/node_modules/cors/lib/index.js:214:15)
at /opt/node_modules/cors/lib/index.js:219:13
at optionsCallback (/opt/node_modules/cors/lib/index.js:199:9)
at corsMiddleware (/opt/node_modules/cors/lib/index.js:204:7)
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/node_modules/express/lib/router/index.js:328:13)
at /opt/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/opt/node_modules/express/lib/router/index.js:346:12)
at next (/opt/node_modules/express/lib/router/index.js:280:10)
at expressInit (/opt/node_modules/express/lib/middleware/init.js:40:5)
at Layer.handle [as handle_request] (/opt/node_modules/express/lib/router/layer.js:95:5)

Fortunately for me, Google Translate knows that Развертывание не удалось is Deployment Failed in English.

Nothing then to do with the Current state node - I assume that you are attempting a deployment and the size of the NR editor flow update passed to the Node-RED runtime API webhook exceeds the standard permitted length. You must have a very large flow?

There is a apiMaxLength parameter in Node-RED that will generate this message if exceeded. The default is, I believe, 5Mb.

You can read up a posting on the issue here

You could, at your own risk, try changing the [Node-RED] settings.js file. The relevant bit [in this file] appears to be:

  // The maximum size of HTTP request that will be accepted by the runtime api.
  // Default: 5mb
  //apiMaxLength: '5mb',

It looks like the solution is to uncomment the `apiMaxLength: ‘5mb’, and then increase this to 10mb.

For myself, I like to leave settings files well alone (unless I really do know what I am doing) and I would personally try reducing the size of the flow until the problem went away of its own accord.

thanks, i have created settings.js file in directory and paste this code but nothing is changed

Edit the file

/addon_configs/a0d7b954_nodered/settings.js

and change the code you find in the settings.js file (please take a copy of this file first)

and you will need to restart Node-RED for the change to take effect

but i dont have any folder named /addon_configs , or i should create???

Are you running Node-RED as a Home Assistant add-on, or independently?

as HA addon

The folder is at the top level, with config, share, media, backup.

I go in from my PC using Samba share

Inside /addon_configs is the folder for Node-RED, which contains all the Node-RED configuration.

For myself, I would start by trying to reduce the size of the flow and see if I can make the error go away, before changing settings files.

This is worth reading first!

Note that for Node-RED as an add-on the main setting file has been customised specifically.

i dont have samba share unfortunatelly

cant get access to node red folder still

Samba Share is an HA add-on.

Home Assistant Add-on: Samba share
Installation
Follow these steps to get the add-on installed on your system:

Navigate in your Home Assistant frontend to Settings -> Add-ons -> Add-on store.
Find the "Samba share" add-on and click it.
Click on the "INSTALL" button.
How to use
In the configuration section, set a username and password. You can specify any username and password; these are not related in any way to the login credentials you use to log in to Home Assistant or to log in to the computer with which you will use Samba share.
Review the enabled shares. Disable any you do not plan to use. Shares can be re-enabled later if needed.
Connection
If you are on Windows you use \\<IP_ADDRESS>\, if you are on MacOS you use smb://<IP_ADDRESS> to connect to the shares.

This addon exposes the following directories over smb (samba):

Directory	Description
addons	This is for your local add-ons.
addon_configs	This is for the configuration files of your add-ons.
backup	This is for your backups.
config	This is for your Home Assistant configuration.
media	This is for local media files.
share	This is for your data that is shared between add-ons and Home Assistant.
ssl	This is for your SSL certificates.

Install it
Configure it
Use it - on a PC \\<IP_ADDRESS>

thanks i have installed samba share just now

thanks very much all works!!!