Code Monkey home page Code Monkey logo

iotedge's Introduction

IoT Edge

Build Status

Welcome to the home of IoT Edge.

IoT Edge moves cloud analytics and custom business logic to devices so that your organization can focus on business insights instead of data management. Enable your solution to truly scale by configuring your IoT software, deploying it to devices via standard containers, and monitoring it all from the cloud. This repository consists of three main projects: the Edge Agent, the Edge Hub, and the IoT Edge Security Daemon.

Documentation

Documentation for the Azure IoT Edge product can be found at https://docs.microsoft.com/azure/iot-edge.

Contributing

If you would like to build or change the IoT Edge source code, please follow the devguide.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

iotedge's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iotedge's Issues

Request not authorized

Expected Behavior

Edge module should up and run

Current Behavior

Edge module will be rejected when calling API to iotedged due to PID mismatch.

Right now, iotedged get pid from docker Pid (e.g. docker inspect --format '{{.State.Pid}}' moduleName). https://github.com/Azure/iotedge/blob/master/edgelet/edgelet-docker/src/module.rs#L104 which might not be the process makes the request to daemon.

Steps to Reproduce

  1. Get an edge module
  2. Use different process to start connection (e.g. npm start)
  3. Get rejected

Context (Environment)

Device (Host) Operating System

Debian 8

Architecture

arm32

Container Operating System

Linux containers

Runtime Versions

iotedged

iotedged --version
<6>2018-07-10T05:59:37Z [INFO] - Starting Azure IoT Edge Security Daemon
<6>2018-07-10T05:59:37Z [INFO] - Version - 1.0.0 (52ef77db24126bf473265fc09c53d35290a2dd6b)
iotedged 0.1.0

Edge Agent

iotedge --version
iotedge 1.0.0 (52ef77db24126bf473265fc09c53d35290a2dd6b)

Edge Hub

Docker

Client:
 Version:      18.06.0-dev
 API version:  1.37
 Go version:   go1.10.2
 Git commit:   daf021fe
 Built:        Wed Jun 27 00:53:52 2018
 OS/Arch:      linux/arm
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      dev
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.2
  Git commit:   9aac187
  Built:        Tue Jun 26 23:27:27 2018
  OS/Arch:      linux/arm
  Experimental: false

Logs

Jul 10 12:56:39 Moxa-UC-8112-ME-T-DEMOKIT iotedged[32460]: 2018-07-10T04:56:39Z [INFO] - Request not authorized - expected caller pid: 3599, actual caller pid: 3741
Jul 10 12:56:39 Moxa-UC-8112-ME-T-DEMOKIT iotedged[32460]: 2018-07-10T04:56:39Z [INFO] - Request not authorized - expected caller pid: 3599, actual caller pid: 3741
Jul 10 12:59:32 Moxa-UC-8112-ME-T-DEMOKIT iotedged[32460]: 2018-07-10T04:59:32Z [INFO] - Request not authorized - expected caller pid: 5216, actual caller pid: 5286
Jul 10 12:59:32 Moxa-UC-8112-ME-T-DEMOKIT iotedged[32460]: 2018-07-10T04:59:32Z [INFO] - Request not authorized - expected caller pid: 5216, actual caller pid: 5286
Jul 10 13:00:30 Moxa-UC-8112-ME-T-DEMOKIT iotedged[32460]: 2018-07-10T05:00:30Z [INFO] - Request not authorized - expected caller pid: 5885, actual caller pid: 6054

Additional Information

linking error for release binary

The libiothsm.so is not linked correctly for release binary:

โžœ release git:(master) โœ— >ldd iotedged
linux-vdso.so.1 => (0x00007fff0cba3000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fe5bb946000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fe5bb502000)
libiothsm.so => not found
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe5bb2fe000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe5bb0f6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe5baed9000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe5bacc3000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe5ba8f9000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe5bc845000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe5ba5f0000)

Procedure to reproduce:
$ make

The library exists in the build:
./target/release/build/hsm-sys-2f329a0dc13bf3c8/out/lib/libiothsm.so
./target/release/build/hsm-sys-2f329a0dc13bf3c8/out/build/libiothsm.so

IoTEdge commands get hangs on armv7 based artik target

Hi ,
I have followed -
https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux-arm
to setup iotedge on ARM32 (armv7-l) based ARTIK board. I was able to installed moby-engine and moby-cli as mentioned.

Content: How to install Azure IoT Edge on Linux
Content Source: https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux-arm
Service: iotedge
OS - Ubuntu 16.04
Architecture - arm32 (armv7-l)
Toolchain - arm-linux-gnueabihf

[root@artik ~]# sudo systemctl status iotedge
โ— iotedge.service - Azure IoT Edge daemon
Loaded: loaded (/lib/systemd/system/iotedge.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-07-19 06:13:00 UTC; 209ms ago
Docs: man:iotedged(8)
Main PID: 3484 (iotedged)
Tasks: 6
Memory: 1.3M
CPU: 200ms
CGroup: /system.slice/iotedge.service
โ””โ”€3484 /usr/bin/iotedged -c /etc/iotedge/config.yaml

Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Version - 1.0.0 (52ef77d)
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Using config file: /etc/iotedge/config.yaml
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Using runtime network id azure-iot-edge
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Initializing the module runtime...
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Finished initializing the module runtime.
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Configuring /var/lib/iotedge as the home directory.
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Configuring certificates...
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Transparent gateway certificates not found, operating in quick start mode...
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Finished configuring certificates.
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Initializing hsm...

[root@artik ~]# sudo journalctl -u iotedge -f
-- Logs begin at Thu 2018-07-19 05:47:18 UTC. --
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Version - 1.0.0 (52ef77d)
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Using config file: /etc/iotedge/config.yaml
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Using runtime network id azure-iot-edge
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Initializing the module runtime...
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Finished initializing the module runtime.
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Configuring /var/lib/iotedge as the home directory.
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Configuring certificates...
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Transparent gateway certificates not found, operating in quick start mode...
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Finished configuring certificates.
Jul 19 06:13:00 artik iotedged[3484]: 2018-07-19T06:13:00Z [INFO] - Initializing hsm...
Jul 19 06:13:18 artik iotedged[3484]: 2018-07-19T06:13:18Z [ERR!] - An hsm error occurred.
Jul 19 06:13:18 artik systemd[1]: iotedge.service: Failed with result 'exit-code'.

Jul 19 06:13:18 artik iotedged[3498]: 2018-07-19T06:13:18Z [INFO] - Starting Azure IoT Edge Security Daemon
Jul 19 06:13:19 artik iotedged[3498]: 2018-07-19T06:13:18Z [INFO] - Version - 1.0.0 (52ef77d)
Jul 19 06:13:19 artik iotedged[3498]: 2018-07-19T06:13:18Z [INFO] - Using config file: /etc/iotedge/config.yaml

[root@artik ~]# iotedge list
gets hang.

Please suggest.

Internal Server Error on Management Api (Windows 10 Enterprise)

Expected Behavior

iotedge service should start and start its modules

Current Behavior

iotedge does not start modules

Context (Environment)

Device (Host) Operating System

Windows 10 1803 Enterprise

Architecture

amd64

Container Operating System

Windows Containers

Runtime Versions

iotedged

PS C:\Windows\system32> iotedge version
iotedge 1.0.0 (52ef77db24126bf473265fc09c53d35290a2dd6b)

Edge Agent

PS C:\Windows\system32> docker images
REPOSITORY                             TAG                 IMAGE ID            CREATED             SIZE
mcr.microsoft.com/azureiotedge-agent   1.0                 101f624f0ba3        2 weeks ago         441MB

Edge Hub

not started

Docker

PS C:\Windows\system32> docker version
Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:12:48 2018
 OS/Arch:      windows/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.24)
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Thu Apr 26 07:21:42 2018
  OS/Arch:      windows/amd64
  Experimental: false

Logs

