Scott Bender - Node-red is broken with main bra...

Node-red is broken with main branch. Have not figured out yet what changed. This is with node-red 3.x and 4.x
InternalServerError: stream is not readable
at readStream (/usr/local/src/signalk-node-red/node_modules/body-parser/node_modules/raw-body/index.js:185:17)
at getRawBody (/usr/local/src/signalk-node-red/node_modules/body-parser/node_modules/raw-body/index.js:116:12)
at read (/usr/local/src/signalk-node-red/node_modules/body-parser/lib/read.js:79:3)
at jsonParser (/usr/local/src/signalk-node-red/node_modules/body-parser/lib/types/json.js:138:5)
at Layer.handle [as handle_request] (/usr/local/src/signalk-node-red/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:328:13)
at /usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:346:12)
at next (/usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:280:10)
at cors (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:188:7)
at /usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:224:17
at originCallback (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:214:15)
at /usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:219:13
at optionsCallback (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:199:9)
at corsMiddleware (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:204:7)
at Layer.handle [as handle_request] (/usr/local/src/signalk-node-red/node_modules/express/lib/router/layer.js:95:5)
InternalServerError: stream is not readable
at readStream (/usr/local/src/signalk-node-red/node_modules/body-parser/node_modules/raw-body/index.js:185:17)
at getRawBody (/usr/local/src/signalk-node-red/node_modules/body-parser/node_modules/raw-body/index.js:116:12)
at read (/usr/local/src/signalk-node-red/node_modules/body-parser/lib/read.js:79:3)
at jsonParser (/usr/local/src/signalk-node-red/node_modules/body-parser/lib/types/json.js:138:5)
at Layer.handle [as handle_request] (/usr/local/src/signalk-node-red/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:328:13)
at /usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:346:12)
at next (/usr/local/src/signalk-node-red/node_modules/express/lib/router/index.js:280:10)
at cors (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:188:7)
at /usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:224:17
at originCallback (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:214:15)
at /usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:219:13
at optionsCallback (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:199:9)
at corsMiddleware (/usr/local/src/signalk-node-red/node_modules/cors/lib/index.js:204:7)
at Layer.handle [as handle_request] (/usr/local/src/signalk-node-red/node_modules/express/lib/router/layer.js:95:5)
17 Replies
Scott Bender
Scott BenderOP3d ago
node-red works if I revert
Teppo Kurki
Teppo Kurki3d ago
any ideas as to why exactly? @Brandon Keepers
Brandon Keepers
Sorry, I signed off on that PR after looking at the changelog. I'll dig in
Scott Bender
Scott BenderOP3d ago
node-red code is
if (typeof stream.readable !== 'undefined' && !stream.readable) {
return done(createError(500, 'stream is not readable', {
type: 'stream.not.readable'
}))
}
if (typeof stream.readable !== 'undefined' && !stream.readable) {
return done(createError(500, 'stream is not readable', {
type: 'stream.not.readable'
}))
}
guessing they removed/changed readable
Brandon Keepers
ironic, latest recent commit on node-red repo: https://github.com/node-red/node-red/commit/ba0299abf92c31288f94e15122762b7ba1da8001 So node-red is using body-parser 1.20.3 internally, so must be some kind of conflict mixing versions
Scott Bender
Scott BenderOP3d ago
well, that may not be released and anyway . we are still on node-red 3.1
Brandon Keepers
Right, but they tried to update to body-parser 2 and their tests were failing, so they reverted it
Scott Bender
Scott BenderOP3d ago
ah, ok we need to revert too
Brandon Keepers
Yeah. I'm going to keep digging for a minute and see if I can fix the node-red issue with body-parser 2, but reverting is probably the easy route for now
Scott Bender
Scott BenderOP3d ago
specially if we did not have any specific reason to go to v2?
Brandon Keepers
No, nothing specific. Just working on updating dependencies because the debt starts to stack up
Scott Bender
Scott BenderOP3d ago
yeah, that's a tough one, because we can't test everything of course, that's the case with anything we change
Brandon Keepers
Yeah, I was thinking about that. I think there should be a sanity test that has the top ~N plugins installed and runs some very basic integration tests.
Teppo Kurki
Teppo Kurki3d ago
one would need to fire some http requests to N-R to catch this one, probably? so it gets complex pretty fast but i am not disagreeing
Scott Bender
Scott BenderOP3d ago
yep
Brandon Keepers
for sure No obviously solutions immediately, so reverting for now: https://github.com/SignalK/signalk-server/pull/1960

Did you find this page helpful?