thingsboard / thingsboard-edge

Apache License 2.0
93 stars 71 forks source link

[Bug] The edge of 3.5.1 cannot connect to the cloud of 3.6.1 #90

Closed ryan-2048 closed 4 months ago

ryan-2048 commented 7 months ago

The saved attribute nodes are not compatible. As the edges cannot be upgraded simultaneously, my cloud cannot be upgraded either

volodymyr-babak commented 7 months ago

@Kevin-ox

Hello, to better assist you, could you please provide more details regarding the update process on your edge device? Specifically, we need logs from the update process that is failing for you. Please share the relevant logs when you get a chance.

ryan-2048 commented 7 months ago

Thank you for your reply! After I updated the cloud to 3.6.1, I found that the save properties node failed to start after starting the edge of 3.5.1, error log: org.thingsboard.rule.engine.api.TbNodeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "updateAttributesOnlyOnValueChange" (class org.thingsboard.rule.engine.telemetry.TbMsgAttributesNodeConfiguration), not marked as ignorable (3 known properties: "scope", "notifyDevice", "sendAttributesUpdatedNotification"]) at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: org.thingsboard.rule.engine.telemetry.TbMsgAttributesNodeConfiguration["updateAttributesOnlyOnValueChange"]) at org.thingsboard.rule.engine.api.util.TbNodeUtils.convert(TbNodeUtils.java:48) at org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode.init(TbMsgAttributesNode.java:60) at org.thingsboard.server.actors.ruleChain.RuleNodeActorMessageProcessor.initComponent(RuleNodeActorMessageProcessor.java:173) at org.thingsboard.server.actors.ruleChain.RuleNodeActorMessageProcessor.start(RuleNodeActorMessageProcessor.java:64) at org.thingsboard.server.actors.service.ComponentActor.initProcessor(ComponentActor.java:63) at org.thingsboard.server.actors.service.ComponentActor.init(ComponentActor.java:57) at org.thingsboard.server.actors.TbActorMailbox.tryInit(TbActorMailbox.java:65) at org.thingsboard.server.actors.TbActorMailbox.lambda$tryInit$1(TbActorMailbox.java:82) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "updateAttributesOnlyOnValueChange" (class org.thingsboard.rule.engine.telemetry.TbMsgAttributesNodeConfiguration), not marked as ignorable (3 known properties: "scope", "notifyDevice", "sendAttributesUpdatedNotification"]) at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: org.thingsboard.rule.engine.telemetry.TbMsgAttributesNodeConfiguration["updateAttributesOnlyOnValueChange"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1127) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2036) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1700) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1678) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:320) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4650) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2831) at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:3295) at org.thingsboard.rule.engine.api.util.TbNodeUtils.convert(TbNodeUtils.java:46) ... 13 more I noticed that 3.6.1 updated the node about properties. I still had this problem after I reinstalled 3.5.1 edge to the cloud connected to 3.6.1. I had so many edges that I couldn't upgrade to 3.6.1 all at once.

AndriiLandiak commented 7 months ago

Hello, @Kevin-ox.

Thank you for providing the logs. It's true that a configuration change in the TbMsgAttributesNodeConfiguration for the TbMsgAttributesNode in the ThingsBoard release 3.6.0. When connecting a 3.6.1 ThingsBoard instance to a 3.5.1 Edge instance, the rule nodes with the updated configuration were saved to the database. However, the TbMsgAttributesNodeConfiguration in the 3.5.1 Edge version cannot correctly interpret this new configuration property, leading to compatibility issues.

It's important to mention that I faced the same error during the connection 3.6.1 Cloud and 3.5.1 Edge, but the connection was successful and I was able to interact with Edge, and updates were processed to Cloud and vice versa, maybe issues were caused in certain scenarios.

Upgrading Edge to 3.6.1: Could you share the logs from the upgrade process of ThingsBoard Edges from version 3.5.1 to 3.6.1? This will enable us to assist you with the upgrade and problems you were facing because, on my side, upgrading from 3.5.1 to 3.6.1 went successfully for Edge.

ryan-2048 commented 7 months ago

Although the edge of 3.5.1 and the cloud of 3.6.1 were able to connect and interact successfully, all the properties could not be saved to the database because the save properties node onStart error

It is possible to upgrade the edge to 3.6.1, but the edge cannot be upgraded at the same time due to the large number of edges, network, etc

ryan-2048 commented 7 months ago

Hello, @AndriiLandiak Is this issue planned to be fixed?

AndriiLandiak commented 7 months ago

Hello, @Kevin-ox. To fix the issue of connection 3.5.1 Edge to 3.6.1 TB, we would need to implement a new hotfix release 3.5.2 and update it with the TbMsgAttributesNodeConfiguration from the 3.6.1 ThingsBoard release. While this approach may seem inconvenient, it is essential for resolving the compatibility issue.

Understanding the challenge of upgrading many Edges simultaneously, the hotfix still necessitates an upgrade. So I’d rather recommend you upgrade to 3.6.1 Edge. This addresses the specific issue and introduces additional features, such as the capability to create Assets, Dashboards, EntityViews, AssetProfile, DeviceProfile, and TbResource directly on the edge. For more comprehensive information, please refer to the release notes available at: Release Notes.

Worth noting, that we are working on developing the product to ensure backward compatibility with older Edges, and that remains our focus. However, occasionally, incompatible features may arise. In this instance, the TB team underwent a refactoring and enhancement of the user experience for Rule Nodes, impacting the compatibility of versions 3.6.1 Tb and 3.5.1 Edge.

Thank you for your understanding. Should you require assistance with the upgrade or have any inquiries, please feel free to reach out to us.