7/12/2018 1:52:47 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("container e0cfd5c86c7e231116192a898a6952df9920c11591958d878edda9937fbc001c...
7/12/2018 1:52:47 PM warn: edgelet_core::watchdog -- Error in watchdog when checking for edge runtime status:
7/12/2018 1:53:47 PM info: edgelet_core::watchdog -- Checking edge runtime status
7/12/2018 1:53:47 PM info: edgelet_core::watchdog -- Edge runtime status is stopped, starting module now...
7/12/2018 1:53:47 PM warn: edgelet_core::watchdog -- Error in watchdog when checking for edge runtime status:
7/12/2018 1:53:47 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("container e0cfd5c86c7e231116192a898a6952df9920c11591958d878edda9937fbc001c...
7/12/2018 1:53:47 PM warn: edgelet_utils::logging -- A module runtime error occurred.
7/12/2018 1:53:47 PM warn: edgelet_utils::logging --    caused by: Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("container e0cfd5c86c7e231116192a898a6952df9920c11591958d878edd...
7/12/2018 1:54:47 PM info: edgelet_core::watchdog -- Checking edge runtime status
7/12/2018 1:54:47 PM info: edgelet_core::watchdog -- Edge runtime status is stopped, starting module now...
7/12/2018 1:54:47 PM warn: edgelet_utils::logging -- Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("container e0cfd5c86c7e231116192a898a6952df9920c11591958d878edda9937fbc001c...
7/12/2018 1:54:47 PM warn: edgelet_core::watchdog -- Error in watchdog when checking for edge runtime status:
7/12/2018 1:54:47 PM warn: edgelet_utils::logging --    caused by: Container runtime error - ApiError(ApiError { code: InternalServerError, content: Some(Object({"message": String("container e0cfd5c86c7e231116192a898a6952df9920c11591958d878edd...

Additional Information

Was running and visible on the azure portal until I deployed a module.

Idiomatic way to encrypt data from an Azure IoT Edge Module?

I asked this question on stackoverflow under the azure-iot-edge tag but I'm not really getting the kinds of responses that I expected so I'm going to try to ask here. If questions aren't appropriate here then please point me to the right forum.

I'm trying to figure out the idiomatic way to encrypt data from within an IoT Edge module, ideally using the TPM. We currently use the TPM via the daemon for DPS authentication and I'd like to use it to encrypt some data at rest too. Is there some kind of certificate that can be injected in by the runtime from the TPM or could we hand off data to the runtime for encryption?

Stack overflow copy of question: https://stackoverflow.com/questions/51470923/idiomatic-way-to-encrypt-data-from-an-azure-iot-edge-module

Updating modules

Hi there,

When I'm trying to update a module by using "Create deployment to single device" in VSC, it states Deployment succeeded. However on my device the module seems to keep running, and I don't see any changes in behavior until I completely reset IoT Edge.

What is required to force the module to re-run with the new deployed code? Or am I thinking about this whole process the wrong way?

Desired property updates not seen by device app

I deployed .NET and python modules on two edge hub devices. At first, the modules worked as expected -- when I made updates to desired properties on the azure portal, they would be seen by the edge apps.

However, as I was developing and debugging some functionality, this stopped working. The device apps always "see" an older version of the module twin.

When I created new versions of these modules (by simply copying the code over), I get normal functionality again. This was observed for both .NET and python modules.

Details:
Ubuntu 16.04
amd64
Linux containers

Example:
See an example below. The desired TemperatureThreshold was set to 28 at 15:23 GMT. However, even at 15:42 GMT, the device still reads the older value of 29 (I have verified that this is not just due to erroneous updates of reported properties. The edge app is in fact reading an older version of the module twin).

"properties": {
"desired": {
"TemperatureThreshold": 28,
"$metadata": {
"$lastUpdated": "2018-07-24T15:23:23.7053839Z",
"$lastUpdatedVersion": 4,
"TemperatureThreshold": {
"$lastUpdated": "2018-07-24T15:23:23.7053839Z",
"$lastUpdatedVersion": 4
},
},
"$version": 4
},
"reported": {
"TemperatureThreshold": 29,
"DateTimeLastAppLaunch": "2018-07-24T15:42:08.9362554Z",
"$metadata": {
"$lastUpdated": "2018-07-24T15:42:08.9873934Z",
"TemperatureThreshold": {
"$lastUpdated": "2018-07-24T15:42:08.9873934Z"
},
},
"$version": 7
}

Unable to run a customEdgeModule and receiving back-off status with exit code 145

I'm trying to run a custom Edge Module by following https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module, when deployed on edge i get "backoff" status with 145 error code

I suspect the issue could be because of the connection attempt at INIT, the OpenAsync() method gets timedout.

ModuleClient ioTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);
await ioTHubModuleClient.OpenAsync();

Expected Behavior

Able to filter telemetry message that comes from TempSimulator as shown in https://docs.microsoft.com/en-us/azure/iot-edge/quickstart-linux#deploy-a-module, the simulation model works as per the article.

Current Behavior

Able to develop and deploy Filter Module as described here https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module, however i get module status as "backoff" with an error code 145

Steps to Reproduce

  1. Setup Edge as described here https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux

  2. Simulate data as described here https://docs.microsoft.com/en-us/azure/iot-edge/quickstart-linux#deploy-a-module

  3. Build and deploy custom module as described here https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module

Context (Environment)

IoTEdge Simulation on DSVM (Ubuntu)

Device (Host) Operating System

Linux version 4.15.0-1018-azure (buildd@lgw01-amd64-021) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu116.04.10)) #1816.04.1-Ubuntu SMP Thu Jul 19 13:13:57 UTC 2018

Architecture

amd64

Container Operating System

Linux containers

Runtime Versions

iotedge 1.0.0

iotedged

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Agent

mcr.microsoft.com/azureiotedge-hub:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Docker version 18.06.0-dev, build daf021fe

Logs

refer the logs attached here #69

Installation of Moby fails on Raspberry Pi Zero W

I just received my brand new Raspberry Pi Zero W:
https://www.raspberrypi.org/products/raspberry-pi-zero-w/

To start with, I installed NOOBS on it:
https://www.raspberrypi.org/downloads/noobs/

My goal is to connect it to my Azure IoT Hub, so I'm trying to install Azure IoT Edge on it using this tutorial:
https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux-arm

Unfortunately I get an error when I run the first command in the tutorial:

# Download and install the moby-engine
curl -L https://aka.ms/moby-engine-armhf-latest -o moby_engine.deb && sudo dpkg -i ./moby_engine.deb

The following error occurs:

pi@raspberrypi:~ $ sudo curl -L https://aka.ms/moby-engine-armhf-latest -o moby_engine.deb && sudo dpkg -i ./moby_engine.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   193  100   193    0     0    644      0 --:--:-- --:--:-- --:--:--   647
100 15.4M  100 15.4M    0     0  1157k      0  0:00:13  0:00:13 --:--:-- 1314k
(Reading database ... 115462 files and directories currently installed.)
Preparing to unpack ./moby_engine.deb ...
Unpacking moby-engine (1.0.0-1) over (1.0.0-1) ...
Setting up moby-engine (1.0.0-1) ...
Job for docker.service failed because a fatal signal was delivered causing the control process to dump core.
See "systemctl status docker.service" and "journalctl -xe" for details.
docker.service couldn't start.

The command "systemctl status docker.service" gives me the following:

pi@raspberrypi:~ $ systemctl status docker.service
 docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: core-dump) since Sun 2018-07-08 10:11:02 CEST; 4s ago
     Docs: https://docs.docker.com
  Process: 1734 ExecStart=/usr/bin/dockerd -H fd:// (code=dumped, signal=SEGV)
 Main PID: 1734 (code=dumped, signal=SEGV)
      CPU: 278ms

Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Main process exited, code=dumped, status=11/SEGV
Jul 08 10:11:02 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Unit entered failed state.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Failed with result 'core-dump'.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 08 10:11:02 raspberrypi systemd[1]: Stopped Docker Application Container Engine.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Start request repeated too quickly.
Jul 08 10:11:02 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Unit entered failed state.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Failed with result 'core-dump'.

The command "journalctl -xe" gives me the following:

-- Unit docker.socket has begun starting up.
Jul 08 10:11:02 raspberrypi systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit docker.socket has finished starting up.
-- 
-- The start-up result is done.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Start request repeated too quickly.
Jul 08 10:11:02 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.socket: Unit entered failed state.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Unit entered failed state.
Jul 08 10:11:02 raspberrypi systemd[1]: docker.service: Failed with result 'core-dump'.

The command "journalctl -u docker.service" gives me the following:

pi@raspberrypi:~ $ journalctl -u docker.service
-- Logs begin at Thu 2016-11-03 18:16:44 CET, end at Sun 2018-07-08 11:10:41 CEST. --
Jul 08 11:06:22 raspberrypi systemd[1]: Starting Docker Application Container Engine...
Jul 08 11:06:25 raspberrypi systemd[1]: docker.service: Main process exited, code=dumped, status=11/SEGV
Jul 08 11:06:25 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
Jul 08 11:06:25 raspberrypi systemd[1]: docker.service: Unit entered failed state.
Jul 08 11:06:25 raspberrypi systemd[1]: docker.service: Failed with result 'core-dump'.
Jul 08 11:06:25 raspberrypi systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 08 11:06:25 raspberrypi systemd[1]: Stopped Docker Application Container Engine.
Jul 08 11:06:25 raspberrypi systemd[1]: Starting Docker Application Container Engine...
Jul 08 11:06:29 raspberrypi systemd[1]: docker.service: Main process exited, code=dumped, status=11/SEGV
Jul 08 11:06:29 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
Jul 08 11:06:29 raspberrypi systemd[1]: docker.service: Unit entered failed state.
Jul 08 11:06:29 raspberrypi systemd[1]: docker.service: Failed with result 'core-dump'.
Jul 08 11:06:29 raspberrypi systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 08 11:06:29 raspberrypi systemd[1]: Stopped Docker Application Container Engine.
Jul 08 11:06:29 raspberrypi systemd[1]: Starting Docker Application Container Engine...
Jul 08 11:06:33 raspberrypi systemd[1]: docker.service: Main process exited, code=dumped, status=11/SEGV
Jul 08 11:06:33 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
Jul 08 11:06:33 raspberrypi systemd[1]: docker.service: Unit entered failed state.
Jul 08 11:06:33 raspberrypi systemd[1]: docker.service: Failed with result 'core-dump'.
Jul 08 11:06:34 raspberrypi systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 08 11:06:34 raspberrypi systemd[1]: Stopped Docker Application Container Engine.
Jul 08 11:06:34 raspberrypi systemd[1]: docker.service: Start request repeated too quickly.
Jul 08 11:06:34 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
Jul 08 11:06:34 raspberrypi systemd[1]: docker.service: Unit entered failed state.
Jul 08 11:06:34 raspberrypi systemd[1]: docker.service: Failed with result 'core-dump'.

I would really appreciate some help, thank you!

iotedge configures listening sockets incorrectly and exchanges wrong messages

This issue may be related to #14

Iotedge listens randomly in work and management sockets. It seems that the configuration is correct but messages between agent and iotedge daemon are exchanged in the wrong sockets. Example, /systeminfo?api-version=2018-06-28 should go to management socket and not to work socket.

I solved this using unix sockets configuration (it sets wrong permissions) and running edgeHub and all container modules as root.

The following configuration worked every time we have configured a new device and some others but failed eventually.

--systemd and os version --
systemd 219
rhel7.5

-- iotedge configuration --
connect:
management_uri: "unix:///var/run/iotedge/mgmt.sock"
workload_uri: "unix:///var/run/iotedge/workload.sock"
listen:
management_uri: "fd://mgmt.socket"
workload_uri: "fd://workload.socket"

-- iotedge.service --
[Service]
Environment="LISTEN_FDNAMES=workload.socket:mgmt.socket"
ExecStart=/usr/bin/iotedged -c /etc/iotedge/config.yaml
-- iotedge.socket --
[Socket]
ListenStream=/var/run/iotedge/mgmt.sock
-- iotedge.mgmt.socket --
[Socket]
ListenStream=/var/run/iotedge/workload.sock

-- Iotedge logs --
jul 19 06:48:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:27Z [INFO] - Starting management API...
jul 19 06:48:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:27Z [INFO] - Listening on fd://mgmt.socket/ with 1 thread for management API.
jul 19 06:48:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:27Z [INFO] - Starting workload API...
jul 19 06:48:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:27Z [INFO] - Listening on fd://workload.socket/ with 1 thread for workload API.
jul 19 06:48:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:27Z [INFO] - Starting watchdog with 60 second frequency...
jul 19 06:48:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:27Z [INFO] - Checking edge runtime status
jul 19 06:48:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:27Z [INFO] - Edge runtime status is failed, starting module now...
jul 19 06:48:32 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:48:32Z [INFO] - [work] - - - [2018-07-19 06:48:32.149104654 UTC] "GET /systeminfo?api-version=2018-06-28 HTTP/1.1" 404 Not Found - "-" "-" pid(2
jul 19 06:49:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:49:27Z [INFO] - Checking edge runtime status
jul 19 06:49:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:49:27Z [INFO] - Edge runtime status is failed, starting module now...
jul 19 06:49:29 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:49:29Z [INFO] - [work] - - - [2018-07-19 06:49:29.516516891 UTC] "GET /systeminfo?api-version=2018-06-28 HTTP/1.1" 404 Not Found - "-" "-" pid(2
jul 19 06:50:27 dev-logs-fg-01 iotedged[2300]: 2018-07-19T06:50:27Z [INFO] - Checking edge runtime status

-- agent docker configuration --
"Env": [
...
"Mode=iotedged",
"IOTEDGE_WORKLOADURI=unix:///var/run/iotedge/workload.sock",
"IOTEDGE_APIVERSION=2018-06-28",
"IOTEDGE_MODULEID=$edgeAgent",
"IOTEDGE_AUTHSCHEME=sasToken",
"IOTEDGE_MANAGEMENTURI=unix:///var/run/iotedge/mgmt.sock",
"ASPNETCORE_URLS=http://+:80",
"DOTNET_RUNNING_IN_CONTAINER=true",
"DOTNET_VERSION=2.1.0"
]
"Mounts": [
{
"Type": "bind",
"Source": "/var/run/iotedge/workload.sock",
"Destination": "/var/run/iotedge/workload.sock",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/var/run/iotedge/mgmt.sock",
"Destination": "/var/run/iotedge/mgmt.sock",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}

-- agent logs --
I dont have them anymore but they show the "404" error when getting system info.

'Entering unreachable state' - all edgehub connections timeout after

I have been testing the new GA release. This is on Windows 10 and Linux containers.

The module I had deployed stayed up for about 5 days. This module is a simple polling module originally based on the sample temperature module and since upgraded to be compatible with the GA release.

After 5 days my module started throwing connection time out errors.

Here are the docker logs for my custom module when it stopped working, it sends a reading every 5 seconds:

	07/05/2018 01:10:13 - sending reading
	07/05/2018 01:10:18 - sending reading
	07/05/2018 01:10:23 - sending reading
[ERROR] Unexpected Exception Operation timeout expired.
	System.TimeoutException: Operation timeout expired.
   at Microsoft.Azure.Devices.Client.InternalClient.<>c.<ApplyTimeout>b__62_2(Task t)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MockModbusModuleV2.Program.<SendSimulationData>d__18.MoveNext() in /app/Program.cs:line 213
	07/05/2018 01:14:28 - sending reading
[ERROR] Unexpected Exception Operation timeout expired.
	System.TimeoutException: Operation timeout expired.
   at Microsoft.Azure.Devices.Client.InternalClient.<>c.<ApplyTimeout>b__62_2(Task t)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MockModbusModuleV2.Program.<SendSimulationData>d__18.MoveNext() in /app/Program.cs:line 213

This is then repeated indefinitely. The line of code it is hanging on is:

await moduleClient.SendEventAsync("modbusOutput", message);

Here are the logs from the edgeHub leading up to the issue. The EdgeHubConnectionException entries at the start occurred throughout the whole 5 day period and seem to be associated with the Token refresh but the module was working throughout that time. The 'Entering unreachable state' final log entry had not occurred before and this is when the module stopping working:

2018-07-05 00:13:09.994 +00:00 [INF] - Existing token not found for officepc1/ipswicha-mockmodbus. Getting new token from the client...
2018-07-05 00:13:09.994 +00:00 [WRN] - Closing connection for device: officepc1/ipswicha-mockmodbus, Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/ipswicha-mockmodbus., 
2018-07-05 00:13:09.994 +00:00 [INF] - Disposing MessagingServiceClient for device Id officepc1/ipswicha-mockmodbus because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/ipswicha-mockmodbus.
2018-07-05 00:13:09.995 +00:00 [INF] - Closing device proxy for device Id officepc1/ipswicha-mockmodbus
2018-07-05 00:13:09.995 +00:00 [INF] - Device connection removed for device officepc1/ipswicha-mockmodbus
2018-07-05 00:13:11.013 +00:00 [INF] - Obtained new token for client officepc1/ipswicha-mockmodbus that expires in 00:59:59.9864079
2018-07-05 00:13:11.013 +00:00 [INF] - New cloud connection created for device officepc1/ipswicha-mockmodbus
2018-07-05 00:13:11.013 +00:00 [INF] - Successfully generated identity for clientId officepc1/ipswicha-mockmodbus and username desktop-ce8aaih/officepc1/ipswicha-mockmodbus/?api-version=2018-06-30&DeviceClientType=Microsoft.Azure.Devices.Client%2F1.17.0%20%28.NET%20Core%204.6.0.0%3B%20Linux%204.9.87-linuxkit-aufs%20%231%20SMP%20Wed%20Mar%2014%2015%3A12%3A16%20UTC%202018%3B%20X64%29
2018-07-05 00:13:11.013 +00:00 [INF] - ClientAuthenticated, officepc1/ipswicha-mockmodbus, 7e30919b
2018-07-05 00:13:11.014 +00:00 [INF] - New device connection for device officepc1/ipswicha-mockmodbus
2018-07-05 00:13:11.014 +00:00 [INF] - Bind device proxy for device officepc1/ipswicha-mockmodbus
2018-07-05 00:13:11.014 +00:00 [INF] - Binding message channel for device Id officepc1/ipswicha-mockmodbus
2018-07-05 00:13:11.014 +00:00 [INF] - Set subscriptions from session state for officepc1/ipswicha-mockmodbus
2018-07-05 00:13:32.005 +00:00 [INF] - Existing token not found for officepc1/plymouth-mockmodbus. Getting new token from the client...
2018-07-05 00:13:32.005 +00:00 [WRN] - Closing connection for device: officepc1/plymouth-mockmodbus, Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/plymouth-mockmodbus., 
2018-07-05 00:13:32.005 +00:00 [INF] - Disposing MessagingServiceClient for device Id officepc1/plymouth-mockmodbus because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/plymouth-mockmodbus.
2018-07-05 00:13:32.006 +00:00 [INF] - Closing device proxy for device Id officepc1/plymouth-mockmodbus
2018-07-05 00:13:32.006 +00:00 [INF] - Device connection removed for device officepc1/plymouth-mockmodbus
2018-07-05 00:13:32.855 +00:00 [INF] - Obtained new token for client officepc1/plymouth-mockmodbus that expires in 01:00:00.1448300
2018-07-05 00:13:32.855 +00:00 [INF] - New cloud connection created for device officepc1/plymouth-mockmodbus
2018-07-05 00:13:32.855 +00:00 [INF] - Successfully generated identity for clientId officepc1/plymouth-mockmodbus and username desktop-ce8aaih/officepc1/plymouth-mockmodbus/?api-version=2018-06-30&DeviceClientType=Microsoft.Azure.Devices.Client%2F1.17.0%20%28.NET%20Core%204.6.0.0%3B%20Linux%204.9.87-linuxkit-aufs%20%231%20SMP%20Wed%20Mar%2014%2015%3A12%3A16%20UTC%202018%3B%20X64%29
2018-07-05 00:13:32.855 +00:00 [INF] - ClientAuthenticated, officepc1/plymouth-mockmodbus, 35b842f5
2018-07-05 00:13:32.855 +00:00 [INF] - New device connection for device officepc1/plymouth-mockmodbus
2018-07-05 00:13:32.856 +00:00 [INF] - Bind device proxy for device officepc1/plymouth-mockmodbus
2018-07-05 00:13:32.856 +00:00 [INF] - Binding message channel for device Id officepc1/plymouth-mockmodbus
2018-07-05 00:13:32.857 +00:00 [INF] - Set subscriptions from session state for officepc1/plymouth-mockmodbus
2018-07-05 00:26:13.381 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/crumlin-mockmodbus/input
2018-07-05 00:26:13.381 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/crumlin-mockmodbus/input and 0 messages from message store.
2018-07-05 00:26:43.385 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/ipswicha-mockmodbus/input
2018-07-05 00:26:43.385 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/ipswicha-mockmodbus/input and 0 messages from message store.
2018-07-05 00:27:13.390 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/stowmarketa-mockmodbus/input
2018-07-05 00:27:13.390 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/stowmarketa-mockmodbus/input and 0 messages from message store.
2018-07-05 00:27:43.391 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
2018-07-05 00:27:43.737 +00:00 [INF] - Cleaned up 1970 messages from queue for endpoint iothub and 1970 messages from message store.
2018-07-05 00:28:13.726 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/plymouth-mockmodbus/input
2018-07-05 00:28:13.726 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/plymouth-mockmodbus/input and 0 messages from message store.
2018-07-05 00:28:43.798 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/ipswichb-mockmodbus/input
2018-07-05 00:28:43.798 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/ipswichb-mockmodbus/input and 0 messages from message store.
2018-07-05 00:59:13.806 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/crumlin-mockmodbus/input
2018-07-05 00:59:13.806 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/crumlin-mockmodbus/input and 0 messages from message store.
2018-07-05 00:59:43.813 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/ipswicha-mockmodbus/input
2018-07-05 00:59:43.813 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/ipswicha-mockmodbus/input and 0 messages from message store.
2018-07-05 01:00:13.821 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/stowmarketa-mockmodbus/input
2018-07-05 01:00:13.822 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/stowmarketa-mockmodbus/input and 0 messages from message store.
2018-07-05 01:00:43.820 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
2018-07-05 01:00:44.156 +00:00 [INF] - Cleaned up 1975 messages from queue for endpoint iothub and 1975 messages from message store.
2018-07-05 01:01:14.164 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/plymouth-mockmodbus/input
2018-07-05 01:01:14.164 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/plymouth-mockmodbus/input and 0 messages from message store.
2018-07-05 01:01:44.171 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint officepc1/ipswichb-mockmodbus/input
2018-07-05 01:01:44.171 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint officepc1/ipswichb-mockmodbus/input and 0 messages from message store.
2018-07-05 01:10:21.993 +00:00 [INF] - Existing token not found for officepc1/ipswichb-mockmodbus. Getting new token from the client...
2018-07-05 01:10:21.993 +00:00 [WRN] - Closing connection for device: officepc1/ipswichb-mockmodbus, Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/ipswichb-mockmodbus., 
2018-07-05 01:10:21.993 +00:00 [INF] - Disposing MessagingServiceClient for device Id officepc1/ipswichb-mockmodbus because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/ipswichb-mockmodbus.
2018-07-05 01:10:21.994 +00:00 [INF] - Closing device proxy for device Id officepc1/ipswichb-mockmodbus
2018-07-05 01:10:21.995 +00:00 [INF] - Device connection removed for device officepc1/ipswichb-mockmodbus
2018-07-05 01:10:42.002 +00:00 [INF] - Existing token not found for officepc1/crumlin-mockmodbus. Getting new token from the client...
2018-07-05 01:10:42.002 +00:00 [WRN] - Closing connection for device: officepc1/crumlin-mockmodbus, Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/crumlin-mockmodbus., 
2018-07-05 01:10:42.003 +00:00 [INF] - Disposing MessagingServiceClient for device Id officepc1/crumlin-mockmodbus because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/crumlin-mockmodbus.
2018-07-05 01:10:42.003 +00:00 [INF] - Closing device proxy for device Id officepc1/crumlin-mockmodbus
2018-07-05 01:10:42.003 +00:00 [INF] - Device connection removed for device officepc1/crumlin-mockmodbus
2018-07-05 01:10:47.004 +00:00 [INF] - Existing token not found for officepc1/stowmarketa-mockmodbus. Getting new token from the client...
2018-07-05 01:10:47.005 +00:00 [WRN] - Closing connection for device: officepc1/stowmarketa-mockmodbus, Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/stowmarketa-mockmodbus., 
2018-07-05 01:10:47.005 +00:00 [INF] - Disposing MessagingServiceClient for device Id officepc1/stowmarketa-mockmodbus because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/stowmarketa-mockmodbus.
2018-07-05 01:10:47.006 +00:00 [INF] - Closing device proxy for device Id officepc1/stowmarketa-mockmodbus
2018-07-05 01:10:47.006 +00:00 [INF] - Device connection removed for device officepc1/stowmarketa-mockmodbus
2018-07-05 01:11:11.000 +00:00 [INF] - Existing token not found for officepc1/ipswicha-mockmodbus. Getting new token from the client...
2018-07-05 01:11:11.000 +00:00 [WRN] - Closing connection for device: officepc1/ipswicha-mockmodbus, Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/ipswicha-mockmodbus., 
2018-07-05 01:11:11.001 +00:00 [INF] - Disposing MessagingServiceClient for device Id officepc1/ipswicha-mockmodbus because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/ipswicha-mockmodbus.
2018-07-05 01:11:11.001 +00:00 [INF] - Closing device proxy for device Id officepc1/ipswicha-mockmodbus
2018-07-05 01:11:11.001 +00:00 [INF] - Device connection removed for device officepc1/ipswicha-mockmodbus
2018-07-05 01:11:32.992 +00:00 [INF] - Existing token not found for officepc1/plymouth-mockmodbus. Getting new token from the client...
2018-07-05 01:11:32.992 +00:00 [WRN] - Closing connection for device: officepc1/plymouth-mockmodbus, Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/plymouth-mockmodbus., 
2018-07-05 01:11:32.992 +00:00 [INF] - Disposing MessagingServiceClient for device Id officepc1/plymouth-mockmodbus because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.EdgeHubConnectionException: Connection closed for device officepc1/plymouth-mockmodbus.
2018-07-05 01:11:32.992 +00:00 [INF] - Closing device proxy for device Id officepc1/plymouth-mockmodbus
2018-07-05 01:11:32.993 +00:00 [INF] - Device connection removed for device officepc1/plymouth-mockmodbus
2018-07-05 01:22:33.342 +00:00 [INF] - Exiting connected state
2018-07-05 01:22:33.342 +00:00 [INF] - Entering unreachable state
2018-07-05 01:23:33.354 +00:00 [INF] - Entering disconnected state

There are also various errors in the edgeAgent around this time:

2018-07-04 23:48:38.300 +00:00 [INF] - Starting compaction of stores
2018-07-04 23:48:38.300 +00:00 [INF] - Starting compaction of store deploymentConfig
2018-07-04 23:48:38.301 +00:00 [INF] - Starting compaction of store default
2018-07-04 23:48:38.301 +00:00 [INF] - Starting compaction of store moduleState
2018-07-05 00:20:45.014 +00:00 [ERR] - Error backing up edge agent config to backup.json
System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ---> System.Net.Sockets.SocketException: Operation canceled
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.FillAsync()
   at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Microsoft.Azure.Devices.Edge.Util.Edged.GeneratedCode.HttpWorkloadClient.EncryptAsync(String api_version, String name, String genid, EncryptRequest payload, CancellationToken cancellationToken) in /opt/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/edged/generatedCode/HttpWorkloadClient.cs:line 218
   at Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient.Execute[T](Func`1 func, String operation)
   at Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient.EncryptAsync(String initializationVector, String plainText) in /opt/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/edged/WorkloadClient.cs:line 57
   at Microsoft.Azure.Devices.Edge.Agent.Core.ConfigSources.FileBackupConfigSource.BackupDeploymentConfig(DeploymentConfigInfo deploymentConfigInfo) in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/configsources/FileBackupConfigSource.cs:line 68
2018-07-05 00:22:30.084 +00:00 [ERR] - Error backing up edge agent config to backup.json
System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ---> System.Net.Sockets.SocketException: Operation canceled
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.FillAsync()
   at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Microsoft.Azure.Devices.Edge.Util.Edged.GeneratedCode.HttpWorkloadClient.EncryptAsync(String api_version, String name, String genid, EncryptRequest payload, CancellationToken cancellationToken) in /opt/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/edged/generatedCode/HttpWorkloadClient.cs:line 218
   at Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient.Execute[T](Func`1 func, String operation)
   at Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient.EncryptAsync(String initializationVector, String plainText) in /opt/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/edged/WorkloadClient.cs:line 57
   at Microsoft.Azure.Devices.Edge.Agent.Core.ConfigSources.FileBackupConfigSource.BackupDeploymentConfig(DeploymentConfigInfo deploymentConfigInfo) in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/configsources/FileBackupConfigSource.cs:line 68
2018-07-05 00:22:30.096 +00:00 [WRN] - Reconcile failed because of the an exception
System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ---> System.Net.Sockets.SocketException: Operation canceled
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.FillAsync()
   at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Edge.Agent.Core.Agent.ReconcileAsync(CancellationToken token) in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/Agent.cs:line 190
2018-07-05 00:22:30.302 +00:00 [INF] - Updated reported properties

These exceptions are then repeated indefinitely.

Things I have since tried to do to get the module working again:

  • restart the iotedgeservice
  • restart the individual modules (fails with 'Hyper error' see #15)
  • restart docker
  • restart the host machine

The module still cannot connect to the edgeHub after trying all these, the new exception is:

IoT Hub module Init called
Unhandled Exception: System.AggregateException: One or more errors occurred. (Operation timeout expired.) ---> System.TimeoutException: Operation timeout expired.
   at Microsoft.Azure.Devices.Client.InternalClient.<>c.<ApplyTimeout>b__62_2(Task t)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MockModbusModuleV2.Program.<Init>d__15.MoveNext() in /app/Program.cs:line 106
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at MockModbusModuleV2.Program.Main(String[] args) in /app/Program.cs:line 72

And the line it is hanging on now is this:

await ioTHubModuleClient.OpenAsync();

Supported OS and Platform combination

I see Azure IoT Edge Support.
But I don't understand that IoT Edge supported OS and Platform(x86/x64/Arm) combination.

So, I tried IoT Core on RasPi, I had error.

[192.168.0.4]: PS C:\Data\Users\Administrator\Documents> Invoke-WebRequest -useb https://download.microsoft.com/download/0/6/4/064F84EA
-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe -o vc_redist.exe
[192.168.0.4]: PS C:\Data\Users\Administrator\Documents> .\vc_redist.exe /quiet /norestart
Program 'vc_redist.exe' failed to run: The specified executable is not a valid applicati
on for this OS platform..
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

[192.168.0.4]: PS C:\Data\Users\Administrator\Documents>

Please tell me some support infomation.

.Net SDK support for Edge Device Creation

I donโ€™t seem to be able to find support in the latest .Net SDK for creating an Edge device programmatically, only via the portal, CLI or VS Code.

Is this going to be a supported use case at some point?

Referencing other projects c#

Hi there,

I'm trying to reference another project of mine in my IoT Edge Solution in Visual Studio Code (C#).
Adding the reference using 'dotnet add reference' works, it recognizes the project and adds the reference to my .csproj file.

However, when I try to build the IoT Edge solution, I get the following error:
Skipping project "/project/project.csproj" because it was not found.

Modules all restarted automatically, causing modules to no longer communicate.

Expected Behavior

I would expect that modules should be able to stay up indefinitely, with no intervention, and be-self healing in that they should properly be able to stand back up if they stop for some reason.

Current Behavior

Last night, all running modules on a test device (including edgeAgent and edgeHub module) restarted at the same time for some reason which is unclear to me. Since restarting, the modules have stopped sending messages to eachother over the local edge infrastructure using ModuleClient.SendEventAsync.

Steps to Reproduce

I wish I knew. Our modules had been all running for 7 days, mostly under heavy load / soak testing.

Context (Environment)

two basic modules, a "server module" and a "cloud upload module", the server module accepts a proprietary type of connection (layer over TCP) and then saves a file which is streamed to it. this module then sends a message to the cloud upload module telling it the location of the file that it has saved (on a shared volume) and the file is then uploaded to the cloud for processing. This has been working well and this is the first time I've seen an issue like this after running this setup for a number of months (albeit normally restarting the devices more frequently than this!)

Device (Host) Operating System

Ubuntu 18.04 Server.

Architecture

amd64

Container Operating System

Linux containers

Runtime Versions

iotedged

iotedge 1.0.0 (52ef77d)

Edge Agent

1.0.0.14487025 (52ef77d)

Edge Hub

1.0.0.14487025 (52ef77d)

Docker

Client:
 Version:           18.06.0-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        0ffa825
 Built:             Wed Jul 18 19:09:54 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.0-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       0ffa825
  Built:            Wed Jul 18 19:07:56 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Logs

I believe that the thing that caused the modules to restart may have been the daemon. here are the logs of that for the time period:

Jul 23 22:55:54 gigabyte iotedged[1122]: 2018-07-23T22:55:54Z [INFO] - Checking edge runtime status
Jul 23 22:55:54 gigabyte iotedged[1122]: 2018-07-23T22:55:54Z [INFO] - Edge runtime is running.
Jul 23 22:56:03 gigabyte iotedged[1122]: 2018-07-23T22:56:03Z [INFO] - [mgmt] - - - [2018-07-23 22:56:03.880145623 UTC] "POST /modules/edgeHub/stop?api-version=2018-06-28 HTTP/1.1" 204 No Content - "-" "-" pid(1726)
Jul 23 22:56:03 gigabyte iotedged[1122]: 2018-07-23T22:56:03Z [ERR!] - server connection error: (unknown) Broken pipe (os error 32)
Jul 23 22:56:54 gigabyte iotedged[1122]: 2018-07-23T22:56:54Z [INFO] - Checking edge runtime status
Jul 23 22:56:54 gigabyte iotedged[1122]: 2018-07-23T22:56:54Z [INFO] - Edge runtime status is failed, starting module now...
Jul 23 22:56:56 gigabyte iotedged[1122]: 2018-07-23T22:56:56Z [INFO] - [mgmt] - - - [2018-07-23 22:56:56.121918573 UTC] "GET /systeminfo?api-version=2018-06-28 HTTP/1.1" 200 OK 42 "-" "-" pid(7500)
Jul 23 22:56:56 gigabyte iotedged[1122]: 2018-07-23T22:56:56Z [INFO] - [work] - - - [2018-07-23 22:56:56.245839355 UTC] "POST /modules/%24edgeAgent/genid/{obfuscated}/decrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 2024 "-" "-" pid(7500)
Jul 23 22:56:56 gigabyte iotedged[1122]: 2018-07-23T22:56:56Z [INFO] - [mgmt] - - - [2018-07-23 22:56:56.404117051 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 2127 "-" "-" pid(7500)
Jul 23 22:56:57 gigabyte iotedged[1122]: 2018-07-23T22:56:57Z [INFO] - [work] - - - [2018-07-23 22:56:57.050943285 UTC] "POST /modules/%24edgeAgent/genid/{obfuscated}/sign?api-version=2018-06-28 HTTP/1.1" 200 OK 57 "-" "-" pid(7500)
Jul 23 22:56:58 gigabyte iotedged[1122]: 2018-07-23T22:56:58Z [INFO] - [work] - - - [2018-07-23 22:56:58.461708900 UTC] "POST /modules/%24edgeAgent/genid/{obfuscated}/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 2049 "-" "-" pid(7500)
Jul 23 22:56:58 gigabyte iotedged[1122]: 2018-07-23T22:56:58Z [WARN] - Container already in this state
Jul 23 22:56:58 gigabyte iotedged[1122]: 2018-07-23T22:56:58Z [INFO] - [mgmt] - - - [2018-07-23 22:56:58.605138993 UTC] "POST /modules/edgeHub/stop?api-version=2018-06-28 HTTP/1.1" 304 Not Modified - "-" "-" pid(7500)
Jul 23 22:56:59 gigabyte iotedged[1122]: 2018-07-23T22:56:59Z [INFO] - [mgmt] - - - [2018-07-23 22:56:59.304726148 UTC] "POST /modules/edgeHub/start?api-version=2018-06-28 HTTP/1.1" 204 No Content - "-" "-" pid(7500)
Jul 23 22:56:59 gigabyte iotedged[1122]: 2018-07-23T22:56:59Z [WARN] - Container already in this state
Jul 23 22:56:59 gigabyte iotedged[1122]: 2018-07-23T22:56:59Z [INFO] - [mgmt] - - - [2018-07-23 22:56:59.313659890 UTC] "POST /modules/dicomscpmodule/stop?api-version=2018-06-28 HTTP/1.1" 304 Not Modified - "-" "-" pid(7500)
Jul 23 22:56:59 gigabyte iotedged[1122]: 2018-07-23T22:56:59Z [INFO] - [work] - - - [2018-07-23 22:56:59.739710487 UTC] "POST /modules/%24edgeHub/genid/{obfuscated}/certificate/server?api-version=2018-06-28 HTTP/1.1" 201 Created 8497 "-" "-" pid(7711)
Jul 23 22:56:59 gigabyte iotedged[1122]: 2018-07-23T22:56:59Z [INFO] - [mgmt] - - - [2018-07-23 22:56:59.973137735 UTC] "POST /modules/dicomscpmodule/start?api-version=2018-06-28 HTTP/1.1" 204 No Content - "-" "-" pid(7500)
Jul 23 22:56:59 gigabyte iotedged[1122]: 2018-07-23T22:56:59Z [WARN] - Container already in this state
Jul 23 22:56:59 gigabyte iotedged[1122]: 2018-07-23T22:56:59Z [INFO] - [mgmt] - - - [2018-07-23 22:56:59.974284432 UTC] "POST /modules/clouduploadmodule/stop?api-version=2018-06-28 HTTP/1.1" 304 Not Modified - "-" "-" pid(7500)
Jul 23 22:57:00 gigabyte iotedged[1122]: 2018-07-23T22:57:00Z [INFO] - [work] - - - [2018-07-23 22:57:00.113127732 UTC] "GET /trust-bundle?api-version=2018-06-28 HTTP/1.1" 200 OK 1774 "-" "-" pid(7857)
Jul 23 22:57:00 gigabyte iotedged[1122]: 2018-07-23T22:57:00Z [INFO] - [mgmt] - - - [2018-07-23 22:57:00.771513074 UTC] "POST /modules/clouduploadmodule/start?api-version=2018-06-28 HTTP/1.1" 204 No Content - "-" "-" pid(7500)
Jul 23 22:57:00 gigabyte iotedged[1122]: 2018-07-23T22:57:00Z [INFO] - [work] - - - [2018-07-23 22:57:00.778437784 UTC] "POST /modules/%24edgeAgent/genid/{obfuscated}/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 2049 "-" "-" pid(7500)
Jul 23 22:57:00 gigabyte iotedged[1122]: 2018-07-23T22:57:00Z [INFO] - [work] - - - [2018-07-23 22:57:00.885624442 UTC] "GET /trust-bundle?api-version=2018-06-28 HTTP/1.1" 200 OK 1774 "-" "-" pid(7991)
Jul 23 22:57:02 gigabyte iotedged[1122]: 2018-07-23T22:57:02Z [INFO] - [work] - - - [2018-07-23 22:57:02.755945218 UTC] "POST /modules/%24edgeHub/genid/{obfuscated}/sign?api-version=2018-06-28 HTTP/1.1" 200 OK 57 "-" "-" pid(7711)
Jul 23 22:57:06 gigabyte iotedged[1122]: 2018-07-23T22:57:06Z [INFO] - [mgmt] - - - [2018-07-23 22:57:06.143968869 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 2129 "-" "-" pid(7500)
Jul 23 22:57:06 gigabyte iotedged[1122]: 2018-07-23T22:57:06Z [INFO] - [work] - - - [2018-07-23 22:57:06.144498424 UTC] "POST /modules/%24edgeAgent/genid/{obfuscated}/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 2049 "-" "-" pid(7500)
Jul 23 22:57:07 gigabyte iotedged[1122]: 2018-07-23T22:57:07Z [INFO] - [work] - - - [2018-07-23 22:57:07.049742588 UTC] "POST /modules/clouduploadmodule/genid/{obfuscated}/sign?api-version=2018-06-28 HTTP/1.1" 200 OK 57 "-" "-" pid(7991)
Jul 23 22:57:09 gigabyte iotedged[1122]: 2018-07-23T22:57:09Z [INFO] - [work] - - - [2018-07-23 22:57:09.918683570 UTC] "POST /modules/dicomscpmodule/genid/{obfuscated}/sign?api-version=2018-06-28 HTTP/1.1" 200 OK 57 "-" "-" pid(7857)
Jul 23 22:57:11 gigabyte iotedged[1122]: 2018-07-23T22:57:11Z [INFO] - [mgmt] - - - [2018-07-23 22:57:11.478415066 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 2129 "-" "-" pid(7500)

(I've taken out the genid because its being used to encrypt/decrypt/sign so I thought it might be counted as a secret, but let me know if it is actually needed to debug this).

We can see the stop requests coming through to the modules:
edgeAgent:

2018-07-23 22:55:53.214 +00:00 [INF] - Termination requested, initiating shutdown.
2018-07-23 22:55:53.215 +00:00 [INF] - Main thread terminated
2018-07-23 22:55:53.220 +00:00 [INF] - Initiating shutdown cleanup.
2018-07-23 22:55:53.223 +00:00 [INF] - Stopping all modules...
2018-07-23 22:55:53.225 +00:00 [INF] - Waiting for cleanup to finish
2018-07-23 22:55:53.231 +00:00 [INF] - Plan execution started for deployment -1
2018-07-23 22:55:53.231 +00:00 [INF] - Executing command: "Stop module clouduploadmodule"
2018-07-23 22:55:53.783 +00:00 [INF] - Executing command: "Stop module edgeHub"
[2018-07-23 22:56:55 : Starting Edge Agent
[07/23/2018 10:56:55.116 PM] Edge Agent Main()
2018-07-23 22:56:55.290 +00:00 [INF] - Starting module management agent.
2018-07-23 22:56:55.442 +00:00 [INF] - Version - 1.0.0.14487025 (52ef77db24126bf473265fc09c53d35290a2dd6b)
2018-07-23 22:56:55.443 +00:00 [INF] -
        โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•”โ•  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•
       โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•

 โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•    โ•šโ•โ•       โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•

2018-07-23 22:56:55.573 +00:00 [INF] - Edge agent attempting to connect to IoT Hub via AMQP...
2018-07-23 22:56:56.045 +00:00 [INF] - Created persistent store at /tmp/edgeAgent
2018-07-23 22:56:57.823 +00:00 [INF] - Edge agent connected to IoT Hub via AMQP.
2018-07-23 22:56:58.577 +00:00 [INF] - Plan execution started for deployment 13
2018-07-23 22:56:58.585 +00:00 [INF] - Executing command: "Command Group: (
  [Stop module edgeHub]
  [Start module edgeHub]
  [Saving edgeHub to store]
)"
2018-07-23 22:56:58.587 +00:00 [INF] - Executing command: "Stop module edgeHub"
2018-07-23 22:56:58.616 +00:00 [INF] - Executing command: "Start module edgeHub"
2018-07-23 22:56:59.307 +00:00 [INF] - Executing command: "Saving edgeHub to store"
2018-07-23 22:56:59.312 +00:00 [INF] - Executing command: "Command Group: (
  [Stop module servermodule]
  [Start module servermodule]
  [Saving servermodule to store]
)"
2018-07-23 22:56:59.312 +00:00 [INF] - Executing command: "Stop module servermodule"
2018-07-23 22:56:59.314 +00:00 [INF] - Executing command: "Start module servermodule"
2018-07-23 22:56:59.973 +00:00 [INF] - Executing command: "Saving servermodule to store"
2018-07-23 22:56:59.973 +00:00 [INF] - Executing command: "Command Group: (
  [Stop module clouduploadmodule]
  [Start module clouduploadmodule]
  [Saving clouduploadmodule to store]
)"
2018-07-23 22:56:59.973 +00:00 [INF] - Executing command: "Stop module clouduploadmodule"
2018-07-23 22:56:59.974 +00:00 [INF] - Executing command: "Start module clouduploadmodule"
2018-07-23 22:57:00.771 +00:00 [INF] - Executing command: "Saving clouduploadmodule to store"
2018-07-23 22:57:00.772 +00:00 [INF] - Plan execution ended for deployment 13
2018-07-23 22:57:01.139 +00:00 [INF] - Updated reported properties
2018-07-23 22:57:06.470 +00:00 [INF] - Updated reported properties
2018-07-23 23:05:58.023 +00:00 [INF] - HealthRestartPlanner is clearing restart stats for module 'servermodule' as it has been running healthy for 00:10:00.
2018-07-23 23:05:58.023 +00:00 [INF] - HealthRestartPlanner is clearing restart stats for module 'clouduploadmodule' as it has been running healthy for 00:10:00.
2018-07-23 23:05:58.023 +00:00 [INF] - Plan execution started for deployment 13
2018-07-23 23:05:58.024 +00:00 [INF] - Executing command: "Saving servermodule to store"
2018-07-23 23:05:58.025 +00:00 [INF] - Executing command: "Saving clouduploadmodule to store"
2018-07-23 23:05:58.025 +00:00 [INF] - Plan execution ended for deployment 13
2018-07-23 23:06:03.347 +00:00 [INF] - Updated reported properties
2018-07-23 23:06:08.374 +00:00 [INF] - HealthRestartPlanner is clearing restart stats for module 'edgeHub' as it has been running healthy for 00:10:00.
2018-07-23 23:06:08.374 +00:00 [INF] - Plan execution started for deployment 13
2018-07-23 23:06:08.374 +00:00 [INF] - Executing command: "Saving edgeHub to store"
2018-07-23 23:06:08.374 +00:00 [INF] - Plan execution ended for deployment 13
2018-07-23 23:06:13.674 +00:00 [INF] - Updated reported properties

edgeHub:

2018-07-23 22:55:53.214 +00:00 [INF] - Termination requested, initiating shutdown.
2018-07-23 22:55:53.216 +00:00 [INF] - Closing protocol heads - (HTTP, MQTT, AMQP)
2018-07-23 22:55:53.219 +00:00 [INF] - Closing HTTP head
2018-07-23 22:55:53.241 +00:00 [INF] - Stopping
2018-07-23 22:55:53.247 +00:00 [INF] - Closed HTTP head
2018-07-23 22:55:53.252 +00:00 [INF] - Waiting for cleanup to finish
2018-07-23 22:55:53.298 +00:00 [INF] - Closing link Events for DevDevice/clouduploadmodule
2018-07-23 22:55:53.299 +00:00 [INF] - Closing link TwinReceiving for DevDevice/clouduploadmodule
2018-07-23 22:55:53.299 +00:00 [INF] - Closing link TwinSending for DevDevice/clouduploadmodule
2018-07-23 22:55:53.299 +00:00 [INF] - Closing link ModuleMessages for DevDevice/clouduploadmodule
2018-07-23 22:55:53.317 +00:00 [INF] - Closing link Events for DevDevice/servermodule
2018-07-23 22:55:53.317 +00:00 [INF] - Closing link TwinReceiving for DevDevice/servermodule
2018-07-23 22:55:53.317 +00:00 [INF] - Closing link TwinSending for DevDevice/servermodule
[2018-07-23 22:56:59 : Starting Edge Hub
[07/23/2018 10:56:59.357 PM] Edge Hub Main()
2018-07-23 22:57:00.462 +00:00 [INF] - Starting Edge Hub
2018-07-23 22:57:00.473 +00:00 [INF] - Version - 1.0.0.14487025 (52ef77db24126bf473265fc09c53d35290a2dd6b)
2018-07-23 22:57:00.474 +00:00 [INF] -
        โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•”โ•  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•
       โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•

 โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•    โ•šโ•โ•       โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•

2018-07-23 22:57:00.474 +00:00 [INF] - Installing intermediate certificates.
2018-07-23 22:57:00.556 +00:00 [INF] - Attempting to connect to IoT Hub for client DevDevice/$edgeHub via AMQP...
2018-07-23 22:57:00.607 +00:00 [INF] - Connected to IoT Hub for client DevDevice/$edgeHub via AMQP, with client operation timeout 60000.
2018-07-23 22:57:00.614 +00:00 [INF] - Created cloud connection for client DevDevice/$edgeHub
2018-07-23 22:57:00.615 +00:00 [INF] - New cloud connection created for device DevDevice/$edgeHub
2018-07-23 22:57:00.620 +00:00 [INF] - Initializing configuration
2018-07-23 22:57:00.984 +00:00 [INF] - Created persistent store at /tmp/edgeHub
2018-07-23 22:57:01.002 +00:00 [INF] - Created new message store
2018-07-23 22:57:01.003 +00:00 [INF] - Started task to cleanup processed and stale messages
2018-07-23 22:57:01.049 +00:00 [INF] - New device connection for device DevDevice/$edgeHub
2018-07-23 22:57:03.955 +00:00 [INF] - Entering connected state
2018-07-23 22:57:06.052 +00:00 [INF] - Obtained edge hub config from module twin
2018-07-23 22:57:06.142 +00:00 [INF] - Set the following 1 route(s) in edge hub
2018-07-23 22:57:06.144 +00:00 [INF] - scptouploader: FROM /messages/modules/servermodule/outputs/FileAvailableToUpload INTO BrokeredEndpoint("/modules/clouduploadmodule/inputs/FileAvailableToUpload")
2018-07-23 22:57:06.145 +00:00 [INF] - Updated message store TTL to 7200 seconds
2018-07-23 22:57:06.146 +00:00 [INF] - Updated the edge hub store and forward configuration
2018-07-23 22:57:06.146 +00:00 [INF] - Initialized edge hub configuration
2018-07-23 22:57:06.223 +00:00 [INF] - Starting protocol heads - (HTTP, MQTT, AMQP)
2018-07-23 22:57:06.225 +00:00 [INF] - Starting HTTP head
2018-07-23 22:57:06.297 +00:00 [INF] - User profile is available. Using '"/home/edgehubuser/.aspnet/DataProtection-Keys"' as key repository; keys will not be encrypted at rest.
2018-07-23 22:57:06.556 +00:00 [WRN] - Overriding address(es) '"http://+:80"'. Binding to endpoints defined in "UseKestrel()" instead.
2018-07-23 22:57:06.577 +00:00 [INF] - Started HTTP head
2018-07-23 22:57:06.581 +00:00 [INF] - Starting MQTT head
2018-07-23 22:57:06.622 +00:00 [INF] - Initializing TLS endpoint on port 8883 for MQTT head.
2018-07-23 22:57:06.667 +00:00 [INF] - Starting AMQP head
2018-07-23 22:57:06.674 +00:00 [INF] - Started MQTT head
2018-07-23 22:57:06.754 +00:00 [INF] - Started AMQP head
2018-07-23 22:57:07.210 +00:00 [INF] - Attempting to connect to IoT Hub for client DevDevice/clouduploadmodule via AMQP...
2018-07-23 22:57:07.212 +00:00 [INF] - Connected to IoT Hub for client DevDevice/clouduploadmodule via AMQP, with client operation timeout 60000.
2018-07-23 22:57:07.212 +00:00 [INF] - Created cloud connection for client DevDevice/clouduploadmodule
2018-07-23 22:57:07.212 +00:00 [INF] - New cloud connection created for device DevDevice/clouduploadmodule
2018-07-23 22:57:07.221 +00:00 [INF] - New token requested by client DevDevice/clouduploadmodule, but using existing token as it is usable.
2018-07-23 22:57:07.307 +00:00 [INF] - New device connection for device DevDevice/clouduploadmodule
2018-07-23 22:57:07.314 +00:00 [INF] - Bind device proxy for device DevDevice/clouduploadmodule
2018-07-23 22:57:07.315 +00:00 [INF] - Initialized AMQP connection handler for DevDevice/clouduploadmodule
2018-07-23 22:57:07.324 +00:00 [INF] - Opened link Events for DevDevice/clouduploadmodule
2018-07-23 22:57:07.483 +00:00 [INF] - Opened link TwinReceiving for DevDevice/clouduploadmodule
2018-07-23 22:57:07.516 +00:00 [INF] - Opened link TwinSending for DevDevice/clouduploadmodule
2018-07-23 22:57:07.547 +00:00 [INF] - Opened link ModuleMessages for DevDevice/clouduploadmodule
2018-07-23 22:57:10.038 +00:00 [INF] - Attempting to connect to IoT Hub for client DevDevice/servermodule via AMQP...
2018-07-23 22:57:10.038 +00:00 [INF] - Connected to IoT Hub for client DevDevice/servermodule via AMQP, with client operation timeout 60000.
2018-07-23 22:57:10.038 +00:00 [INF] - Created cloud connection for client DevDevice/servermodule
2018-07-23 22:57:10.038 +00:00 [INF] - New cloud connection created for device DevDevice/servermodule
2018-07-23 22:57:10.044 +00:00 [INF] - New token requested by client DevDevice/servermodule, but using existing token as it is usable.
2018-07-23 22:57:10.405 +00:00 [INF] - New device connection for device DevDevice/servermodule
2018-07-23 22:57:10.405 +00:00 [INF] - Bind device proxy for device DevDevice/servermodule
2018-07-23 22:57:10.405 +00:00 [INF] - Initialized AMQP connection handler for DevDevice/servermodule
2018-07-23 22:57:10.405 +00:00 [INF] - Opened link Events for DevDevice/servermodule
2018-07-23 22:57:10.434 +00:00 [INF] - Opened link TwinReceiving for DevDevice/servermodule
2018-07-23 22:57:10.801 +00:00 [INF] - Opened link TwinSending for DevDevice/servermodule
2018-07-23 23:27:01.010 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint DevDevice/clouduploadmodule/FileAvailableToUpload
2018-07-23 23:27:01.017 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint DevDevice/clouduploadmodule/FileAvailableToUpload and 0 messages from message store.
2018-07-23 23:55:07.001 +00:00 [INF] - Existing token not found for DevDevice/clouduploadmodule. Getting new token from the client...
2018-07-23 23:55:07.014 +00:00 [INF] - Obtained new token for client DevDevice/clouduploadmodule that expires in 00:01:59.9855629
2018-07-23 23:55:09.997 +00:00 [INF] - Existing token not found for DevDevice/servermodule. Getting new token from the client...
2018-07-23 23:55:09.997 +00:00 [INF] - Obtained new token for client DevDevice/servermodule that expires in 00:02:00.0021347
2018-07-23 23:56:58.045 +00:00 [INF] - Existing token not found for DevDevice/clouduploadmodule. Getting new token from the client...
2018-07-23 23:56:58.045 +00:00 [INF] - Obtained new token for client DevDevice/clouduploadmodule that expires in 00:58:08.9545903
2018-07-23 23:57:01.047 +00:00 [INF] - Existing token not found for DevDevice/servermodule. Getting new token from the client...
2018-07-23 23:57:01.048 +00:00 [INF] - Obtained new token for client DevDevice/servermodule that expires in 00:58:08.9518749
2018-07-23 23:57:31.015 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint DevDevice/clouduploadmodule/FileAvailableToUpload
2018-07-23 23:57:31.015 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint DevDevice/clouduploadmodule/FileAvailableToUpload and 0 messages from message store.
2018-07-24 00:28:01.015 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint DevDevice/clouduploadmodule/FileAvailableToUpload

And one of the modules:

23-07-2018 22:55:53.21 Verbose:  Module cancellation requested.
23-07-2018 22:55:53.21 Verbose:  Cancelling module main task...
23-07-2018 22:55:53.21 Verbose:  ...stopping check queued image task.
23-07-2018 22:55:53.21 Information:  Gateway Module Stopped event logged. gatewayId: DevDevice.   module: clouduploadmodule.
23-07-2018 22:57:00.81 Verbose:  Starting init...
23-07-2018 22:57:07.33 Verbose:  ...IoT Hub module client initialized
23-07-2018 22:57:07.42 Verbose:  ...dicom private dictionary initialized
23-07-2018 22:57:07.52 Verbose:  ...desired property update callback initialized
23-07-2018 22:57:07.55 Verbose:  ...edge local message handler initialized

Additional Information

All of the modules started back up, but none of them seem to be communicating to eachother. the servermodule is still receiving connections from the outside (from TCP connections coming in from outside the host system), and thinks that it is sending messages accross the edge infrastructure, but they're never showing up in the other module.

also of note:

  • both modules are still responding to twin updates from the portal, but still do not communicate with eachother.
  • all modules are communicating over amqp

There are two separate issues here in my eyes,

  1. the modules all restarted for some unknown (to me) reason
  2. the modules started back up and reported as "healthy" but are not actually communicating with eachother, meaning that it's not really working at all.

I will try to leave this device in a broken state for some time in case there are any other logs that we might need.

IoT Edge Module - Missing Connection String for Module

Expected Behavior

Connection String or relevant Tokens are injected into Module via Env var

Current Behavior

At least the SAS Token is not injected into the module.

Steps to Reproduce

  1. Create a sample Module (e.g. using VSCoce Extension)
  2. Build Container and deploy to edge device
  3. Find env vars not containing a connection string or the SAS token (all other necessary information to build up the connection string is found in differend env-vars)

Context (Environment)

Device (Host) Operating System

Ubuntu 16.04

Architecture

amd64

Container Operating System

Linux containers

Runtime Versions

iotedged

1.0.0

Edge Agent

1.0

Edge Hub

1.0

Docker

Version: dev
API version: 1.37
Git commit 9aac187

Additional Information

In the preview versions the Connection String for the ModuleClient was injected into the docker container. The Environment Variable EdgeHubConnectionString is missing in the version. Additional there is no candidate in the Env-vars with could suits those needs. Even when combining the evn-vars, the SAS Token is missing.

"Module not found" When running arm32v7 image

I've upgraded from preview to GA and have run in to an issue with running iotedge images on my RPI3, the solution works fine if I run on a local repo with the amd64.debug images on my windows machine but when I try to run my arm32v7 images on my RPI I get an error as soon as one of my custom modules run OpenAsync on the ModuleClient.

Steps to Reproduce

  1. I build the solution with arm32v7 images in the deployment template, with azure container registry credentials.
  2. I deploy to IoTEdge device (RPI3).
  3. Wait for IoTEdge device to get images.
  4. Getting the error when the image starts and tries to OpenAsync.

Context (Environment)

Device (Host) Operating System

RPI3 rasbian

Architecture

arm32

Container Operating System

linux containers

Runtime Versions

iotedged

1.0.0

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Docker version 18.02.0-ce, build fc4de44

Logs

Error recevied when image starts, this is revieved as soon as "OpenAsync" is called on my ModuleClient.

Unhandled Exception: System.AggregateException: One or more errors occurred. (Error calling SignAsync: Module not found, StatusCode: 404) ---> Microsoft.Azure.Devices.Client.HsmAuthentication.HttpHsmComunicationException: Error calling SignAsync: Module not found, StatusCode: 404

Additional Information

I'm using AMQP as mentioned here

var amqpSetting = new AmqpTransportSettings(TransportType.Amqp_Tcp_Only);
ITransportSettings[] settings = { amqpSetting };

var moduleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);
await moduleClient.OpenAsync();

Getting an empty list when running iotedge list

I'm running on Ubuntu 16.04 machine
I followed the quick-start instructions for Linux:
https://docs.microsoft.com/en-us/azure/iot-edge/quickstart-linux

When running the command:
sudo iotedge list

I'm getting an empty list:
administrator@administrator-desktop:~$ sudo iotedge list
NAME STATUS DESCRIPTION CONFIG

These are the logs:
[ERR!] - Io(Os { code: 110, kind: TimedOut, message: "Connection timed out" })
[WARN] - Error in watchdog when checking for edge runtime status:
[WARN] - Identity error
[WARN] - caused by: IoT Hub service error
[WARN] - caused by: Core error
[WARN] - caused by: Hyper error
[WARN] - caused by: Connection timed out (os error 110)
[INFO] - Checking edge runtime status
[INFO] - Creating and starting edge runtime module edgeAgent

Module gets disconnected after some time

I have several modules running on an Edge device running on Linux (Edge GA)

After some time, one of the modules is no longer able to send messages to IoT Hub. Even after restarting iotedge it is not able to recover. Sometimes (not always) deleting all docker containers and images the module recovers and starts sending messages again.

On edgeHub, we have the attached log when we restart iotedge and it it is not able to recover.
The module AutomationPublisher is the one which generates the data, and EdgePublisher is the one that sends it to IoT Hub.

log.edgepublisherproblem.txt

GatewayHostName

Unable to get device twin using GatewayHostName in .net framework 4.6.2 (When using .net core project application is able to download device twin.
The connection string that is used:
HostName=someiothub.azure-devices.net;DeviceId=21219-00260;SharedAccessKey=somekey;GatewayHostName=192.0.2.5

Expected Behavior

Behaviour should be same for .net core and application in .net framework 4.6.2

Current Behavior

When starting 462 application I don't see anything in edge logs.

If I run .net core application I see some logs that were attached to this issue.

Steps to Reproduce

Open DeviceTwinTester.sln and try getting device twin using .net core and later using .net framework 462 application.

Context (Environment)

Device (Host) Operating System

Windows 7 is connecting to iot edge to get device twin.
Iot edge is running on Ubuntu 18.04.

Architecture

amd64

Container Operating System

Runtime Versions

iotedged

iotedge 1.0.0 (52ef77d)

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Client:
Version: 18.06.0-dev
API version: 1.37
Go version: go1.10.2
Git commit: daf021fe
Built: Mon Jun 25 21:07:53 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version: dev
API version: 1.37 (minimum version 1.12)
Go version: go1.10.2
Git commit: 9aac187
Built: Mon Jun 25 20:43:05 2018
OS/Arch: linux/amd64
Experimental: false

logWhenConnectedFromNetCore.txt
DeviceTwin.zip

Logs

Additional Information

[Bug] Cannot send a message from the portal with more than 1871 characters

Expected Behavior

When trying to send a json message bigger than 1871 characters, this error happens:

Unable to send message to "...".
There was an error sending this message. Please ensure the device exists and that there are no issues being reported with your IoT Hub.

Current Behavior

From the docs, any message smaller than 64KB should be sent

Steps to Reproduce

  1. Select an IoT Edge device
  2. Click Message to device
  3. Paste this content

{"type":"test", "content":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}

  1. Click Send
  2. Error is raised
  3. Remove only one "A" and it works

Context (Environment)

Device (Host) Operating System

Windows 10, Chrome browser

Architecture

N/A

Container Operating System

N/A

Runtime Versions

N/A

iotedged

N/A

Edge Agent

N/A

Edge Hub

N/A

Docker

N/A

Logs

N/A

Additional Information

N/A

sudo iotedge list/or any command hangs

Current Behavior

I hit a weird issue that the iotedge started hanging or stopped working, however when i issue iotedge its responds with the helper message and commands, but when i issue sudo iotedge list, it hangs.

Steps to Reproduce

Followed the below article and setup iotedge on linux (cjheck the version below), it stopped working after doing sudo apt-get update & upgrade, the hanging behavior started.

https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux

Context (Environment)

IoTEdge Simulation on DSVM (Ubuntu)

Device (Host) Operating System

Linux version 4.15.0-1018-azure (buildd@lgw01-amd64-021) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu116.04.10)) #1816.04.1-Ubuntu SMP Thu Jul 19 13:13:57 UTC 2018

Architecture

amd64

Container Operating System

Linux Containers

Runtime Versions

iotedged

iotedge 1.0.0 (52ef77d)

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Docker version 18.06.0-dev, build daf021fe

Logs

edgeHub.Log
https://gist.github.com/ilyas-it83/e0cd3c94e6ac3e165ea91efb6e8a94d7/raw/34c82fc65e6ed6ab58b9aa9c693f79bf1030ae01/edgeHub.log

edgeAgent.log
https://gist.github.com/ilyas-it83/f2fcc478471a7fe4cd1ba1507bd80c46

Additional Information

All i'm trying is to setup is filtermodule as per https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module, but could not get it work.

user@user-dsvm:~$ iotedge
iotedge 1.0.0 (52ef77d)
The iotedge tool is used to manage the IoT Edge runtime.

USAGE:
iotedge [OPTIONS]

FLAGS:
-h, --help Prints help information
-V, --version Prints version information

OPTIONS:
-H, --host Daemon socket to connect to [env: IOTEDGE_HOST=] [default: unix:///var/run/iotedge/mgmt.sock]

SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
list List modules
logs Fetch the logs of a module
restart Restart a module
version Show the version information
user@user-dsvm:$ iotedge list
An error in the management http client occurred.
caused by: Hyper error
caused by: Permission denied (os error 13)
user@user-dsvm:
$ sudo iotedge list
^C
user@user-dsvm:~$ sudo iotedge -v
error: Found argument '-v' which wasn't expected, or isn't valid in this context

USAGE:
iotedge [OPTIONS]

For more information try --help
user@user-dsvm:$ sudo iotedge --version
iotedge 1.0.0 (52ef77d)
user@user-dsvm:
$ sudo systemctl status iotedge
โ— iotedge.service - Azure IoT Edge daemon
Loaded: loaded (/lib/systemd/system/iotedge.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/iotedge.service.d
โ””โ”€override.conf
Active: active (running) since Wed 2018-07-25 08:37:07 UTC; 1h 6min ago
Docs: man:iotedged(8)
Main PID: 23934 (iotedged)
Tasks: 6
Memory: 10.1M
CPU: 1.702s
CGroup: /system.slice/iotedge.service
โ””โ”€23934 /usr/bin/iotedged -c /etc/iotedge/config.yaml

Jul 25 09:43:46 user-dsvm iotedged[23934]: 2018-07-25T09:43:46Z [DBUG] - [edgelet_http] accepted new connection (172.17.0.2:37255)
Jul 25 09:43:46 user-dsvm iotedged[23934]: 2018-07-25T09:43:46Z [DBUG] - [edgelet_http] accepted new connection (172.17.0.2:38563)
Jul 25 09:43:46 user-dsvm iotedged[23934]: 2018-07-25T09:43:46Z [DBUG] - [edgelet_http_mgmt::server::module::list] List modules
Jul 25 09:43:46 user-dsvm iotedged[23934]: 2018-07-25T09:43:46Z [INFO] - [mgmt] - - - [2018-07-25 09:43:46.842664763 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 2124 "-" "-" pid(any)
Jul 25 09:43:46 user-dsvm iotedged[23934]: 2018-07-25T09:43:46Z [INFO] - [work] - - - [2018-07-25 09:43:46.951141795 UTC] "POST /modules/%24edgeAgent/genid/636675104799092643/encrypt?api-version=2018-06-28 HTT
Jul 25 09:43:52 user-dsvm iotedged[23934]: 2018-07-25T09:43:52Z [DBUG] - [edgelet_http] accepted new connection (172.17.0.2:34971)
Jul 25 09:43:52 user-dsvm iotedged[23934]: 2018-07-25T09:43:52Z [DBUG] - [edgelet_http] accepted new connection (172.17.0.2:36355)
Jul 25 09:43:52 user-dsvm iotedged[23934]: 2018-07-25T09:43:52Z [DBUG] - [edgelet_http_mgmt::server::module::list] List modules
Jul 25 09:43:52 user-dsvm iotedged[23934]: 2018-07-25T09:43:52Z [INFO] - [work] - - - [2018-07-25 09:43:52.661312462 UTC] "POST /modules/%24edgeAgent/genid/636675104799092643/encrypt?api-version=2018-06-28 HTT
Jul 25 09:43:52 user-dsvm iotedged[23934]: 2018-07-25T09:43:52Z [INFO] - [mgmt] - - - [2018-07-25 09:43:52.769567392 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 2124 "-" "-" pid(any)

Please upload crates to crates.io

Please consider uploading all the crates here to Rust's crates.io repository, so that people can easily pull in these crates as dependencies.

Thanks for releasing these!

IoT Edge Messages Sending

Expected Behavior

Current Behavior

Is there any speed limitation of sending messages to the IoT Hub in the IoT Edge? I built a customer module in the IoT Edge which would send 10 messages per second to the IoT Hub. Meanwhile, I could only retrieve 3 or 4 messages per second from the IoT Hub. The latency between the transmitting and receiving of the message increases with the time goes by.

I do two tests. First, I test a normal IoT Device without IoT Edge and adjust the price of IoT Hub. It seems that the IoT Hub can handle more than 10 messages per second. Second, I kill the customer module and shutdown the IoT Edge service(โ€œsystemctl stop iotedgeโ€) immediately. The message receiver for the IoT Hub will stop immediately. Then I restart the IoT Edge service, the blocked messages of the โ€œoldโ€ customer module will show from the IoT Hub. Although currently the customer module has sent new messages to the IoT Hub. By the way, the device is a PC with Linux OS.

Steps to Reproduce

1.built a customer module in the IoT Edge which would send 10 messages per second to the IoT Hub.

Context (Environment)

Device (Host) Operating System

Ubuntu 16.04 and Windows IoT Core

Architecture

amd64

Container Operating System

Linux containers

Runtime Versions

iotedged

Edge Agent

Edge Hub

Docker

18.03.1

Logs

screenshot from 2018-07-20 13-19-17

Additional Information

edgeHub System.Net.Sockets.SocketException (13): Permission denied

Expected Behavior

EdgeHub should start

Current Behavior

edgeHub is crashing

Steps to Reproduce

Deploy a service

Context (Environment)

Device (Host) Operating System

  • Ubuntu 16.04 aarch64

Architecture

aarch64

Container Operating System

Linux Docker version

Runtime Versions

iotedged

<6>2018-07-05T13:00:16Z [INFO] - Starting Azure IoT Edge Security Daemon
<6>2018-07-05T13:00:16Z [INFO] - Version - 1.0.0 (52ef77db24126bf473265fc09c53d35290a2dd6b)
iotedged 0.1.0

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0.0-linux-arm32v7

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0.0-linux-arm32v7

Docker

18.03.1-ce

Logs

2018-06-28 11:22:15.776 +00:00 [FTL] - Unable to start Kestrel.
System.Net.Sockets.SocketException (13): Permission denied
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransport.BindAsync()
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__DisplayClass22_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.EndpointsStrategy.BindAsync(AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
2018-06-28 11:22:15.916 +00:00 [INF] - Starting MQTT head
2018-06-28 11:22:16.071 +00:00 [INF] - Initializing TLS endpoint on port 8883 for MQTT head.
2018-06-28 11:22:16.266 +00:00 [INF] - Starting AMQP head
2018-06-28 11:22:16.292 +00:00 [INF] - Started MQTT head
2018-06-28 11:22:16.778 +00:00 [INF] - Started AMQP head
2018-06-28 11:22:16.848 +00:00 [INF] - Stopping
2018-06-28 11:22:31.981 +00:00 [INF] - Stopped

Unhandled Exception: System.AggregateException: One or more errors occurred. (Permission denied) ---> System.Net.Sockets.SocketException: Permission denied
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransport.BindAsync()
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__DisplayClass22_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.EndpointsStrategy.BindAsync(AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Edge.Hub.Http.HttpProtocolHead.StartAsync() in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Http/HttpProtocolHead.cs:line 25
   at Microsoft.Azure.Devices.Edge.Hub.Service.Program.MainAsync(IConfigurationRoot configuration) in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 119
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.Azure.Devices.Edge.Hub.Service.Program.Main() in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 31

Additional Information

Except ssh and docker no other service is running on the host system

iotedged can't work with systemd < 227

systemd introduced sd_listen_fds_with_names since version 227 and Debian 8 use systemd 215 which won't pass env LISTEN_FDNAMES to iotedged.

Here is a workaround for me now, by adding Environment=LISTEN_FDNAMES=iotedge.mgmt.socket:iotedge.socket manually in /etc/systemd/system/multi-user.target.wants/iotedge.service

The entire file:

[Unit]
Description=Azure IoT Edge daemon
After=network-online.target iotedge.socket iotedge.mgmt.socket
Requires=network-online.target iotedge.socket iotedge.mgmt.socket
Documentation=man:iotedged(8)

[Service]
ExecStart=/usr/bin/iotedged -c /etc/iotedge/config.yaml
Environment=LISTEN_FDNAMES=iotedge.mgmt.socket:iotedge.socket
KillMode=process
TimeoutStartSec=600
TimeoutStopSec=40
Restart=on-failure
User=iotedge
Group=iotedge

[Install]
WantedBy=multi-user.target
Also=iotedge.socket iotedge.mgmt.socket

Do iotedged really need to use LISTEN_FDNAMES? Or maybe add a fallback mechanism would be great.

edgeHub container fails to start, probably due to user permissions (listen on port 443 with unprivileged user)

I am trying to setup GA on redhat 7. One of the errors I have found is that the edgeHub Docker container is unable to start. After some troubleshooting and after checking that the iotedged daemon was reachable through http I created a custom Docker image with user "root" and it worked so I suspect it is due to the edgeHub is unable to listen in that port and it fails. This is the error I am getting:

[2018-07-17 07:23:34 : Starting Edge Hub
[07/17/2018 07:23:34.254 AM] Edge Hub Main()
FailFast:
Exception thrown from SocketAsyncEngine event loop: System.TypeInitializationException: The type initializer for 'OperationQueue1' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.ThreadPool, Version=4.1.1.0, Culture=neutral, PublicKeyToken=*********'. Access is denied. at System.Net.Sockets.SocketAsyncContext.OperationQueue1..cctor()
--- End of inner exception stack trace ---
at System.Net.Sockets.SocketAsyncContext.OperationQueue1.HandleEvent(SocketAsyncContext context) at System.Net.Sockets.SocketAsyncContext.HandleEvents(SocketEvents events) at System.Net.Sockets.SocketAsyncEngine.EventLoop() at System.Environment.FailFast(System.String, System.Exception) at System.Environment.FailFast(System.String, System.Exception) at System.Net.Sockets.SocketAsyncEngine.EventLoop() at System.Net.Sockets.SocketAsyncEngine+<>c.<.ctor>b__24_0(System.Object) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) Exception details: System.TypeInitializationException: The type initializer for 'OperationQueue1' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.ThreadPool, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Access is denied.
at System.Net.Sockets.SocketAsyncContext.OperationQueue1..cctor() --- End of inner exception stack trace --- at System.Net.Sockets.SocketAsyncContext.OperationQueue1.HandleEvent(SocketAsyncContext context)
at System.Net.Sockets.SocketAsyncContext.HandleEvents(SocketEvents events)
at System.Net.Sockets.SocketAsyncEngine.EventLoop()

iotedge restart [MODULE] fails with 'Hyper error'

Windows 10 with linux containers, GA release

I am trying to restart individual module with the command iotedge restart [module]. This just returns the error:

An error in the management http client occurred.
caused by: Hyper error
caused by: No connection could be made because the target machine actively refused it. (os error 10061)

Running IoTEdge modules on arm64 architecture

Hi,

I am trying to run modules with IoTEdge on a Nvidia Jetson TX2 hardware with arm64 architecture.

With iotedge v1 by selecting image - azureiotedge-agent:1.0.0-preview022-linux-arm32v7
while setting up iotedgectl I was able to work it out.

I want to setup Iotedge GA with the Jetson (arm64 ). Is there any way to do so?

Malformed messages after going through a Function

Expected Behavior

On my edge device I have a tempSensor module routing into a filter function module. The Function simply copies every incoming message into its output. I expect to get exactly the same messages out of the function as are coming out of the temp sensor. This is an example message coming out of tempSensor module directly (using VS Code to monitor):

[IoTHubMonitor] Message received from [andre-desktop]:
{
"machine": {
"temperature": 31.844796382051335,
"pressure": 2.2354831321324307
},
"ambient": {
"temperature": 20.745613186268887,
"humidity": 24
},
"timeCreated": "2018-07-27T22:59:15.1345698Z"
}

Current Behavior

After going through the Function, I get malformed messages (see this screenshot):

fromfunction

Steps to Reproduce

I'm following steps in this tutorial: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-function
Except I don't make any modifications to the function code which is generated by the template. Here is my function code:

#r "Microsoft.Azure.Devices.Client"

using System.IO;
using Microsoft.Azure.Devices.Client;

public static async Task Run(Message messageReceived, IAsyncCollector output, TraceWriter log)
{
byte[] messageBytes = messageReceived.GetBytes();
var messageString = System.Text.Encoding.UTF8.GetString(messageBytes);

if (!string.IsNullOrEmpty(messageString))
{
    log.Info("Info: Received one non-empty message");
    var pipeMessage = new Message(messageBytes);
    foreach (KeyValuePair<string, string> prop in messageReceived.Properties)
    {
        pipeMessage.Properties.Add(prop.Key, prop.Value);
    }
    await output.AddAsync(pipeMessage);
    log.Info("Info: Piped out the message");
}

}

Here is my deployment template:

{
"moduleContent": {
"$edgeAgent": {
"properties.desired": {
"schemaVersion": "1.0",
"runtime": {
"type": "docker",
"settings": {
"minDockerVersion": "v1.25",
"loggingOptions": "",
"registryCredentials": {
"andretestcr": {
"username": "$CONTAINER_REGISTRY_USERNAME_andretestcr",
"password": "$CONTAINER_REGISTRY_PASSWORD_andretestcr",
"address": "andretestcr.azurecr.io"
}
}
}
},
"systemModules": {
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"createOptions": ""
}
},
"edgeHub": {
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"createOptions": "{"HostConfig":{"PortBindings":{"8883/tcp":[{"HostPort":"8883"}],"443/tcp":[{"HostPort":"443"}]}}}"
}
}
},
"modules": {
"tempSensor": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
"createOptions": ""
}
},
"SampleFunc": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "${MODULES.SampleFunc.amd64.debug}",
"createOptions": ""
}
}
}
}
},
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.0",
"routes": {
"sensorToSampleFunc": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint("/modules/SampleFunc/inputs/input1")",
"SampleFuncToIoTHub": "FROM /messages/modules/SampleFunc/* INTO $upstream"
},
"storeAndForwardConfiguration": {
"timeToLiveSecs": 7200
}
}
}
}
}

I made 2 modifications in this deployment template:

  1. I'm using a .debug image for the function
  2. I modified the route SampleFuncToIoTHub to be "FROM /messages/modules/SampleFunc/* INTO $upstream" instead of "FROM /messages/modules/SampleFunc/outputs/output1 INTO $upstream". Without this change, the messages from function output weren't going to IoT Hub.

Context (Environment)

Device (Host) Operating System

Windows 10 Ent

Architecture

x64

Container Operating System

Linux containers

Runtime Versions

GA

iotedged

iotedge 1.0.0 (52ef77d)

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Client:
Version: 18.06.0-ce
API version: 1.38
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:05:28 2018
OS/Arch: windows/amd64
Experimental: false

Server:
Engine:
Version: 18.06.0-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:13:46 2018
OS/Arch: linux/amd64
Experimental: true

Logs

I didn't notice anything suspicious in the logs. Here is a short snippet of edgeHub log:

2018-07-27 22:43:18.986 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Amqp.LinkHandlers.EventsLinkHandler] - EventsLinkHandler processed 1 messages for andre-desktop/tempSensor
2018-07-27 22:43:18.986 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Getting next batch for endpoint andre-desktop/SampleFunc/input1 starting from 24 with batch size 10.
2018-07-27 22:43:18.988 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Obtained next batch for endpoint andre-desktop/SampleFunc/input1 with batch size 1. Next start offset = 25.
2018-07-27 22:43:18.988 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.ModuleEndpoint] - Sending 1 message(s) to module andre-desktop/SampleFunc.
2018-07-27 22:43:18.989 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Device.DeviceMessageHandler] - Sent message with correlation ID db986baa-5432-4b69-846d-c871c88782d0 to andre-desktop/SampleFunc
2018-07-27 22:43:18.989 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Amqp.LinkHandlers.SendingLinkHandler] - Sent message with id db986baa-5432-4b69-846d-c871c88782d0 to device andre-desktop/SampleFunc
2018-07-27 22:43:18.993 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Amqp.LinkHandlers.EventsLinkHandler] - EventsLinkHandler processed 1 messages for andre-desktop/SampleFunc
2018-07-27 22:43:18.993 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Getting next batch for endpoint iothub starting from 6 with batch size 10.
2018-07-27 22:43:18.994 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Obtained next batch for endpoint iothub with batch size 1. Next start offset = 7.
2018-07-27 22:43:18.994 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.CloudEndpoint] - Sending 1 message(s) upstream.
2018-07-27 22:43:19.002 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Device.DeviceMessageHandler] - Received feedback Complete for message db986baa-5432-4b69-846d-c871c88782d0 from device/module andre-desktop/SampleFunc
2018-07-27 22:43:19.003 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Getting next batch for endpoint andre-desktop/SampleFunc/input1 starting from 25 with batch size 10.
2018-07-27 22:43:19.003 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Obtained next batch for endpoint andre-desktop/SampleFunc/input1 with batch size 0. Next start offset = 25.
2018-07-27 22:43:19.019 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.DeviceConnectivityManager] - IotHub call succeeded
2018-07-27 22:43:19.019 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient] - Operation SendEventAsync succeeded
2018-07-27 22:43:19.019 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy] - Sending message for device andre-desktop/SampleFunc
2018-07-27 22:43:19.019 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Getting next batch for endpoint iothub starting from 7 with batch size 10.
2018-07-27 22:43:19.019 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Obtained next batch for endpoint iothub with batch size 0. Next start offset = 7.
2018-07-27 22:43:23.987 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Amqp.LinkHandlers.EventsLinkHandler] - EventsLinkHandler processed 1 messages for andre-desktop/tempSensor

Additional Information

Unable to set network as host, azure-iot-edge GA

Im working on an IoT Edge Project on a RPI3 one of my edge modules needs access to Bluez on the RPI3. In orter to access this i need the set the IoT Edge Enviroment with --net as host. (This is a very similar to this case.)

My Docker container creation option is:
"createOptions": "{
"HostConfig":{
"NetworkMode":"host"
}
}"

I've upgraded Edge to the GA release but i still get an error.

"Docker.DotNet.DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"failed to add interface veth193ef62 to sandbox: error setting interface "veth193ef62" IP to 172.18.0.5/16: cannot program address 172.18.0.5/16 in sandbox interface because it conflicts with existing route"

According to the old issue it should have been fixed in GA, so I'm not certain what i could have done wrong.

Cannot start service iotedge on computer '.'.

Followed the instructions for setting up IOT Edge runtime on my windows machine with Linux Containers from here https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-windows-with-linux

but I get the following error on starting the service:

PS C:\WINDOWS\system32> Start-Service iotedge
Start-Service : Service 'iotedge (iotedge)' cannot be started due to the following error: Cannot start service iotedge on computer '.'.
At line:1 char:1
Start-Service iotedge

Steps to Reproduce

https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-windows-with-linux

Context (Environment)

Windows 10 with Linux containers (Docker)

Device (Host) Operating System

Windows 10

Container Operating System

Linux containers

Runtime Versions

GA

Docker

Version 18.06.0-ce-win70 (19075)

PS C:\WINDOWS\system32> Start-Service iotedge
Start-Service : Service 'iotedge (iotedge)' cannot be started due to the following error: Cannot start service iotedge on computer '.'.
At line:1 char:1

  • Start-Service iotedge
  •   + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
      + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
    
    

PS C:\WINDOWS\system32> Get-Service iotedge

Status Name DisplayName


Stopped iotedge iotedge

Hardware requirements Azure IoT Edge

Hi there,

What are the minimal hardware requirements to run Azure IoT edge?
I'm not only interested in the numbers, but also in supported chipset architectures (such as ARM).

Kind regards, Norbert Huurnink

IoTEdge Device shows offline in Service SDK

I am using the RegistryManager from the Microsoft.Azure.Devices Package to get informations about the running IoT Edge Devices.
This works very well except the device status. This one is always disconnected (even if the portal shows connected).

I am not sure if this is a SDK issue or an iotedge issue.

Expected Behavior

Device instance requested by RegistryManager shows actual Connection State.

Current Behavior

Shows always Disconnected

Steps to Reproduce

RegistryManager mgr = RegistryManager.CreateFromConnectionString("");
var dev = await mgr.GetDeviceAsync("IoTEdge-0002");
Console.WriteLine(dev.ConnectionState);

