eclipse-kura / kura

Eclipse Kura™ is a versatile framework to supercharge your edge devices, streamlining the process of configuring your gateway, connecting sensors, and IoT devices to seamlessly collect, process, and send data to the cloud.
https://eclipse.dev/kura/
Eclipse Public License 2.0
506 stars 312 forks source link

Paho issue with WS broker #2412

Closed markoer closed 5 years ago

markoer commented 5 years ago

Describe the bug There is an issue with the new Paho (#2405):

2019-04-01T12:48:48,593 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - # ------------------------------------------------------------
2019-04-01T12:48:48,594 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  Connection Properties
2019-04-01T12:48:48,594 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  broker    = ws://...:8080
2019-04-01T12:48:48,595 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  clientId  = 00:60:0C:AA:AA:AA
2019-04-01T12:48:48,595 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  username  = ...
2019-04-01T12:48:48,596 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  password  = ...
2019-04-01T12:48:48,596 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  keepAlive = 30
2019-04-01T12:48:48,596 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  timeout   = 20
2019-04-01T12:48:48,597 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  cleanSession    = true
2019-04-01T12:48:48,605 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  MQTT version    = 3.1.1
2019-04-01T12:48:48,605 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  willDestination = $EDC/.../00:60:0C:AA:AA:AA/MQTT/LWT
2019-04-01T12:48:48,605 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  willMessage     =
2019-04-01T12:48:48,606 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #
2019-04-01T12:48:48,606 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  Connecting...
2019-04-01T12:48:48,933 [HouseKeeperTask] INFO  o.e.k.c.d.s.HouseKeeperTask - HouseKeeperTask started.
2019-04-01T12:48:48,934 [HouseKeeperTask] INFO  o.e.k.c.d.s.HouseKeeperTask - HouseKeeperTask: Delete confirmed messages...
2019-04-01T12:48:48,946 [HouseKeeperTask] INFO  o.e.k.c.d.s.HouseKeeperTask - HouseKeeperTask ended.
2019-04-01T12:48:49,682 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - #  Connected!
2019-04-01T12:48:49,682 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - # ------------------------------------------------------------
2019-04-01T12:48:49,683 [qtp26414618-206] INFO  o.e.k.c.d.DataServiceImpl - Notified connected
2019-04-01T12:48:49,683 [qtp26414618-206] INFO  o.e.k.c.d.DataServiceImpl - New session established. Unpublishing all in-flight messages. Disregarding the QoS level, this may cause duplicate messages.
2019-04-01T12:48:50,103 [qtp26414618-206] INFO  o.e.k.c.d.DataServiceImpl - Storing message on topic: $EDC/#account-name/#client-id/MQTT/BIRTH, priority: 0
2019-04-01T12:48:50,120 [qtp26414618-206] INFO  o.e.k.c.d.DataServiceImpl - Stored message on topic: $EDC/#account-name/#client-id/MQTT/BIRTH, priority: 0
2019-04-01T12:48:50,147 [DataServiceImpl:Submit] INFO  o.e.k.c.d.t.m.MqttDataTransport - Publishing message on topic: $EDC/.../00:60:0C:AA:AA:AA/MQTT/BIRTH with QoS: 0
2019-04-01T12:48:50,160 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - Subscribing to topic: $EDC/.../00:60:0C:AA:AA:AA/# with QoS: 1
2019-04-01T12:48:50,368 [qtp26414618-206] INFO  o.e.k.c.d.t.m.MqttDataTransport - Subscribing to topic: .../00:60:0C:AA:AA:AA/W1/A1/# with QoS: 0
2019-04-01T12:48:51,484 [MQTT Rec: 00:60:0C:AA:AA:AA] WARN  o.e.k.c.d.t.m.MqttDataTransport - Connection Lost
Connection lost (32109) - java.io.EOFException
        at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:189)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException
        at java.io.DataInputStream.readByte(DataInputStream.java:267)
        at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
        at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:136)
        ... 1 more
2019-04-01T12:48:51,486 [MQTT Rec: 00:60:0C:AA:AA:AA] INFO  o.e.k.c.d.DataServiceImpl - connectionLost

This is from RC build when connected to either ws://...:8080 broker or its secure counterpart.

To Reproduce Steps to reproduce the behavior:

  1. Configure Cloud Connections -> MqttDataTransport with a ws-protocol server
  2. Click on Connect/Disconnect
  3. Observe kura.log

Expected behavior Cloud client connects and remains connected.

Target Environment (please complete the following information):

MMaiero commented 5 years ago

Probably related to https://github.com/eclipse/paho.mqtt.java/issues/637

markoer commented 5 years ago

Verified in 4.1.0-RC b.52.