eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.08k stars 2.4k forks source link

Mosquitto service changes status from active (running) to active (exited) after connect with faulty credentials #733

Open chessweb01 opened 6 years ago

chessweb01 commented 6 years ago

I'm running mosquitto 1.4.14 as a service on Ubuntu 16.04 with websocket support.

When I connect with the HiveMQ websocket client (http://www.hivemq.com/demos/websocket-client/) using the correct username/password credentials everything is fine. I can connect/disconnect as often as I like.

When I try to connect using faulty credentials (e.g. a misspelled username or password) I get an error message that the socket is closed which is also ok.

However, even after correcting the credentials I can no longer connect. The error message stays the same.

The reason is this: Just trying to connect with wrong credentials causes the mosquitto service to change status from active (running) to active (exited). Is that a bug and if not, how can I deal with it?

toast-uz commented 6 years ago

Could you show your mosquitto.log?

chessweb01 commented 6 years ago

When I repeat the above procedure, i.e.

  1. successfully connect with correct credentials
  2. disconnect
  3. failed connect with faulty credentials
  4. repeated tries to connect with correct credentials (always failing)

there is nothing added to the log file after step 2.

By the way, the change in service status from active (running) to active (exited) happens on the first try in step 4 and not on step 3 as the original post and the title suggests.

toast-uz commented 6 years ago

Could you add followings at your mosquitto.conf and reproduce the issue in order to get more useful logs?

log_type all
websockets_log_level 255
chessweb01 commented 6 years ago

The attached file contains the complete logs from restarting the broker through steps 1 to 4 with one unsuccessful try to connect with correct credentials.

mosquitto.log