Context (Environment)

Device (Host) Operating System

Windows 10

Architecture

Container Operating System

Windows

Runtime Versions

iotedged

1.0

Edge Agent

1.0

Edge Hub

1.0

Docker

18.03.1-ce

Set env variable RuntimeLogLevel to debug, no additional logging

Hi, I am trying to turn on debug level logging for the GA release. The instructions in the troubleshooting guide don't seem to make any difference to the logs produced. This is deployed to windows using linux containers.

I have set this env variable:

echo %RuntimeLogLevel%
debug

And restarted the modules / service / rebooted my machine. I still just get [INF] level logging for the edgeHub and edgeAgent modules:

[2018-07-11 14:56:28 : Starting Edge Agent
[07/11/2018 02:56:28.375 PM] Edge Agent Main()
2018-07-11 14:56:28.533 +00:00 [INF] - Starting module management agent.
2018-07-11 14:56:28.640 +00:00 [INF] - Version - 1.0.0.14487025 (52ef77db24126bf473265fc09c53d35290a2dd6b)
2018-07-11 14:56:28.641 +00:00 [INF] -
        โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•”โ•  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•
       โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
       โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•

 โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•    โ•šโ•โ•       โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•

2018-07-11 14:56:28.736 +00:00 [INF] - Edge agent attempting to connect to IoT Hub via AMQP...
2018-07-11 14:56:29.152 +00:00 [INF] - Created persistent store at /tmp/edgeAgent
2018-07-11 14:56:32.998 +00:00 [INF] - Edge agent connected to IoT Hub via AMQP.
2018-07-11 14:56:33.384 +00:00 [INF] - Module 'edgeHub' scheduled to restart after 20s (13s left).

"Fatal error generating Agent's connection string"

IoT Edge edgeAgent fails with "Fatal error generating Agent's connection string"
with this script https://docs.microsoft.com/en-us/azure/iot-edge/quickstart

System is Windows 10 Enterprise 1703 laptop

`` 
PS C:\WINDOWS\system32> Get-Service iotedge
Status   Name               DisplayName
------   ----               -----------
Running  iotedge            iotedge
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up 0 seconds     mcr.microsoft.com/azureiotedge-agent:1.0
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up 4 seconds     mcr.microsoft.com/azureiotedge-agent:1.0
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up 5 seconds     mcr.microsoft.com/azureiotedge-agent:1.0
PS C:\WINDOWS\system32> docker logs -f edgeAgent
[2018-07-03 10:17:11 : Starting Edge Agent
[07/03/2018 10:17:11.824 AM] Edge Agent Main()
2018-07-03 10:17:12.103 +00:00 [INF] - Starting module management agent.
2018-07-03 10:17:12.290 +00:00 [INF] - Version - 1.0.0.14487025             
(52ef77db24126bf473265fc09c53d35290a2dd6b)
2018-07-03 10:17:12.291 +00:00 [INF] -
    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•”โ•  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•
   โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
   โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•

 โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•    
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•    โ•šโ•โ•       โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•

2018-07-03 10:17:12.447 +00:00 [INF] - Edge agent attempting to connect to IoT Hub via AMQP...
2018-07-03 10:17:13.119 +00:00 [INF] - Created persistent store at /tmp/edgeAgent
2018-07-03 10:17:18.442 +00:00 [WRN] - Empty edge agent config was received. Attempting to read     config from backup file
(backup.json) instead
2018-07-03 10:17:18.451 +00:00 [INF] - Edge agent config backup file does not exist - backup.json
2018-07-03 10:17:28.476 +00:00 [WRN] - Empty edge agent config was received. Attempting to read config from backup file
(backup.json) instead
2018-07-03 10:17:28.476 +00:00 [INF] - Edge agent config backup file does not exist - backup.json
2018-07-03 10:17:38.482 +00:00 [WRN] - Empty edge agent config was received. Attempting to read config from backup file
(backup.json) instead
2018-07-03 10:17:38.483 +00:00 [INF] - Edge agent config backup file does not exist - backup.json
2018-07-03 10:17:42.510 +00:00 [INF] - Edge agent attempting to connect to IoT Hub via AMQP over WebSocket...
2018-07-03 10:17:43.523 +00:00 [INF] - Edge agent connected to IoT Hub via AMQP over WebSocket.
2018-07-03 10:17:44.439 +00:00 [INF] - Plan execution started for deployment 17
2018-07-03 10:17:44.466 +00:00 [INF] - Executing command: "Update and start module edgeAgent"
PS C:\WINDOWS\system32> docker logs -f edgeAgent
Error: No such container: edgeAgent
PS C:\WINDOWS\system32> docker logs -f edgeAgent
2018-07-03 10:18:02.761 +00:00 [INF] - Starting module management agent.
2018-07-03 10:18:02.938 +00:00 [INF] - Version - 1.0.0-preview022.11567621     (12a8e1bb63e619b17ca685efd470ad3f412034f4)
2018-07-03 10:18:02.939 +00:00 [INF] -
    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•”โ•  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•
   โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
   โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•

 โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
 โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•   โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•    โ•šโ•โ•       โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•

2018-07-03 10:18:02.958 +00:00 [FTL] - Fatal error generating Agent's connection string.
System.FormatException: Malformed Token
   at Microsoft.Azure.Devices.Client.Extensions.CommonExtensionMethods.ToDictionary(String     valuePairString, Char kvpDelimiter, Char kvpSeparator)
at Microsoft.Azure.Devices.Client.IotHubConnectionStringBuilder.Parse(String iotHubConnectionString)
at     Microsoft.Azure.Devices.Client.IotHubConnectionStringBuilder.CreateWithIAuthenticationOverride(String iotHubConnectionString, IAuthenticationMethod authenticationMethod)
at Microsoft.Azure.Devices.Edge.Agent.Service.Program.<MainAsync>d__4.MoveNext()
PS C:\WINDOWS\system32>
``

CloudProxy uses IClient that can be disposed out of its own scope

Expected Behavior

Once IClient is disposed it should try to recreate connection.

Current Behavior

Somewhere in the edgeHub IClient is disposed and this object is passed into CloudProxy. Once it is disposed edge hub is unable to receive messages from cloud.

2018-07-23 13:43:29.347 +00:00 [ERR] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy] - Error receiving message for device cmk21218-99999
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'The object has been closed and cannot be reopened.'.
at Microsoft.Azure.Devices.Client.InternalClient.<>c.b__63_2(Task1 t) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy.CloudReceiver.SetupMessageListening(IClient deviceClient) in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/CloudProxy.cs:line 239
2018-07-23 13:43:29.347 +00:00 [ERR] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy] - Error receiving message for device cmk21218-99999
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'The object has been closed and cannot be reopened.'.
at Microsoft.Azure.Devices.Client.InternalClient.<>c.b__63_2(Task1 t) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy.CloudReceiver.SetupMessageListening(IClient deviceClient) in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/CloudProxy.cs:line 239
2018-07-23 13:43:29.348 +00:00 [ERR] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy] - Error receiving message for device cmk21218-99999
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'The object has been closed and cannot be reopened.'.
at Microsoft.Azure.Devices.Client.InternalClient.<>c.b__63_2(Task1 t) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudProxy.CloudReceiver.SetupMessageListening(IClient deviceClient) in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/CloudProxy.cs:line 239

