Azure / iotedgedev

The Azure IoT Edge Dev Tool greatly simplifies your Azure IoT Edge development process. It has everything you need to get started and helps with your day-to-day Edge development.
https://aka.ms/iotedgedev
Other
160 stars 70 forks source link

$edgeHub startup RouteCompilationException #512

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hey All,

I'm dealing with an error while trying to develop an IoT Edge module.

Steps to Reproduce:

  1. mkdir c:\temp\iotedge
  2. docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v c:/temp/iotedge:/home/iotedge mcr.microsoft.com/iotedge/iotedgedev
  3. Create new IoT project in Visual Studio with multiple modules
  4. Change routing
  5. Deploy the module using Visual Studio

Error received: helper.log

Deployment.debug.template.json deployment.debug.template.txt

Any help fixing this error is much appreciated. If you need any additional information let me know.

With regards, Arno Zeelmaekers

yophilav commented 2 years ago

Heyo @arnozeelmaekers !

Hope you're doign well so far. Thank you for the question! From the helper.log lines:

<6> 2021-11-19 08:23:57.252 +00:00 [INF] - MessageAckTimeoutSecs=30
Unhandled exception. System.AggregateException: One or more errors occurred. (Exception of type 'Microsoft.Azure.Devices.Routing.Core.Query.RouteCompilationException' was thrown.)
 ---> Compilation errors:
StartLine[1], StartColumn[160], EndLine[1], EndColumn[161], Severity[Error], Message: Syntax error.

I suspect there maybe an invalid json format somewhere in the routes section. Sure enough, in deployment.debug.template.txt

          "IdentityTranslationModuleToBoilerPlate": {
            "route": "FROM /messages/modules/IdentityTranslationModule/outputs/boilerplate/* INTO BrokeredEndpoint(\"/modules/ProtocolTranslationModuleBoilerplate/inputs/boilerplate\"",
            "priority": 0,
            "timeToLiveSecs": 1800
          },

there is a missing ) for the BrokeredEndpoint. Note:

"route": "FROM /messages/modules/IdentityTranslationModule/outputs/boilerplate/* INTO BrokeredEndpoint(\"/modules/ProtocolTranslationModuleBoilerplate/inputs/boilerplate\")",

Thanks, Bear

ghost commented 2 years ago

Hey @yophilav

God I feel so dumb now. Thanks so much!

With regards, Arno Zeelmaekers

yophilav commented 2 years ago

It's all good! Have a nice day :)