Edgehub not detecting route changes in deployment json
See original GitHub issueExpected Behavior
Edgehub should detect that a route change in deployment json has occurred and apply it without having to manually restart edgehub service
Current Behavior
Edgehub detects module changes but if a route only change is made then you have to restart the service for change to take place
NAME STATUS DESCRIPTION CONFIG
edgeAgent running Up 20 hours mcr.microsoft.com/azureiotedge-agent:1.0
edgeHub running Up 20 hours mcr.microsoft.com/azureiotedge-hub:1.0
messageprocessor4j running Up 36 seconds aothistoriandevacr.azurecr.io/messageprocessorjava:143
opcpublisher running Up 20 hours mcr.microsoft.com/iotedge/opc-publisher:2.3.2
Steps to Reproduce
- Update deployment Json . By mistake the route is incorrect and was release via azure cli . As shown below you have see that the module is called messageprocessor4j but the route is using messageprocessor5j
"modules": {
"messageprocessor4j": {
"type": "docker",
"settings": {
"image": "aothistoriandevacr.azurecr.io/messageprocessorjava:143",
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.0",
"routes": {
"opcuatomessage": "FROM /messages/modules/opcpublisher/* INTO BrokeredEndpoint(\"/modules/messageprocessor5j/inputs/input1\")",
"filterToIoTHub": "FROM /messages/modules/messageprocessor5j/outputs/output1 INTO $upstream"
-
release to linux IOT Edge
-
Look at logs. Edgehub has detected change above and shows error. messageprocessor is not connected
-
We try to correct the mistake and change the route back to messageprocessor4j in the deploymnet json section below
"modules": {
"messageprocessor4j": {
"type": "docker",
"settings": {
"image": "aothistoriandevacr.azurecr.io/messageprocessorjava:143",
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.0",
"routes": {
"opcuatomessage": "FROM /messages/modules/opcpublisher/* INTO BrokeredEndpoint(\"/modules/messageprocessor4j/inputs/input1\")",
"filterToIoTHub": "FROM /messages/modules/messageprocessor4j/outputs/output1 INTO $upstream"
-
release to IOT Edge 6 Review Logs for Edgehub. The change with the correct messageprocessor4j route is not detected.
-
But if we manually restart the Edgehub then route change is detected and we successfully connect
Context (Environment)
Device (Host) Operating System
Ubuntu 18.04.1 LTS
Architecture
amd64
Container Operating System
Linux Containers
Runtime Versions
iotedged
iotedge 1.0.5
Edge Agent
1.0
Edge Hub
1.0
Docker
Client: Version: 3.0.2 API version: 1.40 Go version: go1.11.1 Git commit: e042b58f Built: Tue Dec 4 20:13:19 2018 OS/Arch: linux/amd64 Experimental: false
Logs
After releasing with correct edge routing we can still see the incorrect route as shown in logs below:
2019-02-13 00:52:18.989 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.RoutingEdgeHub] - Received message from nzs060iotedg01m/opcpublisher
2019-02-13 00:52:22.201 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.ModuleEndpoint] - Sending 1 message(s) to module nzs060iotedg01m/messageprocessor5j.
2019-02-13 00:52:22.201 +00:00 [WRN] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.ModuleEndpoint] - Module nzs060iotedg01m/messageprocessor5j is not connected
After restarting the edgehub then see logs as shown here
2019-02-13 00:53:46.972 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient] - Operation GetTwinAsync succeeded for nzs060iotedg01m/messageprocessor4j
2019-02-13 00:53:46.972 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy] - Getting twin for device nzs060iotedg01m/messageprocessor4j
2019-02-13 00:53:46.972 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.TwinManager] - Successfully got twin for nzs060iotedg01m/messageprocessor4j from cloud at desired version 1 reported version 1
2019-02-13 00:53:46.972 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.TwinManager] - Local twin for nzs060iotedg01m/messageprocessor4j at higher or equal desired version 1 compared to cloud 1 or reported version 1 compared to cloud 1
2019-02-13 00:53:51.319 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Getting next batch for endpoint nzs060iotedg01m/messageprocessor4j/input1 starting from 294676 with batch size 10.
Additional Information
Any module changes in deployment json are detected without manually restarting edgehub Should NOT have to manually restart the edgehub for route changes
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Thanks @mrohera . I have updated Expected Behaviour and Additional Information sections
Hi,
I have just expierenced the same issues in version 1.0.9.5. I have updated the deployment with an additional route and released it with a pipeline. edgeHub didn’t detect the changes and I had to restart edgeHub to make the route between two modules active.
Can this we rechecked?