question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Edgehub not detecting route changes in deployment json

See original GitHub issue

Expected 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

  1. 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"
  1. release to linux IOT Edge

  2. Look at logs. Edgehub has detected change above and shows error. messageprocessor is not connected

  3. 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"
  1. release to IOT Edge 6 Review Logs for Edgehub. The change with the correct messageprocessor4j route is not detected.

  2. 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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
scottmurcommented, Feb 17, 2019

Thanks @mrohera . I have updated Expected Behaviour and Additional Information sections

0reactions
Sdelausnaycommented, Nov 17, 2020

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Azure IoT Edge common errors
Open the deployment.json file that you applied to your IoT Edge device. · Find the edgeHub settings in the edgeAgent desired properties section:....
Read more >
Properties of the agent and hub module twins - Azure IoT ...
Review the specific properties and their values for the edgeAgent and edgeHub module twins.
Read more >
Change 'createOptions' of edgeAgent and edgeHub using ...
just use this command and you are good to go: az iot edge set-modules --device-id $deviceId --hub-name $hubName --content ...
Read more >
IoT Edge module fails to send a message to edgeHub with ...
This issue was noticed in a new device with the latest IoT Edge runtime version 1.3.0. No other changes in deployment or otherwise...
Read more >
Building Azure IoT Edge Module with Message Routing - tsmatz
In this post, we build and deploy custom modules from scratch (without Visual Studio Code) with message routing. If you are new to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found