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

Freezing browser with Mosquitto 1.5 #169

Open
tim-bitreactive opened this issue Jul 11, 2018 · 25 comments
Open

Freezing browser with Mosquitto 1.5 #169

tim-bitreactive opened this issue Jul 11, 2018 · 25 comments

Comments

@tim-bitreactive
Copy link

tim-bitreactive commented Jul 11, 2018

Code that ran fine with mosquitto 1.4.15 stopped working with mosquitto 1.5 and freezes the browser.
The issue can be replicated by running the sample code from the project main page.
In the development console thousands of executions of the 'onConnect' method can be seen. It seems some out-of-control loop is freezing up the browser.

@telemac
Copy link

telemac commented Jul 17, 2018

I have the same behavior with mosquito 1.5

@lnowakowski
Copy link

Also same here after mosquitto upgrade

@Pepper-Ng
Copy link

same here, mosquitto 1.5
All websockets implementations based on Paho javascript have this issue, onconnect keeps firing in an infinite loop, causing everything else to freeze up.

@icraggs
Copy link
Collaborator

icraggs commented Aug 2, 2018

Are there any messages on the Mosquitto console which explain the inability to connect?

@lnowakowski
Copy link

Haven't seen nothing unusual on Mosquitto side, only this infinite loop on client side

@tim-bitreactive
Copy link
Author

tim-bitreactive commented Aug 8, 2018 via email

@icraggs
Copy link
Collaborator

icraggs commented Aug 8, 2018

I just tried this on Ubuntu with Mosquitto 1.5, and both the latest Paho JS client, and the utility at: http://www.eclipse.org/paho/clients/js/utility/, and both worked fine. This was without TLS.

Are you all using TLS? If so, can you see if it works without TLS? Any other factors at work here?

@tim-bitreactive
Copy link
Author

tim-bitreactive commented Aug 9, 2018

No, we did not use TLS.
Which architecture did you run the test on? For us mosquitto was always on armhf, the client on both, armhf and amd64.
We are using the jessie versions, not stretch.

@icraggs
Copy link
Collaborator

icraggs commented Aug 9, 2018

Both client and server were on the same machine, amd64. I could try on an ARM architecture machine - Raspberry Pi. Can you start the JS console on the browser first and see if there are any useful messages?

@bergie
Copy link

bergie commented Aug 19, 2018

We're also seeing this with msgflo-browser (which uses this library underneath) when connecting to mosquitto 1.5 from Debian. No TLS, no auth. Mosquitto runs on x86, but same failure occurs on both x86 and ARM (RPi3) clients on Chrome and Firefox.

Nothing in Console or Network tabs, and the browser process becomes unresponsive.

msgflo/msgflo-browser#7

Code:
https://github.com/c-base/infoscreens/blob/master/infodisplay/infodisplay.js

@icraggs
Copy link
Collaborator

icraggs commented Aug 20, 2018

@bergie where, on what platform, is Mosquitto 1.5 running?

@mykolaspocius
Copy link

I have the same issue. Mosquitto 1.5 running on rpi. Client on windows. I get infinite onConnect event firing. I checked mosquito logs and looks like there all is fine. Connects once and when i close browser -disconnects.

@bergie
Copy link

bergie commented Sep 3, 2018

@icraggs as stated in the ticket:

  • Mosquitto 1.5 running on Debian, x86
  • Javascript clients running on multiple browsers, multiple architectures

All of the clients (as well as multiple versions of this library) exhibited the same infinite loop and freezing when connecting to mosquitto 1.5. The only fix we've found was to downgrade the mosquitto broker.

@jbaans
Copy link

jbaans commented Sep 11, 2018

Hi, I've had similar issues, explicitly setting mqtt protocol version helped.

@bergie
Copy link

bergie commented Sep 13, 2018

@jbaans interesting. What value worked?

@jbaans
Copy link

jbaans commented Sep 13, 2018

for the JS client you can try:
with mqttVersionExplicit: true, set either
mqttVersion: 3 (mqttv3.1)
or
mqttVersion: 4 (mqttv3.1.1)

Actually I just double checked and noticed I installed mosquitto git version 4f838e5 explicitly (configured build WITH_WEBSOCKETS:=yes), this could also explain why I have no trouble.
Note protocols v3.1.1 and v3.1 work differently (see mosquitto.conf).

@vonnieda
Copy link

vonnieda commented Nov 20, 2018

Same problem, and happens with MQTT.js and Hive client too.

  • Mosquitto 1.5.4 on Ubuntu 14.04.
  • Paho JS, MQTT.js, Hive JavaScript client on Chrome and FireFox.

@sureshtsl
Copy link

I had the same issue. Everything worked after reinstalling Mosquitto with websocket enabled as per the post https://gist.github.com/smoofit/dafa493aec8d41ea057370dbfde3f3fc

@cok666n
Copy link

cok666n commented Apr 16, 2020

So has anyone found a fix for this? I'm having the same issue with CloudMQTT, so I unfortunately cannot rollback to a specific version of the broker.

@Dacesilian
Copy link

I probably have the same problem. It's insane that this issue is opened for so long. :(

@vonnieda
Copy link

@Dacesilian and @cok666n: This is an issue with mosquitto. You can fix it by recompiling with the correct websockets library. See eclipse-mosquitto/mosquitto#1050.

@Dacesilian
Copy link

@vonnieda Thank you! I've installed mosquitto 1.6.12-1 with apt-get -t testing install mosquitto, will see if it helps. Previously I was using version 1.5.7-1+deb10u1.

@cok666n
Copy link

cok666n commented Oct 16, 2020

Sorry I never got back to comment, it was indeed and issue with the mosquitto broker, but since it wasn't in my control (cloud based 3rd party broker) I couldn't do much to fix it.

I ended up having a few back and forth with the support of that provider, and they eventually fixed the issue. They never admitted to using a new version of the broker like I suggested though.

@Dacesilian
Copy link

Dacesilian commented Oct 17, 2020

Using Debian package from testing repository probably doesn't solve the issue, so another possibility is to use package for Debian directly from Mosquitto, as written here - https://mosquitto.org/blog/2013/01/mosquitto-debian-repository/ .

apt-cache policy mosquitto
sudo apt-get install mosquitto=1.6.12-0mosquitto1~buster1

@AndreVanKammen
Copy link

AndreVanKammen commented Dec 24, 2021

I also just ran into this issue I did an upgrade on my Raspberry Pi Debian Jessie which installed mosquitto 1.5.8 and now my javascript client breaks. This thing has been running for years without a hick-up, I just wanted to add some p1 smartMeter support to my own Home automation running on Mosquitto some esp's and a javascript client. I managed to downgrade it to mosquitto 1.4.15 so it works again for now.

I've basicly come to the conclussion that my old Pi installation is useless. Outdated, nothing works on it anymore, just another disapointing everything breaks because the community moves on to the latest new and shiny. Every python thing I try is broken. Nodejs is unupgradable because of missing libstd support and now I've broken my mosquitto by installing the latest jessie supported version. I already had to find a mirror thats still supported it because Debian completly removed Jessie. Trying to upgrade Jessie also breaks on several points.

I'll just make a new install for my Rapsberry pi and set everything up again from scratch which is mostly my experience with linux, after a while it's just broken because the community makes it impossible to install new stuff on an old OS. It turns into one big dependancy problem which reminds me of the DLL hell in windows.

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