-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Broker process running, but not accepting connections #629
Comments
Is it your first time running mosquitto on this environment? |
@toast-uz this is not first time. This issue does not occur often, I have faced this multiple times in this environment, it randomly occurs when broker is running from a long time (can be months). Once I restart the broker, it works fine.
Instance with broker not working fine
Seems like broker is not even listening on 1883 port. |
Any valid log of mosquitto? |
Logs were disabled on server, so I do not have any mosquitto logs. |
You can find some important hints of resolving your issue after setting logs of mosquitto. I guess some socket errors occurred on your environment. You can see "Error in poll" log with the description of the detailed cause when the issue is reproduced. |
It seems like the first listening socket (with fd=3 which is likely the IPv4 listening socket) is invalid, that is why poll returns [{fd=3, revents=POLLNVAL}]) |
@edwin-oetelaar I am not using docker. I have enabled logs on instance. I will update in case I face this issue again. |
I'm done a quick looks, and I don't find any reason why Mosquitto could close the listening socket :(
What I'm trying is to confirm is the listening socket is indeed closed or if it's still "open" but no longer listening. Finally, are you able to reproduce this issue without websockets ? There are issue about Websockets listener that stop working, I would like to eliminate the possibility for Websockets to interfere in this issue. |
I did not check the instance for long now as this is backup server and we almost never use it. Today checked and found that broker is again not accepting connections, but this time it's a throwing
Somehow it does not have write permission for db file, but that should not stop it from accepting connections ??
|
I have the same problem, practically periodically. Mosquitto service is runninq but refuses any new connections.
Mosquitto version
Last log file lines:
|
@Mixerito Are you using websockets, and if so which version of libwebsockets do you have? |
Im able to turn on my sonoff basic via tasmoadmin but when i try to switch it from hassio via mosquitto add in, i get the following error in the log: 1538815077: New connection from 192.168.1.8 on port 1883. This is all i can see in the log. over and over. I have very little coding experience, but Google has gotten me this far and now I'm stuck. Please, if anyone could point me in the right direction i would greatly appreciate it!! Here is the error im seeing in the sonoff's console: stat/sonoff/STATUS11 = {"StatusSTS":{"Time":"2018-10-06T09:29:56","Uptime":"0T01:58:06","Vcc":3.225,"POWER":"OFF","Wifi":{"AP":1,"SSId":"myNetwork","RSSI":80,"APMac":"D0:17:C2:8D:8D:11"}}} It seems to be doing reads, but then fails the connection for some reason. |
I have same issue here.. It worked yesterday after setting it up. Today in the morning Im getting: |
@pawisoon please share logs, it might help locate the issue |
I'm having this issue too. No succesful connection yet. Fresh install of raspbian stretch and mosquitto via apt. |
Same issue here. |
i use apt to install mosquitto and i have the same problem. But if i start mosquitto with just: mosquitto -v every thing is ok. service mosquitto start not working. stange.... |
I'm also seeing this on Ubuntu, where it has been installed through
The status of the systemd unit at this point is still 'running'
Restarting the systemd unit brings the service back up, and everything is fine again, despite no changes.
|
I had the same issue, fixed it by comment this line in mosquitto.conf file: I have Armbian running on NanoPi M1 Plus |
I had the same problem. After I disabled the WebSocket it is working again like a breeze. |
"mosquitto -v -d " works for me -ubuntu 18.4 |
I also have this problem. Sometimes I get a connection failed and the broker does not publish a topic at the time. When I restart the broker it's working normally a few minutes later I got the same problem. `pid_file /var/run/mosquitto.pid persistence true log_dest file /var/log/mosquitto/mosquitto.log include_dir /etc/mosquitto/conf.d max_connections -1 log_type error connection_messages true`. I am using the ubuntu 18.04 LTS server and a broker version is 1.6.12. Last one week I try to solve this issue. But I can't get a solution. Please support me and teach the right way to solve this problem. |
what is the work of this command? why you used it? |
@mukilanmws Did you have any configuration in |
After installing Mosquitto on a Mac with Homebrew, I have the same problem; except it has never worked. I've changed the setup to run as a daemon, too. I can open two terminal windows and subscribe from one and publish from the other if I use "localhost" as the host. But if I use the computer's assigned IP address, I get "Connection refused." I get the same thing from other computers on the same local network. I even changed the conf file to run Mosquitto as root. No difference. |
@Stokestack Starting from version 2.0, Mosquitto doesn't allow connections from external computers unless you explicitly configure it to do so using a |
I'm closing this issue because it's a mix of lots of different people from a long time ago. If you have the same or similar problem, please open a new issue. |
@ralight Thanks for the follow-up and the info. There are tons of tutorials out there that don't work because of this limitation. I'm not complaining about the limitation, of course. It's too bad so many people's time is wasted by incorrect tutorials, and oddly if you search on the problem you don't find that explanation prominently. |
@Stokestack Yes, it's a difficult situation. If you make breaking changes to try and improve things it does also break tutorials. It's also difficult to get the information out there. |
Hi,
I have one broker process running from long time and with
ps
I can see the process, but it is not accepting connections.The process is using far more than normal cpu usage
Output of
top
-I am using old version of mosquitto, so not sure if this issue is fixed in newer releases, though I checked and could not find any fix directly stating the problem I am facing.
Mosquitto version
OS version
Mosquitto conf
Output of memleax
Output of strace -
Please let me know if I can provide anything else to help debug the issue.
The text was updated successfully, but these errors were encountered: