Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Mosquitto stops accepting connections

Hello guys, i've been using mosquitto with paho's python and _javascript_ clients, I have the mosquitto client running in an AWS instance, it receives from 1 to 10 connections a day, and something weird is happening, without knowing why, it stops accepting connections from the clients.

This is my mosquitto conf:
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
max_connections -1  # accept "unlimited" connections
port 1883
protocol mqtt
listener 8080 0.0.0.0
protocol websockets

In the browser I read this error:
WebSocket connection to 'ws://xx.xxx.xxx.xx:8080/mqtt' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

With mosquitto_sub i just get:
Error: Connection refused

I have mosquitto running under supervisord.

Supervisor status
mosquitto                        RUNNING   pid 1179, uptime 13 days, 1:51:16

Supervisord.conf
[program:mosquitto]
command=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
stdout_logfile=/tmp/log/mosquitto/mosquitto.log
stdout_logfile_maxbytes=5MB
autorestart=true 


Supervisor's log is empty, and mosquitto's tailf log reads:
1447771263: Config loaded from /etc/mosquitto/mosquitto.conf.
1447771263: Opening websockets listen socket on port 8080.
1447771263: Error: Unable to create websockets listener on port 8080.

But it's also weird because websockets work fine, and there's no timestamp on those logs. Also, I would like to add, that if mosquitto is restarted doing "supervisorctl restart mosquitto", it starts working normal again.
I don't know if it's a supervisor bug, mosquitto bug, or i'm just missing something. Hope you can guide me.

Sorry for not having any more information.

Thank you!


Back to the top