Closed treedust closed 6 years ago
@treedust Thanks for the feedback. We are actively investigating and will get back to you but, I did want to know if you are following a specific tutorial?
The getting started guides
is what I used until using a module (I did not encounter this during v1). I used my own modules. One is a MQTT broker, and an executor container (I know I can use IoT Edge functionality for module to module communication, this was a test that has more components to it). My install comes from https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux-arm ; however, this seems to have little information on /etc/iotedge/config.yaml
aside from editing the device_connection_string
.
Documentation that I can find are listed as follows:
settings.image – The container image that the Edge agent uses to start the module. The Edge agent must be configured with credentials for the container registry if the image is protected by a password. To configure the Edge agent, update the config.yaml file. In Linux, use the following command: sudo nano /etc/iotedge/config.yaml
tutorial-deploy-machine-learning:
disable process identification on your IoT edge device
is this a needed setting regardless of the modules that are that in use?
If the IoT Edge Security Manager is not running, verify your yaml configuration file
What am I expecting to see in the yaml configuration?
@treedust please confirm that you successfully completed the tutorial and you could successfully verify all the steps of the installation?
If you had v1 version installed previously my advisory is that you install all again from scratch. If you are trying other steps not documented on a tutorial in azure-docs the best is that we follow up with you in a support ticket from azure portal.
Thank you.
@sergaz-msft I get the same results with or with out adding custom modules from the tutorial.
sudo apt-get update && sudo apt-get upgrade -y
curl -L https://aka.ms/moby-engine-armhf-latest -o moby_engine.deb && sudo dpkg -i ./moby_engine.deb
curl -L https://aka.ms/moby-cli-armhf-latest -o moby_cli.deb && sudo dpkg -i ./moby_cli.deb
sudo apt-get install -f
curl -L https://aka.ms/libiothsm-std-linux-armhf-latest -o libiothsm-std.deb && sudo dpkg -i ./libiothsm-std.deb
curl -L https://aka.ms/iotedged-linux-armhf-latest -o iotedge.deb && sudo dpkg -i ./iotedge.deb
sudo apt-get install -f
sudo rm *.deb
sudo usermod -aG docker pi
sudo reboot
What is even more odd docker containers do not have volumes including edge and hub? I'm almost certain this isn't a support inquiry and instead a bug?
@treedust Can you share the edge daemon config.yaml and device deployment.json for your system?
From a fresh 2018-06-27-raspbian-stretch-lite image install using etcher.io
the following is run/edited on the Raspi 3 B+ for azure iot edge general access platform set up:
sudo apt-get update && sudo apt-get upgrade -y
curl -L https://aka.ms/moby-engine-armhf-latest -o moby_engine.deb && sudo dpkg -i ./moby_engine.deb
curl -L https://aka.ms/moby-cli-armhf-latest -o moby_cli.deb && sudo dpkg -i ./moby_cli.deb
sudo apt-get install -f
curl -L https://aka.ms/libiothsm-std-linux-armhf-latest -o libiothsm-std.deb && sudo dpkg -i ./libiothsm-std.deb
curl -L https://aka.ms/iotedged-linux-armhf-latest -o iotedge.deb && sudo dpkg -i ./iotedge.deb
sudo apt-get install -f
sudo rm *.deb
sudo usermod -aG docker pi
sudo reboot
###############################################################################
# IoT Edge Daemon configuration
###############################################################################
#
# This file configures the IoT Edge daemon. The daemon must be restarted to
# pick up any configuration changes.
#
# Note - this file is yaml. Learn more here: http://yaml.org/refcard.html
#
###############################################################################
###############################################################################
# Provisioning mode and settings
###############################################################################
#
# Configures the identity provisioning mode of the daemon.
#
# Supported modes:
# manual - using an iothub connection string
# dps - using dps for provisioning
#
###############################################################################
provisioning:
source: "manual"
device_connection_string: "HostName=<>.<>.net;DeviceId=<>;SharedAccessKey=<>"
# provisioning:
# source: "dps"
# global_endpoint: "https://global.azure-devices-provisioning.net"
# scope_id: "{scope_id}"
# registration_id: "{registration_id}"
###############################################################################
# Certificate settings
###############################################################################
#
# Configures the certificates required to operate the IoT Edge
# runtime as a gateway which enables external leaf devices to securely
# communicate with the Edge Hub. If not specified, the required certificates
# are auto generated for quick start scenarios which are not intended for
# production environments.
#
# Settings:
# device_ca_cert - path to the device ca certificate and its chain
# device_ca_pk - path to the device ca private key file
# trusted_ca_certs - path to a file containing all the trusted CA
# certificates required for Edge module communication
#
###############################################################################
# certificates:
# device_ca_cert: "<ADD PATH TO DEVICE CA CERTIFICATE HERE>"
# device_ca_pk: "<ADD PATH TO DEVICE CA PRIVATE KEY HERE>"
# trusted_ca_certs: "<ADD PATH TO TRUSTED CA CERTIFICATES HERE>"
###############################################################################
# Edge Agent module spec
###############################################################################
#
# Configures the initial Edge Agent module.
#
# The daemon uses this definition to bootstrap the system. The Edge Agent can
# then update itself based on the Edge Agent module definition present in the
# deployment in IoT Hub.
#
###############################################################################
agent:
name: "edgeAgent"
type: "docker"
env:
RuntimeLogLevel: debug
config:
image: "mcr.microsoft.com/azureiotedge-agent:1.0"
auth: {}
###############################################################################
# Edge device hostname
###############################################################################
#
# Configures the environment variable 'IOTEDGE_GATEWAYHOSTNAME' injected into
# modules.
#
###############################################################################
hostname: "raspberrypi"
###############################################################################
# Connect settings
###############################################################################
#
#
#Configures URIs used by clients of the management and workload APIs
# management_uri - used by the Edge Agent and 'iotedge' CLI to start,
# stop, and manage modules
# workload_uri - used by modules to retrieve tokens and certificates
#
# The following uri schemes are supported:
# http - connect over TCP
# unix - connect over Unix domain socket
#
###############################################################################
connect:
management_uri: "unix:///var/run/iotedge/mgmt.sock"
workload_uri: "unix:///var/run/iotedge/workload.sock"
###############################################################################
# Listen settings
###############################################################################
#
# Configures the listen addresses for the daemon.
# management_uri - used by the Edge Agent and 'iotedge' CLI to start,
# stop, and manage modules
# workload_uri - used by modules to retrieve tokens and certificates
#
# The following uri schemes are supported:
# http - listen over TCP
# unix - listen over Unix domain socket
# fd - listen using systemd socket activation
#
# These values can be different from the connect URIs. For instance, when
# using the fd:// scheme for systemd:
# listen address is fd://iotedge.workload,
# connect address is unix:///var/run/iotedge/workload.sock
#
###############################################################################
listen:
management_uri: "fd://iotedge.mgmt.socket"
workload_uri: "fd://iotedge.socket"
###############################################################################
# Home Directory
###############################################################################
#
# Configures the home directory for the daemon.
#
###############################################################################
homedir: "/var/lib/iotedge"
###############################################################################
# Moby Container Runtime settings
###############################################################################
#
# uri - configures the uri for the container runtime.
# network - configures the network on which the containers will be created.
#
###############################################################################
moby_runtime:
uri: "unix:///var/run/docker.sock"
# network: "azure-iot-edge"
No deployment targeting device.
hostname
outputs raspberrypi
running sudo systemctl restart iotedge
wait 5 minutes.
hub did not get downloaded nor launched as a container
docker logs edgeAgent
explains that:
2018-08-09 19:31:15.974 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Agent] - Reconcile failed because of empty configuration
Microsoft.Azure.Devices.Edge.Agent.Core.ConfigSources.ConfigEmptyException: This device has an empty configuration for the edge agent. Please set a deployment manifest.
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 159
which results in (current deployment):
{
"id": "hub-n-edge-only",
"content": {
"modulesContent": {
"$edgeAgent": {
"properties.desired": {
"schemaVersion": "1.0",
"runtime": {
"type": "docker",
"settings": {
"loggingOptions": "",
"minDockerVersion": "v1.25"
}
},
"systemModules": {
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"createOptions": "{}"
}
},
"edgeHub": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"createOptions": "{\n \"HostConfig\": {\n \"PortBindings\": {\n \"8883/tcp\": [\n {\n \"HostPort\": \"8883\"\n }\n ],\n \"443/tcp\": [\n {\n \"HostPort\": \"443\"\n }\n ],\n \"5671/tcp\": [\n {\n \"HostPort\": \"5671\"\n }\n ]\n }\n }\n}"
},
"status": "running",
"restartPolicy": "always"
}
},
"modules": {}
}
},
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.0",
"routes": {
"route": "FROM /messages/* INTO $upstream"
},
"storeAndForwardConfiguration": {
"timeToLiveSecs": 7200
}
}
}
}
},
"targetCondition": "tags.enviroment='test'",
"priority": 10,
"labels": {},
"createdTimeUtc": "2018-08-09T19:41:56.747Z",
"lastUpdatedTimeUtc": "2018-08-09T19:41:56.747Z",
"etag": null,
"metrics": {
"results": {},
"queries": {}
}
}
now:
docker logs edgeAgent
out puts
2018-08-09 19: 45: 44.370 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Response received OK
2018-08-09 19: 45: 44.377 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Uds.HttpUdsMessageHandler] - Response received OK
2018-08-09 19: 45: 44.377 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Edgelet.ModuleManagementHttpClient] - Received a valid Http response from unix: ///var/run/iotedge/mgmt.sock for List modules 2018-08-09 19: 45: 44.378 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Util.Edged.WorkloadClient] - Received a valid Http response from unix: ///var/run/iotedge/workload.sock for Encrypt 2018-08-09 19: 45: 44.387 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Agent] - Obtained edge agent config
2018-08-09 19: 45: 44.391 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Planners.HealthRestartPlanner] - List of desired modules is - {
"edgeHub": {
"status": "running",
"restartPolicy": "always",
"version": "",
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}],\"5671/tcp\":[{\"HostPort\":\"5671\"}]}}"
},
"env": {}
},
"edgeAgent": {
"version": "",
"status": "running",
"restartPolicy": "always",
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"createOptions": "{}"
},
"env": {}
}
2018-08-09 19: 45: 44.393 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Planners.HealthRestartPlanner] - List of current modules is - {
"edgeHub": {
"restartPolicy": "always",
"exitCode": 0,
"statusDescription": "running",
"lastStartTimeUtc": "2018-08-09T19:43:59.1114904+00:00",
"lastExitTimeUtc": "0001-01-01T00:00:00",
"restartCount": 0,
"lastRestartTimeUtc": "0001-01-01T00:00:00",
"runtimeStatus": "running",
"status": "running",
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.0",
"imageHash": "sha256:b5637d573d56d73ba61b2b6ecbac862dcc0f0a7754ec3097c227c05b1bfe9a1a",
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}],\"5671/tcp\":[{\"HostPort\":\"5671\"}]}}"
},
"env": {}
},
"edgeAgent": {
"exitCode": 0,
"statusDescription": "running",
"lastStartTimeUtc": "2018-08-09T19:18:09.295884+00:00",
"lastExitTimeUtc": "0001-01-01T00:00:00",
"runtimeStatus": "running",
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.0",
"imageHash": "sha256:b4496705558b8cb664ffeb4973fb96f9e8560f3fd46c06dae3bad7a61e4757c1",
"createOptions": "{}"
},
"env": {}
}
2018-08-09 19: 45: 44.396 +00: 00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Planners.HealthRestartPlanner] - HealthRestartPlanner created Plan, with 0 command(s).
repeated every few seconds
Progress so far can be seen by:
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mcr.microsoft.com/azureiotedge-hub 1.0 b5637d573d56 6 weeks ago 245MB
mcr.microsoft.com/azureiotedge-agent 1.0 b4496705558b 6 weeks ago 229MB
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d9e48a721788 mcr.microsoft.com/azureiotedge-hub:1.0 "/bin/sh -c 'echo \"$…" 7 minutes ago Up 7 minutes 0.0.0.0:443->443/tcp, 0.0.0.0:5671->5671/tcp, 0.0.0.0:8883->8883/tcp edgeHub
4969be3ebc0b mcr.microsoft.com/azureiotedge-agent:1.0 "/bin/sh -c 'echo \"$…" 33 minutes ago Up 33 minutes edgeAgent
docker volume ls
DRIVER VOLUME NAME
docker network ls
NETWORK ID NAME DRIVER SCOPE
48d40676dc8b azure-iot-edge bridge local
d63cc7ed2722 bridge bridge local
f4e98991b7d8 host host local
ba8cb002a6a3 none null local
follow https://docs.microsoft.com/en-us/azure/iot-edge/quickstart#deploy-a-module then I get the initial output at the starting post.
I followed from here but used the portal over the az command line tool. (Not a tool I would want already installed on a product for consumers that could get access to the pi)
Thanks for the details @treedust!
You are fine until step 8. From there, please follow instructions from https://docs.microsoft.com/en-us/azure/iot-edge/quickstart-linux#deploy-a-module and let me know if it works.
@veyalla it has not. It runs for a short while, followed by the initial. I can make this occur much quicker (within minutes) by editing the container create options
. Example is: "Volumes":{"/volume/name":{}}
in container create options
would create a volume a week ago in v2 but now v2 through issues related to 500 Internal Server Error
that is caused by: Container runtime error
and have no volume created.
@treedust Could you please clarify what state you are trying to achieve on the system? Few points:
You mentioned something about ML modules in a previous reply. This won't work on a Raspberry Pi as the Azure ML modules are currently only supported on Linux X64. This is documented in the article.
If you are trying to mount the a directory from the Host into the container, use the "Binds" option in the container create options:
{
"HostConfig": {
"Binds": [
"/usr/local/somedir:/usr/local/somedir"
]
}
}
In the latest reply, you mentioned the tempSensor module "runs for a short while", what is the error you are observing after a short while?
Docker volumes do not run with Azure? Only host fs binds are allowed?
I get
Reconcile failed because of the an exception
Microsoft.Azure.Devices.Edge.Agent.Edgelet.EdgeletCommunicationException- Message:Error calling List modules: Module runtime error
caused by: Container runtime error
caused by: Serde error
caused by: invalid type: sequence, expected a string at line 1 column 1137, StatusCode:500, at: 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 159
But I have just found out the it happens after losing wifi connection or after rebooting the device close to 5 minutes after the reboot.
I'm almost positive that it's because of
sudo iotedge list
outputs:
An error in the management http client occurred.
caused by: Client error
If you mean, will docker volumes work with Azure IoT Edge, they will provided the docker volumes are created before mounting them into a container.
Regarding the other issue you are facing due to restart and wifi disconnection, please post the details at https://github.com/azure/iotedge/issues where more folks from our team can take a look and advice.
@treedust let us know if you have further questions? Like @veyalla advised, the next step would be to open an issue on the iotedge repo. If there are no more issues related with this tutorial content I will proceed and close this as resolved.
Thank you!
11046 #11353
Has information similar to what is going on with my raspberry pi 3 B+ system.
The command
sudo systemctl status iotedge
give the output:sudo iotedge logs edgeAgent
has output that follows:sudo iotedge list
outputs:docker ps -a
(installed from moby) gives:Am I missing something I should be looking at? Is this behavior normal?
Thank you for your help in advance.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.