Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.2.2 socket error #1189

Closed
BCsabaEngine opened this issue Oct 27, 2020 · 12 comments
Closed

v4.2.2 socket error #1189

BCsabaEngine opened this issue Oct 27, 2020 · 12 comments

Comments

@BCsabaEngine
Copy link

BCsabaEngine commented Oct 27, 2020

I have just upgraded 4.2.1 to 4.2.2 (npm update) and my nodejs app cannot connect to mosquitto broker with user+pass. (settings not changed).
mosquitto.log contains "Socket error on client " lines and mqtt lib on('error') say:

Error: Connection refused: Not authorized
at MqttClient._handleConnack (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:1190:15)
at MqttClient._handlePacket (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:424:12)
at work (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:321:12)
at Writable.writable._write (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:335:5)
at doWrite (c:\Development.Priv\XX\node_modules\mqtt\node_modules\readable-stream\lib_stream_writable.js:409:139)
at writeOrBuffer (c:\Development.Priv\XX\node_modules\mqtt\node_modules\readable-stream\lib_stream_writable.js:398:5)
at Writable.write (c:\Development.Priv\XX\node_modules\mqtt\node_modules\readable-stream\lib_stream_writable.js:307:11)
at Socket.ondata (_stream_readable.js:713:22)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:303:12)

After downgrading to 4.2.1 problem solved.

AB#8673997

@rcaceiro
Copy link

rcaceiro commented Oct 27, 2020

@BCsabaEngine I have the same issue but within the browser using the WSS protocol. It produces the error WebSocket connection to 'wss://<host>:<port>/' failed: Error during WebSocket handshake: Unexpected response code: 404 it seams that are not adding the path at the end, because the correct has to be 'wss://<host>:<port>/mqtt'. I just downgrade to the version 4.2.1 without change any code and just works as expected.

@bashman
Copy link

bashman commented Oct 27, 2020

I have just upgraded 4.2.1 to 4.2.2 (npm update) and my nodejs app cannot connect to mosquitto broker with user+pass. (settings not changed).
mosquitto.log contains "Socket error on client " lines and mqtt lib on('error') say:

Error: Connection refused: Not authorized
at MqttClient._handleConnack (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:1190:15)
at MqttClient._handlePacket (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:424:12)
at work (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:321:12)
at Writable.writable._write (c:\Development.Priv\XX\node_modules\mqtt\lib\client.js:335:5)
at doWrite (c:\Development.Priv\XX\node_modules\mqtt\node_modules\readable-stream\lib_stream_writable.js:409:139)
at writeOrBuffer (c:\Development.Priv\XX\node_modules\mqtt\node_modules\readable-stream\lib_stream_writable.js:398:5)
at Writable.write (c:\Development.Priv\XX\node_modules\mqtt\node_modules\readable-stream\lib_stream_writable.js:307:11)
at Socket.ondata (_stream_readable.js:713:22)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:303:12)

After downgrading to 4.2.1 problem solved.

AB#8673997

Yes, same situation.

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 27, 2020

thanks for filing this quickly. I'll take a look at the issue.

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 27, 2020

@bashman @rcaceiro @BCsabaEngine can you let me know which version of node you are using?

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 27, 2020

ok. It was a change that was supposed to be rolled back but didn't. There's going to be another patch release soon to fix this.

@BCsabaEngine
Copy link
Author

@bashman @rcaceiro @BCsabaEngine can you let me know which version of node you are using?

Node 14.15.0 linux, 14.13.0 win.
Production and dev same effect.

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 27, 2020

@BCsabaEngine can you change the two lines that are being changed in the linked PR in your code while running v4.2.2 to validate that the change is effective.

@BCsabaEngine
Copy link
Author

BCsabaEngine commented Oct 27, 2020

After commit the two changed lines it works! We are waiting for official release.

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 27, 2020

kk published @4.2.3, please check that it works and close this issue if it does.

@BCsabaEngine
Copy link
Author

BCsabaEngine commented Oct 27, 2020

kk published @4.2.3, please check that it works and close this issue if it does.

Perfect, "npm outdated" reported new version, after update works fine.

@BCsabaEngine
Copy link
Author

BCsabaEngine commented Oct 27, 2020

I am happy to see my shrinkwrap about mqtt: some dependency updated/removed by you.

@rcaceiro
Copy link

rcaceiro commented Oct 28, 2020

@bashman @rcaceiro @BCsabaEngine can you let me know which version of node you are using?

My situation continues. I am using MQTT.js for browser.
mqtt.min.js:1 WebSocket connection to 'wss://< host >:9002/' failed: Error during WebSocket handshake: Unexpected response code: 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants