faucetsdn / udmi

Universal Device Management Interface (UDMI) provides a high-level specification for the management and operation of physical IoT systems.
https://faucetsdn.github.io/udmi/
Apache License 2.0
47 stars 47 forks source link

validator JWT token expired #380

Open pisuke opened 2 years ago

pisuke commented 2 years ago

I've attempted doing a long validator run on a IoT Core registry that has more than 10k devices, but unfortunately the process stops with the following output:

[MQTT Rec: projects/someproject/locations/us-central1/registries/UDMS-REFLECT/devices/SOME-REGISTRY] WARN com.google.bos.iot.core.proxy.MqttPublisher - MQTT connection lost SOME-REGISTRY
Connection lost (32109) - java.io.EOFException
    at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.EOFException
    at java.base/java.io.DataInputStream.readByte(DataInputStream.java:272)
    at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65)
    at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)
    ... 1 more
mqtt client error: Connection lost

After a little bit more investigations, on IoT Core this error status is recorded

[16] mqtt: SERVER: The authorization token expired.

Perhaps validator doesn't refresh the JWT token?

grafnu commented 1 year ago

Can confirm... The relevant function is maybeRefreshJwt in MqttPublisher,java that is currently only called when sending a message -- but the validator is just listening a lot, never sends, The fix should (fingers crossed) be relatively easy...

On Tue, Jun 28, 2022 at 1:31 PM Francesco Anselmo @.***> wrote:

Assigned #380 https://github.com/faucetsdn/udmi/issues/380 to @grafnu https://github.com/grafnu.

— Reply to this email directly, view it on GitHub https://github.com/faucetsdn/udmi/issues/380#event-6896029303, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIEPDYNTEJV5JQQNA5CLXDVRMZGJANCNFSM52C6RK6A . You are receiving this because you were assigned.Message ID: <faucetsdn/udmi/issue/380/issue_event/6896029303 @.*** .com>