Edge runtime status

Rafael Ibanhez 0 Reputation points
2023-03-09T16:54:28.9066667+00:00

I'm following the setup exercise:

https://learn.microsoft.com/en-us/training/modules/deploy-prebuilt-module-edge-device/4-exercise-setup-communication

After creation of Iot Hub, VM and deployed a device, noticed that iotedge.service was not installed.

Ran command sudo install to install the service but it did not came up ok right from the box, it seems like it needs to be configured but I don't know hot to do that.

Error log below.

azureuser@vm-locazf6yzbdxs:~$ sudo iotedge check
Configuration checks
--------------------
√ config.yaml is well-formed - OK
× config.yaml has well-formed connection string - Error
    Invalid connection string format detected.
    Please check the value of the provisioning.device_connection_string parameter.
√ container engine is installed and functional - OK
√ config.yaml has correct hostname - OK
× config.yaml has correct URIs for daemon mgmt endpoint - Error
    SocketError - SocketErrorCode (ConnectionRefused) : Connection refused /var/run/iotedge/mgmt.sock
    One or more errors occurred. (Got bad response: )
√ latest security daemon - OK
√ host time is close to real time - OK
√ container time is close to host time - OK
‼ DNS server - Warning
    Container engine is not configured with DNS server setting, which may impact connectivity to IoT Hub.
    Please see https://aka.ms/iotedge-prod-checklist-dns for best practices.
    You can ignore this warning if you are setting DNS server per module in the Edge deployment.
‼ production readiness: certificates - Warning
    The Edge device is using self-signed automatically-generated development certificates.
    They will expire in 89 days (at 2023-06-07 15:28:23 UTC) causing module-to-module and downstream device communication to fail on an active deployment.
    After the certs have expired, restarting the IoT Edge daemon will trigger it to generate new development certs.
    Please consider using production certificates instead. See https://aka.ms/iotedge-prod-checklist-certs for best practices.
‼ production readiness: logs policy - Warning
    Container engine is not configured to rotate module logs which may cause it run out of disk space.
    Please see https://aka.ms/iotedge-prod-checklist-logs for best practices.
    You can ignore this warning if you are setting log policy per module in the Edge deployment.
× production readiness: Edge Agent's storage directory is persisted on the host filesystem - Error
    Could not check current state of edgeAgent container
× production readiness: Edge Hub's storage directory is persisted on the host filesystem - Error
    Could not check current state of edgeHub container

Connectivity checks
-------------------

6 check(s) succeeded.
3 check(s) raised warnings. Re-run with --verbose for more details.
4 check(s) raised errors. Re-run with --verbose for more details.
9 check(s) were skipped due to errors from other checks. Re-run with --verbose for more details.
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
561 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,261 Reputation points
    2023-03-09T19:06:50.69+00:00

    Hello @Rafael Ibanhez,

    Thanks for reaching out on this forum,

    We will help you on this issue!

    It looks like there are several configuration issues with your Azure IoT Edge device based on the output of the iotedge check command.

    So I can think of below troubleshooting steps as an initial help on this issue!

    • Check the value of the device_connection_string parameter in the config.yaml file and make sure it is properly formatted.

    Retrieve the connection string

    • Check the URIs for the daemon management endpoint in the config.yaml file and ensure they are correct.
    • To get more details about the warnings and errors, you can re-run the iotedge check command with the --verbose flag.
    • Check the config.yml file for any format issues

    Here's an example config.yaml file with a properly formatted connection string:

    provisioning:
      source: "manual"
      device_connection_string: "HostName=myiothub.azure-devices.net;DeviceId=mydevice;SharedAccessKey=mykey"
    
    agent:
      name: "edgeAgent"
      type: "docker"
      env: {}
      config:
        image: "mcr.microsoft.com/azureiotedge-agent:latest"
        auth: {}
        env: {}
        cmd: {}
        hostname: "mydevice"
        ports: {}
        volumes: {}
      status:
        frequencySecs: 60
    
    ...
    
    

    Please let us know in the below comment section if you need more help in this regard!

    0 comments No comments