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

Abnormal startup on Pi #894

Open
dhabib29 opened this issue Jul 23, 2018 · 22 comments
Open

Abnormal startup on Pi #894

dhabib29 opened this issue Jul 23, 2018 · 22 comments

Comments

@dhabib29
Copy link

Hi,
I am pretty new to MQTT, however after completing the installation on Raspberrypi3 running on Jessie when I am trying to test mqtt if keep trying to connect what it means is after i run the below command:
mosquitto_sub -d -u username -P password -t "dev/test"
the response I am getting is Client mosqsub/1017-pi sending CONNECT and this keep repeating like it is in some kind of loop.
I also checked the systemctl status mosquitto.service and it is showing as active.
I also tried uninstalling and reinstalling but issue is always the same and log file has nothing in it even I have log_type all in the config file.
your help is appreciated.

@toast-uz
Copy link
Contributor

Your log was entirely empty? Didn't you have any startup message?

@dhabib29
Copy link
Author

yes just the startup message and when I restart pi closing message

@toast-uz
Copy link
Contributor

Therefore, show the messages which might contain useful information, e.g. your mosquitto version,

@toast-uz toast-uz added the Status: Blocked Another issue needs to be resolved first label Jul 24, 2018
@dhabib29
Copy link
Author

1532374056: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
1532374056: Config loaded from /etc/mosquitto/mosquitto.conf.
1532374056: Opening ipv4 listen socket on port 1889.
1532374056: Opening ipv6 listen socket on port 1889.
1532374193: Error in poll: Interrupted system call.
1532374193: mosquitto version 1.4.10 terminating
1532374200: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
1532374200: Config loaded from /etc/mosquitto/mosquitto.conf.
1532374201: Opening ipv4 listen socket on port 1889.
1532374201: Opening ipv6 listen socket on port 1889.
1532376148: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1532377155: Error in poll: Interrupted system call.
1532377155: mosquitto version 1.4.10 terminating
1532377162: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
1532377162: Config loaded from /etc/mosquitto/mosquitto.conf.
1532377162: Opening ipv4 listen socket on port 1889.
1532377162: Opening ipv6 listen socket on port 1889.
1532385617: Error in poll: Interrupted system call.
1532385617: mosquitto version 1.4.10 terminating
1532385626: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting

this is whats in the log

@toast-uz
Copy link
Contributor

A lot of information !!

  • Your mosquitto's version 1.4.10 is too old. Could you upgrade?
  • Your mosquitto binds on port 1889. You had some customization on the mosquitto,conf . Could you show it?
  • Your mosquitto stopped abnormally.

@toast-uz
Copy link
Contributor

p.s.

  • Your mosquitto_sub's target port is default (= 1883), while your mosquitto broker binds on port 1889. Why do you think they can connect with each other?

@dhabib29
Copy link
Author

I tried the latest installation using sudo apt-get install mosquitto. yes I only changed the port in the config file to check if that is the port issue however with changing the port or keeping it to default doesn't make any difference.
How to upgrade to latest version?
I dont know why it is stopping abnormally I am restarting the pi using sudo reboot.

@toast-uz
Copy link
Contributor

On current version, clear current logs, clear mosquitto.conf without log_type all, reproduce your issue, and show the new logs.
I'm afraid I have no expertise on building specific environment. You can ask such questions at mosquitto-dev ML.

@dhabib29
Copy link
Author

1532443852: Error in poll: Interrupted system call.
1532443852: mosquitto version 1.4.10 terminating
1532443853: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
1532443853: Config loaded from /etc/mosquitto/mosquitto.conf.
1532443853: Opening ipv4 listen socket on port 1883.
1532443853: Error: Address already in use

I did all of that, i also cahnge the port to default 1883 above is the log

@toast-uz
Copy link
Contributor

Is there any log prior of these logs? Mosquitto cannot terminate before starting. Please don't trim the information.

@dhabib29
Copy link
Author

no there is nothing before that.
after cleaning the log and changing the config file I restarted mosquitto. and this what get looged.

@toast-uz
Copy link
Contributor

Could you restart pi itself and show your logs? You had such a "ghost" mosquitto, so mosquitto failed restarting.

@dhabib29
Copy link
Author

1532443852: Error in poll: Interrupted system call.
1532443852: mosquitto version 1.4.10 terminating
1532443853: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
1532443853: Config loaded from /etc/mosquitto/mosquitto.conf.
1532443853: Opening ipv4 listen socket on port 1883.
1532443853: Error: Address already in use
1532444784: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
1532444784: Config loaded from /etc/mosquitto/mosquitto.conf.
1532444784: Opening ipv4 listen socket on port 1883.
1532444784: Error: Address already in use
1532444846: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting

done the restart.
above is the log file.
I really appreciate your help.

@toast-uz
Copy link
Contributor

This issue definitely comes from your broker starting abnormally.
Could you change the subject of this issue to such a "Error: Address already in use on pi" in order to describe the issue clearly?

This error "Address already in use" seems similar to #825 .
Try the workaround deleting the line "listener 1883" in /etc/mosquitto/conf.d/pi.conf .

@dhabib29
Copy link
Author

it seems like I don't have the pi.conf in conf.d folder
however i commented on "listener 1883" by doing that already in use error goes away however error in poll: interrupted system call remains

1532443934: Error in poll: Interrupted system call.
1532443934: mosquitto version 1.4.10 terminating
1532443934: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting

@toast-uz
Copy link
Contributor

Did you restart pi itself? By the last line of your logs, mosquitto seemed starting normally.

@toast-uz
Copy link
Contributor

toast-uz commented Jul 24, 2018

Sorry if your mosquitto starts normally, there should be the logs as followings:

Config loaded from /etc/mosquitto/mosquitto.conf.
Opening ipv4 listen socket on port 1883.

@dhabib29
Copy link
Author

Yes it did restarted the pi and mosquitto.
but the original issue remains. which is CONNECT keep going through the loop.

@toast-uz
Copy link
Contributor

Sorry I cannot support the issue depends on pi. Wait someone can support.

@dhabib29
Copy link
Author

No problem. I will wait.
Thanks toast for all your help.

@toast-uz toast-uz added help wanted and removed Status: Blocked Another issue needs to be resolved first labels Jul 24, 2018
@toast-uz
Copy link
Contributor

@dhabib29 could you change the subject to such as "Abnormal startup on pi" in order to make the issue clear. The loop of subscribing is definitely due to the broker starting abnormally.

@dhabib29 dhabib29 changed the title Subscribing to topic keep looping through CONNECT Abnormal startup on Pi Jul 25, 2018
@ralight
Copy link
Contributor

ralight commented Aug 1, 2018

Could you please try installing from the mosquitto repository? There are details on how to do that here: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-debian-8

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

No branches or pull requests

3 participants