v0.3.0: Connection refused with old adapter BSB_LAN v0.42
Closed this issue · 2 comments
Describe the bug
Since update the adapter from v0.2.2 to v0.3.0 i got connction refused with BSB_LAN v0.42
Screenshots & Logfiles
2022-10-07 13:08:27.625 - error: bsblan.0 (7511) Error: connect ECONNREFUSED 192.168.178.8:80
2022-10-07 13:08:27.626 - error: bsblan.0 (7511) RequestError: Error: connect ECONNREFUSED 192.168.178.8:80
at new RequestError (/opt/iobroker/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/opt/iobroker/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/opt/iobroker/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/opt/iobroker/node_modules/request/request.js:185:22)
at Request.emit (events.js:400:28)
at Request.onRequestError (/opt/iobroker/node_modules/request/request.js:881:8)
at ClientRequest.emit (events.js:412:35)
at Socket.socketErrorListener (_http_client.js:475:9)
at Socket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
2022-10-07 13:08:27.626 - error: bsblan.0 (7511) Connection failed
Versions:
- Adapter version: 0.3.0
- JS-Controller version: 4.0.32
- Node version: v14.19.3
- Operating system: Debian 9.13
Additional context
I also use an BSB_LAN 2.1.8-20220731102301 (ESP32 version), that works fine with v0.3.0.
Thank you for the feedback. I will try to reproduce with my old adapter
I have finally found the issue. Until v2.0 bsblan sent an invalid separator of http header and http body. Instead of sending \r\n it sent \n\n. Using a newer node version has a stricter http header parser than in the past. That is why it is failing now. There is no good way to work around this issue beside enabling insecure http parsing which I don't want to recommend.
This issue was fixed starting from v2.0 which will be the new minimum version being supported.