EdgeHub is flooded with logs because it ends in infinite loop

async Task SetupMessageListening(IClient deviceClient)
{
Message clientMessage = null;
try
{
while (!this.cancellationTokenSource.Token.IsCancellationRequested)
{
try
{
clientMessage = await deviceClient.ReceiveAsync(ReceiveMessageTimeout);
if (clientMessage != null)
{
Events.MessageReceived(this.cloudProxy.clientId);
IMessageConverter converter = this.cloudProxy.messageConverterProvider.Get();
IMessage message = converter.ToMessage(clientMessage);
// TODO: check if message delivery count exceeds the limit?
await this.cloudListener.ProcessMessageAsync(message);
}
}
catch (Exception e)
{
if (e is UnauthorizedException)
{
throw;
}
// continue when the client times out
// TODO: should limit the timeout?
Events.ErrorReceivingMessage(this.cloudProxy.clientId, e);
}
}
Events.ReceiverStopped(this.cloudProxy.clientId);
}
catch (Exception ex)
{
Events.TerminatingErrorReceivingMessage(this.cloudProxy.clientId, ex);
this.receiveMessageTask = Option.None();
await this.cloudProxy.HandleException(ex);
}
finally
{
clientMessage?.Dispose();
}
}

Steps to Reproduce

Edge was running for a 5 days and we observed this problem today.

