Open sogartar opened 5 years ago
Do you think you could you try and capture wireshark trace of when this happens?
My Mosquitto broker instance has been running in the cluster for 178 days straight and worked fine. Today, suddenly it decided to repeatedly reject any client connections.
1574339562: Socket error on client pipeline-22, disconnecting.
1574339562: Socket error on client 0b605f7a-c010-4647-bf47-7265c0be84ac1574338670367, disconnecting.
1574339562: Socket error on client ESP32_cc2808, disconnecting.
1574339562: Socket error on client scheduler-service-46, disconnecting.
1574339562: Socket error on client ESP32_cc31CC, disconnecting.
1574339562: Socket error on client 417512ea-18a4-4494-819c-d61032c3ddb51574333357250, disconnecting.
1574339562: Socket error on client locator-processor13-21, disconnecting.
1574339562: Socket error on client locator-api3-31, disconnecting.
It started behaving this way relatively after I made an unrelated change in my kubernetes configuration: I exposed some unrelated TCP service through my Nginx Ingress.
The only way that unrelated change might have affected the mqtt broker is that it caused the nginx ingress to restart, which caused all mqtt client connections to close.
Soon after nginx booted up, clients started re-connecting but this time unsuccessfully with broker throwing Socket error on client X, disconnecting
.
Edit: I managed to get the broker not to disconnect a client by supplying unique username/password on the client. This frightens me since credentials should not play any role when authentication is disabled.
Hi, I'm seeing something very similar using mosquittopp 1.6.4 on ARM, localhost connections:
this->loop_start();
this->connect();
while (x5) {this->publish (...);}
1582069468: Sending CONNACK to auth_manager (0, 0) 1582069468: Received PUBLISH from auth_manager (d0, q1, r1, m1, 'device/auth', ... (495 bytes)) 1582069468: Sending PUBACK to auth_manager (m1, rc0) 1582069468: Sending PUBLISH to mosq/zD3DRWvoOKp2e4oeSb (d0, q0, r0, m0, 'device/auth', ... (495 bytes)) 1582069468: Received DISCONNECT from mosq/zD3DRWvoOKp2e4oeSb
The big concern for me is I have on_disconnect
set and it does not fire with an error. The first message always fires, the next 4 usually do. When it fail's the last 4 all fail to pub, but the first message always get's pub'd.
I'd say this is more like 1/20 for me.
From time to time, I have the same Socket error on client <SOME_NAME>, disconnecting.
issue for some of my devices (anonymous connections, all devices have status IPs)
As all of my devices are exactly the same (hardware and software except devise's name passed to MQTT) I can observe that the issue occurs more often on devices that stand further from my router (but I cannot replicate it when taking one of them with a power bank power supply of the range of the router).
From my perspective, another, noticeable, issue is that after the Socket error on client(...)
last will message is not triggered (it would allow me to force restart the device).
Any ideas if it's possible to fetch "last will" on such kind of errors?
@kotu-pl What version of Mosquitto are you using? Are you absolutely sure that a Will message is being set on your client? If you are able to provide a wireshark/tcpdump trace of the broker we may be able to figure out what is happening.
the same issue was observed in my setup also I am using mosquitto-1.5.5 getting below log continuously, Socket error on client disconnecting
thanks, Chandra
There seems to be several related problems (#523, #1023, #7, #1197) but I am not sure, so I am posting a new issue.
I have a simple test where
Once every few 100 attempts I get from the broker
I am using v1.6 and the C++ interface in mosquittopp. Below is the test code.
The console output is.
I thought that the problem may be that disconnect is being sent too quickly, but that is not it. The output then is.
As you can see the client attempts the connection again if it fails.
I have another more complex test where publishing and subscribing are involved also. There I get the error more often.