Hello,
We're currently using Node-RED 4.0.2 and we've upgraded UI-Builder from 3.3.1 to 6.8.2.
Since the upgrade, we are encountering 413 Payload Too Large
errors when posting JSON payloads that are higher than 100kB:
PayloadTooLargeError: request entity too large
at readStream (/usr/src/node-red/node_modules/raw-body/index.js:163:17)
at getRawBody (/usr/src/node-red/node_modules/raw-body/index.js:116:12)
at read (/usr/src/node-red/node_modules/node-red-contrib-uibuilder/node_modules/body-parser/lib/read.js:79:3)
at jsonParser (/usr/src/node-red/node_modules/node-red-contrib-uibuilder/node_modules/body-parser/lib/types/json.js:138:5)
at Layer.handle [as handle_request] (/usr/src/node-red/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/usr/src/node-red/node_modules/express/lib/router/index.js:328:13)
at /usr/src/node-red/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/usr/src/node-red/node_modules/express/lib/router/index.js:346:12)
at next (/usr/src/node-red/node_modules/express/lib/router/index.js:280:10)
at expressInit (/usr/src/node-red/node_modules/express/lib/middleware/init.js:40:5)
This issue only happens after adding the UI-Builder dependency (without it, Node-RED will accept such large payloads).
Steps to reproduce:
- Create a Node-RED
settings.js
file:
module.exports = {
httpAdminRoot: '/node-editor',
httpNodeRoot: '/node'
}
- Create a
DockerFile
:
FROM nodered/node-red:4.0.2-20
USER node-red
RUN yarn add node-red-contrib-uibuilder@6.8.2
COPY ./settings.js /data/settings.js
- Start Node-RED:
docker build .
docker run -p 1880:1880 <image-id>
- Send a large JSON as request body to
http://127.0.0.1:1880/node/test
Strangely enough, the error does not appear if the configured httpAdminRoot
is equal to httpNodeRoot
, in the Node-RED settings file.
The Node-RED flows don't even need to have any active UI-Builder node for the issue to happen.
Does anyone have ideas what could cause this issue?
Thanks