Context (Environment)

Device (Host) Operating System

Ubuntu 18.04

Architecture

amd64

Container Operating System

Linux

Runtime Versions

iotedged

iotedge 1.0.0 (52ef77d)

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Client:
Version: 18.06.0-dev
API version: 1.37
Go version: go1.10.2
Git commit: daf021fe
Built: Mon Jun 25 21:07:53 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version: dev
API version: 1.37 (minimum version 1.12)
Go version: go1.10.2
Git commit: 9aac187
Built: Mon Jun 25 20:43:05 2018
OS/Arch: linux/amd64
Experimental: false

Logs

Additional Information

Variables in module.json

Expected Behavior

Variables should be substituted in both deployment.template.json and module.json

Current Behavior

I can set variables in .env that are used in deployment.template.json but these aren't populated in module.json file.

We use different environments for dev and prod and hence different container registrys as well. Currently there doesn't seem to be a way to use variables in module.json, specifically the repository value. It'd be great to use $CONTAINER_REGISTRY_SERVER in module.json as well as deployment.template.json

Similar to this, an ability for a CI system (e.g. VSTS) to set the tag version in module.json for CI/CD

e.g. module.json could look like

{
    "$schema-version": "0.0.1",
    "description": "",
    "image": {
        "repository": "$CONTAINER_REGISTRY_SERVER/myiotmodule",
        "tag": {
            "version": "$TAG_VERSION",
            "platforms": {
                "linuxx64": "./Dockerfile"
            }
        }
    },
    "language": "csharp"
}

IoTEdge Deployment template returns a bad request when deploying with Azure CLI (azure-cli-iot-ext)

az : ERROR: ErrorCode:GenericBadRequest;BadRequest

I'm getting a BadRequest error when trying to run 'az iot edge deployment create'. The error is the same for templates that were valid with the preview version, and for templates valid for the new version (I'm copying the templates from a deployment created in the portal).
The code is part of deployment scripts that haven't changed and were working perfectly until today.

Templates attached for validation with sample data.

AzureCLI version: 2.0.39
azure-cli-iot-ext version: 0.4.3

UPDATE: deployment works correctly when using azure-cli-iot-ext version: 0.5.0

cc: @ralarcon

DeploymentTemplates.zip

Debugging modules + no such container

Hi there,

I'm trying to debug my module, as I used the sample project from https://docs.microsoft.com/ms-my/azure/iot-edge/tutorial-csharp-module and simply don't get messages in my CSharpSample project.

