eclipse-mosquitto / mosquitto

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

Error in epoll disconnecting websockets: No such file or directory #1720

Open shomicg opened 4 years ago

shomicg commented 4 years ago

I am using the Mosquitto version 1.6.9 with HA setup and I start getting the weird error after implementing the secured connection in between the bridge and brokers.

Error in epoll disconnecting websockets: No such file or directory
Socket error on client Id-1591617858101-0.29048176957746175, disconnecting.

Below is my config file for Brokers

# General Mosquitto Config
user mosquitto
allow_duplicate_messages false
autosave_interval 60
autosave_on_changes false
connection_messages true
allow_anonymous false

#Persistence Storage
persistence true
persistence_file mosquitto.db
persistence_location /opt/company/mosquitto/db/

#Logging
log_dest stdout
log_dest stderr
log_dest topic
log_dest file /opt/company/mosquitto/mosquitto.log
log_type all
log_timestamp true
log_facility local 7
log_timestamp_format %Y-%m-%dT%H:%M:%S
log_timestamp true

#ACL FIle
password_file /opt/company/mosquitto/config/pwfile
acl_file /opt/company/mosquitto/config/aclfile

# Protocal MQTT
listener 1883
protocol mqtt

#Protocal Websocket
listener 8080
protocol websockets

# Bridge specific config
connection broker1
keepalive_interval 20
round_robin false
try_private true
addresses bridge:8883 bridge:8884
bridge_cafile /opt/company/mosquitto/ssl/ca.crt
bridge_certfile /opt/company/mosquitto/ssl/server.crt
bridge_keyfile /opt/company/mosquitto/ssl/server.key
tls_version tlsv1.2
start_type automatic
notifications true
cleansession true
bridge_protocol_version mqttv31
topic # out 2 "" broker1/
# inbound will be added in run.sh
##############################################

#Config File for bridge
# General Mosquitto Config
user mosquitto
allow_duplicate_messages false
autosave_interval 60
autosave_on_changes false
connection_messages true

#Persistence Storage
persistence true
persistence_file mosquitto.db
persistence_location /opt/company/mosquitto/bridge/db/

#Logging
log_dest stdout
log_dest stderr
log_dest topic
log_type all
log_timestamp true
log_facility local 7
log_timestamp_format %Y-%m-%dT%H:%M:%S
log_timestamp true
log_dest file /opt/company/mosquitto/bridge/mosquitto.log

# WebSockets
listener 8883
protocol mqtt

# TLS for 8883
cafile /opt/company/mosquitto/bridge/ssl/ca.crt
certfile /opt/company/mosquitto/bridge/ssl/server.crt
keyfile /opt/company/mosquitto/bridge/ssl/server.key
require_certificate true
tls_version tlsv1.2

And below is my Architecture

mosquitto-brokers-ha ,

ralight commented 4 years ago

First off, thanks for the detailed config and diagram. You don't need to worry about the log message itself, it probably shouldn't be there. It's essentially saying "there was an error removing the client socket from epoll, because the client socket wasn't registered with epoll". Which is fine.

The question is - are you seeing unexpected disconnections, or was it just the message you were worried about?

shomicg commented 4 years ago

I am seeing unexpected disconnection also

ralight commented 4 years ago

Sorry I've been busy with other things. When you say you see unexpected disconnections, are you sure that it isn't a client problem? Is there any other information you can give me that would help figure out what you're seeing? From the messages above all I can tell is that the clients are disconnecting, nothing more.

shomicg commented 4 years ago

2020-11-02T10:40:10: Socket error on client local.broker2.broker2, disconnecting. 2020-11-02T10:40:16: Bridge local.broker2.broker2 doing local SUBSCRIBE on topic # 2020-11-02T10:40:16: Connecting bridge broker2 (bridge:8883) 2020-11-02T10:40:16: Bridge broker2.broker2 sending CONNECT 2020-11-02T10:40:19: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:40:19: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:40:34: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:40:34: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:40:49: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:40:49: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:02: Saving in-memory database to /opt/mosquitto/db/mosquitto.db. 2020-11-02T10:41:04: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:04: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:16: Socket error on client local.broker2.broker2, disconnecting. 2020-11-02T10:41:19: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:19: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:22: Bridge local.broker2.broker2 doing local SUBSCRIBE on topic # 2020-11-02T10:41:22: Connecting bridge broker2 (bridge:8884) 2020-11-02T10:41:22: Bridge broker2.broker2 sending CONNECT 2020-11-02T10:41:28: Socket error on client local.broker2.broker2, disconnecting. 2020-11-02T10:41:34: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:34: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:34: Bridge local.broker2.broker2 doing local SUBSCRIBE on topic # 2020-11-02T10:41:34: Connecting bridge broker2 (bridge:8883) 2020-11-02T10:41:34: Bridge broker2.broker2 sending CONNECT 2020-11-02T10:41:49: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:41:49: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:42:03: Saving in-memory database to /opt/mosquitto/db/mosquitto.db. 2020-11-02T10:42:04: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:42:04: Sending PINGRESP to d51872b3d32f4afa8051a1e9234f9111 2020-11-02T10:42:19: Received PINGREQ from d51872b3d32f4afa8051a1e9234f9111

shomicg commented 4 years ago

I am seeing these errors and try to implement the SSL but than remove it. Now Its not at all working