No errors, running fine, logging that the iot hub module is loaded, and nothing...
I'm running on raspbian (Arm32v7), so I'm not sure how I can debug my modules.

When trying with Arm32v7 as well as Amd64.debug, I get the error:
Error: No such container: CSharpModule

Any suggestions?

Kind regards, Norbert

EdgeHub container fails to start due to certificate error

Expected Behavior

EdgeHub container should start successfully

Current Behavior

EdgeHub fails to start with status "Backoff" and exit code 132 displayed on Azure IoT Hub portal. Container log shows certificate related error.

Steps to Reproduce

  1. Setup an IoT device on Azure portal (IoT Hub)
  2. Push deployment file containing images for edgeagent and edgehub (edgeHub is being passed an environment variable OptimizeForPerformance = false). See Azure/iot-edge-v1#475 for the reason.
  3. Install iotedgectl
  4. setup iotedgectl by passing device connection string (obtained from the azure portal)
  5. Run iotedgectl start

Context (Environment)

Images are being pulled down successfully, device is shown as connected on Azure portal, edge agent starts successfully. But edgehub fails to start due to some certificate error.

Device (Host) Operating System

Tried on the following:

  • Raspbian stretch lite (April 2018)
  • Ubuntu 16.04

Architecture

ARM

Container Operating System

linux containers

Runtime Versions

iotedged

iotedgectl --version
iotedgectl 1.0.0rc22

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Same version on both Raspbian and Ubuntu

Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   f150324
 Built:        Wed May  9 22:24:36 2018
 OS/Arch:      linux/arm
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.05.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   f150324
  Built:        Wed May  9 22:20:37 2018
  OS/Arch:      linux/arm
  Experimental: false

Logs

log from stopped edgehub container

[2018-07-15 19:13:35 +00:00]: Starting Edge Hub
[07/15/2018 07:13:35.830 PM] Edge Hub Main()

Unhandled Exception: System.AggregateException: One or more errors occurred. (error:2006D080:BIO routines:BIO_new_file:no such file) ---> Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
   at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
   at Internal.Cryptography.Pal.CertificatePal.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
   at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
   at Microsoft.Azure.Devices.Edge.Util.CertificateHelper.GetServerCertificatesFromFile(String certPath, String certName) in /opt/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/CertificateHelper.cs:line 213
   at Microsoft.Azure.Devices.Edge.Hub.Service.Program.MainAsync(IConfigurationRoot configuration) in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 65
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.Azure.Devices.Edge.Hub.Service.Program.Main() in /opt/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/Program.cs:line 31

IoTEdge Service fails to start on Windows 10 after docker update to 18.06.0-ce

After Update to Docker 18.06.0-ce the IoTEdge service fails to start.

Expected Behavior

Start-Service iotedge should start the iotedge service.

Current Behavior

The Service fails to start

PS C:\WINDOWS\system32> start-service iotedge
start-service : Failed to start service 'iotedge (iotedge)'.

Context (Environment)

Device (Host) Operating System

Windows 10 Enterprise 1803

Architecture

amd64

Container Operating System

Windows

Runtime Versions

iotedged

iotedge 1.0.0 (52ef77db24126bf473265fc09c53d35290a2dd6b)

Edge Agent

mcr.microsoft.com/azureiotedge-agent 1.0 101f624f0ba3 4 weeks ago 441MB

Edge Hub

mcr.microsoft.com/azureiotedge-hub 1.0 061c26928cd5 4 weeks ago 454MB

Docker

PS C:\WINDOWS\system32> docker version
Client:
 Version:           18.06.0-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        0ffa825
 Built:             Wed Jul 18 19:05:28 2018
 OS/Arch:           windows/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.0-ce
  API version:      1.38 (minimum version 1.24)
  Go version:       go1.10.3
  Git commit:       0ffa825
  Built:            Wed Jul 18 19:23:19 2018
  OS/Arch:          windows/amd64
  Experimental:     false

Logs

PS C:\WINDOWS\system32> Get-WinEvent -ea SilentlyContinue `
>> -FilterHashtable @{ProviderName= "iotedged";
>>   LogName = "application"; StartTime = [datetime]::Now.AddMinutes(-5.0)} |
>> select TimeCreated, Message |
>> sort-object @{Expression="TimeCreated";Descending=$false}

TimeCreated          Message
-----------          -------
7/26/2018 7:50:24 AM info: iotedged::app -- Using config file: C:\ProgramData\iotedge\config.yaml
7/26/2018 7:50:24 AM info: iotedged::app -- Version - 1.0.0 (52ef77db24126bf473265fc09c53d35290a2dd6b)
7/26/2018 7:50:24 AM info: iotedged::app -- Starting Azure IoT Edge Security Daemon
7/26/2018 7:50:24 AM info: iotedged -- Initializing the module runtime...
7/26/2018 7:50:24 AM info: iotedged -- Using runtime network id nat
7/26/2018 7:50:24 AM info: iotedged::windows -- Starting iotedged service.
7/26/2018 7:50:24 AM info: iotedged -- Configuring C:\ProgramData\iotedge as the home directory.
7/26/2018 7:50:24 AM info: iotedged -- Finished initializing the module runtime.
7/26/2018 7:50:24 AM info: iotedged -- Finished configuring certificates.
7/26/2018 7:50:24 AM info: iotedged -- Transparent gateway certificates not found, operating in quick start mode...
7/26/2018 7:50:24 AM info: iotedged -- Configuring certificates...
7/26/2018 7:50:24 AM info: iotedged -- Initializing hsm...
7/26/2018 7:50:24 AM info: iotedged -- Finished initializing hsm.
7/26/2018 7:50:24 AM info: iotedged -- Detecting if configuration file has changed...
7/26/2018 7:50:24 AM info: iotedged -- Provisioning edge device...
7/26/2018 7:50:24 AM info: iotedged -- No change to configuration file detected.
7/26/2018 7:50:24 AM info: iotedged -- Starting management API...
7/26/2018 7:50:24 AM info: iotedged::windows -- Stopped iotedged service.
7/26/2018 7:50:24 AM info: provisioning::provisioning -- Manually provisioning device "IoTEdge-0001" in hub "iothubsunbelt.azure-devices.net"
7/26/2018 7:50:24 AM info: iotedged -- Finished provisioning edge device.
7/26/2018 7:50:24 AM error: edgelet_utils::logging -- An http error occurred.
7/26/2018 7:50:24 AM error: iotedged::windows -- Error while running service. Quitting.

CONNECT failed: RefusedNotAuthorized started happening with NO changes to device or cloud

Expected Behavior

Once working, a module should continue working if no changes are made to device or cloud configuration

Current Behavior

Device started getting "CONNECT failed: RefusedNotAuthorized" error and will not connect

Steps to Reproduce

  1. Install IOT Edge module on Raspberry Pi
  2. Wait for a couple weeks or so, YMMV
  3. Be unlucky?

Context (Environment)

Device (Host) Operating System

Architecture

arm32 on Raspberry Pi Model 3 B+

Container Operating System

Raspbian Stretch 9.4

Runtime Versions

iotedged

iotedge 1.0.0 (52ef77d)

Edge Agent

mcr.microsoft.com/azureiotedge-agent:1.0

Edge Hub

mcr.microsoft.com/azureiotedge-hub:1.0

Docker

Client:
Version: 18.06.0-dev
API version: 1.37
Go version: go1.10.2
Git commit: daf021fe
Built: Wed Jun 27 00:53:52 2018
OS/Arch: linux/arm
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version: dev
API version: 1.37 (minimum version 1.12)
Go version: go1.10.2
Git commit: 9aac187
Built: Tue Jun 26 23:27:27 2018
OS/Arch: linux/arm
Experimental: false

Logs

Actual error log:
Unhandled Exception: System.AggregateException: One or more errors occurred. (CONNECT failed: RefusedNotAuthorized) ---> Microsoft.Azure.Devices.Client.Exceptions.UnauthorizedException: CONNECT failed: RefusedNotAuthorized
at Microsoft.Azure.Devices.Client.InternalClient.<>c.b__62_2(Task t)
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at SolarEdgeModule.Logic.CloudConnection.Init() in /app/Logic/CloudConnection.cs:line 49
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at SolarEdgeModule.Logic.MainModule.Run() in /app/Logic/MainModule.cs:line 31
at SolarEdgeModule.Program.Main(String[] args) in /app/Program.cs:line 20

IoT Edge Security Manager logs:
Jul 16 16:00:03 solaredge iotedged[410]: 2018-07-16T16:00:03Z [INFO] - [work] - - - [2018-07-16 16:00:03.625322724 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:08 solaredge iotedged[410]: 2018-07-16T16:00:08Z [INFO] - [mgmt] - - - [2018-07-16 16:00:08.714453834 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:08 solaredge iotedged[410]: 2018-07-16T16:00:08Z [INFO] - [work] - - - [2018-07-16 16:00:08.721569310 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:13 solaredge iotedged[410]: 2018-07-16T16:00:13Z [INFO] - [work] - - - [2018-07-16 16:00:13.795495491 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:13 solaredge iotedged[410]: 2018-07-16T16:00:13Z [INFO] - [mgmt] - - - [2018-07-16 16:00:13.803099609 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:17 solaredge iotedged[410]: 2018-07-16T16:00:17Z [INFO] - Checking edge runtime status
Jul 16 16:00:17 solaredge iotedged[410]: 2018-07-16T16:00:17Z [INFO] - Edge runtime is running.
Jul 16 16:00:18 solaredge iotedged[410]: 2018-07-16T16:00:18Z [INFO] - [work] - - - [2018-07-16 16:00:18.874258644 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:18 solaredge iotedged[410]: 2018-07-16T16:00:18Z [INFO] - [mgmt] - - - [2018-07-16 16:00:18.877130449 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:23 solaredge iotedged[410]: 2018-07-16T16:00:23Z [INFO] - [mgmt] - - - [2018-07-16 16:00:23.943789848 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:23 solaredge iotedged[410]: 2018-07-16T16:00:23Z [INFO] - [work] - - - [2018-07-16 16:00:23.946947276 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:29 solaredge iotedged[410]: 2018-07-16T16:00:29Z [INFO] - [work] - - - [2018-07-16 16:00:29.022481431 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:29 solaredge iotedged[410]: 2018-07-16T16:00:29Z [INFO] - [mgmt] - - - [2018-07-16 16:00:29.024920843 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:34 solaredge iotedged[410]: 2018-07-16T16:00:34Z [INFO] - [work] - - - [2018-07-16 16:00:34.095728121 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:34 solaredge iotedged[410]: 2018-07-16T16:00:34Z [INFO] - [mgmt] - - - [2018-07-16 16:00:34.098554301 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:39 solaredge iotedged[410]: 2018-07-16T16:00:39Z [INFO] - [mgmt] - - - [2018-07-16 16:00:39.166353022 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:39 solaredge iotedged[410]: 2018-07-16T16:00:39Z [INFO] - [work] - - - [2018-07-16 16:00:39.174571096 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:44 solaredge iotedged[410]: 2018-07-16T16:00:44Z [INFO] - [mgmt] - - - [2018-07-16 16:00:44.237868248 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:44 solaredge iotedged[410]: 2018-07-16T16:00:44Z [INFO] - [work] - - - [2018-07-16 16:00:44.245692782 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)
Jul 16 16:00:49 solaredge iotedged[410]: 2018-07-16T16:00:49Z [INFO] - [mgmt] - - - [2018-07-16 16:00:49.313041538 UTC] "GET /modules?api-version=2018-06-28 HTTP/1.1" 200 OK 1497 "-" "-" pid(1283)
Jul 16 16:00:49 solaredge iotedged[410]: 2018-07-16T16:00:49Z [INFO] - [work] - - - [2018-07-16 16:00:49.317624791 UTC] "POST /modules/%24edgeAgent/genid/636665325156825356/encrypt?api-version=2018-06-28 HTTP/1.1" 200 OK 1417 "-" "-" pid(1283)

Additional Information

This started happening while I was on vacation without internet, so I am sure I didn't change anything
I am using the OptimizePerformance=false environment variable

Using DPS SDK together witih IoT edge

Hi there,

I want to automatically provision my IoT Edge devices, but I don't have a TPM module on my devices.
So what I want to do is to use the device provisioning SDK to gain a connectionString, which I then paste in my configuration for IoT edge.

I've tried this with X509 certificates using https://github.com/Azure/azure-iot-sdk-csharp/tree/master/provisioning/device/samples , but I can only send messages to my IoT-Hub (after my device is assigned) using this certificate and I don't get a connection string returned. How can I make this work properly so I can use IoT Edge on an "already-x509-assigned" device?

IoTEdge env fails when installed behind proxy

I have a corporate machine which is sitting behind a proxy.
I have followed the steps to install the new Windows Service for IoTEdge env.
I am using:

  • Windows 10
  • Docker for Windows (with Proxy settings)
  • Linux Containers for Docker

I am able to do docker pull and docker run, so this is working fine. I have also configured my iotedge env in the config.yaml to use the proxy but it does not seem to make a difference.
Here is a snippet of my config.yaml:

agent:
name: "edgeAgent"
type: "docker"
env: {"HTTP_PROXY": "http://username:pwd@proxyserver:8080", "HTTPS_PROXY": "http://username:pwd@proxyserver:8080"}

Here is the details of the error returned in the iotedge service logs.

iot-edge-error

Flaky test blocking checkin

Expected Behavior

AsyncEndpointExecutorTest.TestBatchTimeout Test should pass

Current Behavior

AsyncEndpointExecutorTest.TestBatchTimeout is failing intermittently on Windows

Steps to Reproduce

  1. Kickoff a build against a PR

Context (Environment)

Device (Host) Operating System

Architecture

Container Operating System

Runtime Versions

iotedged

Edge Agent

Edge Hub

Docker

Logs

Additional Information

Read serialport on Linux

Hi there,

I'm trying to read a serialport from a c# module within IoT Edge. Since Linux doesn't support System.IO.Ports yet, I tried using SerialPortStream.

When I try to list the portnames that are available with System.IO.Directory.GetFiles("/dev/");
I only get a bunch of filenames, and not ttyUSB0 (that I need), while if I just list the files in linux from command line, I do see all those files. As if I don't have access to all files from the IoT Edge module.

I also cannot open the '/dev/ttyUSB0' port within a module, but I am able to do this using the command line in linux.

Any ideas?

The GA edgeHub does not return connectionState

The EdgeHub module does not return connectionState, in VS Code, we cannot visualize the module states without it.
image

Expected Behavior

By returning the connectionState, customer can visualize edgeHub module states during development.

Current Behavior

image
Always blue because no connectionState

Steps to Reproduce

  1. Expand an active IoT Edge device in VS Code and look into the module list.

Context (Environment)

Device (Host) Operating System

All

Architecture

NA

Container Operating System

All

Runtime Versions

iotedged

Edge Agent

Edge Hub

Docker

Logs

Additional Information

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.