Iotedge: Update `iotedge check`'s Moby check for new Moby version scheme

Created on 27 Jul 2020  ยท  10Comments  ยท  Source: Azure/iotedge

Expected Behavior

I have installed IoT Edge Runtime as per these instructions and it seem to run fine. Checking for production readiness with sudo iotedge check I get a warning that I'm not using moby-engine, although I did everything the instructions said.

Current Behavior

I get the following warning:

โ€ผ production readiness: container engine - Warning
    Device is not using a production-supported container engine (moby-engine).
    Please see https://aka.ms/iotedge-prod-checklist-moby for details.

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. Install IoT Edge using the official instructions
  2. Run sudio iotedge check

Context (Environment)

Output of iotedge check


Click here


โˆš config.yaml is well-formed - OK
โˆš config.yaml has well-formed connection string - OK
โˆš container engine is installed and functional - OK
โ€ผ config.yaml has correct hostname - Warning
    config.yaml has hostname 8P0WN42 which does not comply with RFC 1035.

    - Hostname must be between 1 and 255 octets inclusive.
    - Each label in the hostname (component separated by ".") must be between 1 and 63 octets inclusive.
    - Each label must start with an ASCII alphabet character (a-z, A-Z), end with an ASCII alphanumeric character (a-z, A-Z, 0-9), and must contain only ASCII alphanumeric characters or hyphens (a-z, A-Z, 0-9, "-").

    Not complying with RFC 1035 may cause errors during the TLS handshake with modules and downstream devices.
โˆš config.yaml has correct URIs for daemon mgmt endpoint - OK
โˆš 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 86 days (at 2020-10-22 08:18:45 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: container engine - Warning
    Device is not using a production-supported container engine (moby-engine).
    Please see https://aka.ms/iotedge-prod-checklist-moby for details.
โˆš production readiness: logs policy - OK
โ€ผ production readiness: Edge Agent's storage directory is persisted on the host filesystem - Warning
    The edgeAgent module is not configured to persist its /tmp/edgeAgent directory on the host filesystem.
    Data might be lost if the module is deleted or updated.
    Please see https://aka.ms/iotedge-storage-host for best practices.
โˆš production readiness: Edge Hub's storage directory is persisted on the host filesystem - OK

Connectivity checks
-------------------
โˆš host can connect to and perform TLS handshake with IoT Hub AMQP port - OK
โˆš host can connect to and perform TLS handshake with IoT Hub HTTPS / WebSockets port - OK
โˆš host can connect to and perform TLS handshake with IoT Hub MQTT port - OK
โˆš container on the default network can connect to IoT Hub AMQP port - OK
โˆš container on the default network can connect to IoT Hub HTTPS / WebSockets port - OK
โˆš container on the default network can connect to IoT Hub MQTT port - OK
โˆš container on the IoT Edge module network can connect to IoT Hub AMQP port - OK
โˆš container on the IoT Edge module network can connect to IoT Hub HTTPS / WebSockets port - OK
โˆš container on the IoT Edge module network can connect to IoT Hub MQTT port - OK

18 check(s) succeeded.
5 check(s) raised warnings. Re-run with --verbose for more details.

Device Information

  • Host OS [e.g. Ubuntu 16.04, Ubuntu 18.04, Windows IoT Core]: Ubuntu 18.04
  • Architecture [e.g. amd64, arm32, arm64]: amd64
  • Container OS [e.g. Linux containers, Windows containers]: ?

Runtime Versions

  • iotedged [run iotedge version]: 1.0.9.4
  • Edge Agent [image tag (e.g. 1.0.0)]: 1.0.0
  • Edge Hub [image tag (e.g. 1.0.0)]: 1.0.0
  • Docker/Moby [run docker version]: 19.03.12+azure

Note: when using Windows containers on Windows, run docker -H npipe:////./pipe/iotedge_moby_engine version instead

Logs


iotedged logs


<Paste here between the triple backticks>


edge-agent logs


<Paste here between the triple backticks>


edge-hub logs


<Paste here between the triple backticks>

Additional Information

Please provide any additional information that may be helpful in understanding the issue.

diagnostics bug customer-reported iotedge

All 10 comments

Thanks for reporting this issue! I will look into why this error occurs and get back to you.

This message will get logged if moby_runtime_uri != "npipe://./pipe/iotedge_moby_engine". Did you have docker installed on the edge device before this iotedge installation?

Turns out there was a configuration mistake in config.yaml. We used the one from GitHub and set up certificate paths but the iotedge installer seems to make quite a few changes to the original file that we didn't account for.

Actually, I'm still seeing this warning after a complete reinstall.

I just doublechecked ,the uri in config.yaml (as created by the installer) is

moby_runtime:
  uri: "unix:///var/run/docker.sock"

shouldn't the installer have set this correctly already?

@and-rewsmith FYI, that point only makes sense for Windows. OP is on Linux. The Moby detection for Linux is just based on the version number the server reports. (>= 10 => docker, otherwise moby).


@ThomasPe That setting is correct. Why do you think it is incorrect? Moby engine does listen on /var/run/docker.sock, so the URI should indeed be unix:///var/run/docker.sock.

Regarding the warning, confirm that you actually did install moby-engine and not docker. If you're sure you installed moby-engine, run iotedge check with the --output JSON parameter and paste the output here.

Adding @cpuguy83

Azure moby-engine recently changed naming to align with docker-ce releases, so we might need to update our logic to tell it apart from docker-ce. https://packages.microsoft.com/ubuntu/18.04/multiarch/prod/pool/main/m/moby-engine/

Note that azure versions have a "+azure" suffix

Indeed.

$ apt update -y && apt install -y curl gpg && curl -Lo /etc/apt/sources.list.d/microsoft.list 'https://packages.microsoft.com/config/ubuntu/18.04/multiarch/prod.list' && curl -L 'https://packages.microsoft.com/keys/microsoft.asc' | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && apt update -y && apt install -y moby-engine

...

$ dockerd --version
Docker version 19.03.12+azure, build 9dc6525e6118a25fab2be322d1914740ea842495

Yes, I'm sure I installed moby on a clean Ubuntu. I take it you don't need anything else from me, here's the output just in case though:

{"additional_info":{"docker_version":"19.03.12+azure","iotedged_version":"1.0.9.4","now":"2020-08-03T12:04:52.654305992Z","os":{"id":"ubuntu","version_id":"18.04","arch":"x86_64","bitness":64},"system_info":{"used_ram":"550.38 MiB","total_ram":"1.82 GiB","used_swap":"0.00 B","total_swap":"1024.00 MiB","disks":[{"name":"mmcblk0p4","percent_free":"74.5%","available_space":"18.98 GiB","total_space":"25.46 GiB","file_system":"ext4","file_type":"Unknown(-1)"},{"name":"mmcblk0p2","percent_free":"98.8%","available_space":"504.90 MiB","total_space":"510.98 MiB","file_system":"vfat","file_type":"Unknown(-1)"}]}},"checks":{"certificates-quickstart":{"result":{"result":"ok"},"additional_info":{"certificate_info":null,"device_ca_cert_path":"/etc/iotedge/certificates/iot-edge-device-EdgeGateway-full-chain.cert.pem"}},"config-yaml-well-formed":{"result":{"result":"ok"},"additional_info":{}},"connect-management-uri":{"result":{"result":"ok"},"additional_info":{"connect_management_uri":"unix:///var/run/iotedge/mgmt.sock","listen_management_uri":"fd://iotedge.mgmt.socket/"}},"connection-string":{"result":{"result":"ok"},"additional_info":{"device_id":null,"iothub_hostname":"the-hostname.azure-devices.net"}},"container-connect-iothub-amqp":{"result":{"result":"ok"},"additional_info":{"diagnostics_image_name":"mcr.microsoft.com/azureiotedge-diagnostics:1.0.9.4","iothub_hostname":"the-hostmane.azure-devices.net","network_name":"azure-iot-edge","port_number":5671}},"container-connect-iothub-https":{"result":{"result":"ok"},"additional_info":{"diagnostics_image_name":"mcr.microsoft.com/azureiotedge-diagnostics:1.0.9.4","iothub_hostname":"the-hostname.azure-devices.net","network_name":"azure-iot-edge","port_number":443}},"container-connect-iothub-mqtt":{"result":{"result":"ok"},"additional_info":{"diagnostics_image_name":"mcr.microsoft.com/azureiotedge-diagnostics:1.0.9.4","iothub_hostname":"the-hostname.azure-devices.net","network_name":"azure-iot-edge","port_number":8883}},"container-default-connect-iothub-amqp":{"result":{"result":"ok"},"additional_info":{"diagnostics_image_name":"mcr.microsoft.com/azureiotedge-diagnostics:1.0.9.4","iothub_hostname":"the-hostname.azure-devices.net","network_name":"azure-iot-edge","port_number":5671}},"container-default-connect-iothub-https":{"result":{"result":"ok"},"additional_info":{"diagnostics_image_name":"mcr.microsoft.com/azureiotedge-diagnostics:1.0.9.4","iothub_hostname":"the-hostname.azure-devices.net","network_name":"azure-iot-edge","port_number":443}},"container-default-connect-iothub-mqtt":{"result":{"result":"ok"},"additional_info":{"diagnostics_image_name":"mcr.microsoft.com/azureiotedge-diagnostics:1.0.9.4","iothub_hostname":"the-hostname.azure-devices.net","network_name":"azure-iot-edge","port_number":8883}},"container-engine-dns":{"result":{"result":"warning","details":["Container engine is not configured with DNS server setting, which may impact connectivity to IoT Hub.\nPlease see https://aka.ms/iotedge-prod-checklist-dns for best practices.\nYou can ignore this warning if you are setting DNS server per module in the Edge deployment."]},"additional_info":{"container_engine_config_path":"/etc/docker/daemon.json","dns":null}},"container-engine-ipv6":{"result":{"result":"ignored"},"additional_info":{"actual_use_ipv6":null,"expected_use_ipv6":false}},"container-engine-is-moby":{"result":{"result":"warning","details":["Device is not using a production-supported container engine (moby-engine).\nPlease see https://aka.ms/iotedge-prod-checklist-moby for details."]},"additional_info":{"docker_server_version":"19.03.12+azure","moby_runtime_uri":null}},"container-engine-logrotate":{"result":{"result":"ok"},"additional_info":{"daemon_config":{"log-driver":"json-file","log-opts":{"max-file":"3","max-size":"10m"}}}},"container-engine-uri":{"result":{"result":"ok"},"additional_info":{"docker_host_arg":"unix:///var/run/docker.sock","docker_server_version":"19.03.12+azure"}},"container-local-time":{"result":{"result":"ok"},"additional_info":{"actual_duration":{"nanos":0,"secs":1596456298},"diff":1,"expected_duration":{"nanos":405938782,"secs":1596456296}}},"edge-agent-storage-mounted-from-host":{"result":{"result":"warning","details":["The edgeAgent module is not configured to persist its /tmp/edgeAgent directory on the host filesystem.\nData might be lost if the module is deleted or updated.\nPlease see https://aka.ms/iotedge-storage-host for best practices."]},"additional_info":{"container_directories":["/var/run/iotedge/mgmt.sock","/var/run/iotedge/workload.sock"],"storage_directory":"/tmp/edgeAgent"}},"edge-hub-storage-mounted-from-host":{"result":{"result":"ok"},"additional_info":{"container_directories":["/iotedge/storage","/var/run/iotedge/workload.sock"],"storage_directory":"/iotedge/storage/edgeHub"}},"host-connect-dps-endpoint":{"result":{"result":"ignored"},"additional_info":{"dps_endpoint":null,"dps_hostname":null}},"host-connect-iothub-amqp":{"result":{"result":"ok"},"additional_info":{"iothub_hostname":"the-hostname.azure-devices.net","port_number":5671}},"host-connect-iothub-https":{"result":{"result":"ok"},"additional_info":{"iothub_hostname":"the-hostname.azure-devices.net","port_number":443}},"host-connect-iothub-mqtt":{"result":{"result":"ok"},"additional_info":{"iothub_hostname":"the-hostname.azure-devices.net","port_number":8883}},"host-local-time":{"result":{"result":"ok"},"additional_info":{"offset":0}},"hostname":{"result":{"result":"warning","details":["config.yaml has hostname 8P0WN42 which does not comply with RFC 1035.\n\n- Hostname must be between 1 and 255 octets inclusive.\n- Each label in the hostname (component separated by \".\") must be between 1 and 63 octets inclusive.\n- Each label must start with an ASCII alphabet character (a-z, A-Z), end with an ASCII alphanumeric character (a-z, A-Z, 0-9), and must contain only ASCII alphanumeric characters or hyphens (a-z, A-Z, 0-9, \"-\").\n\nNot complying with RFC 1035 may cause errors during the TLS handshake with modules and downstream devices."]},"additional_info":{"config_hostname":"8P0WN42","machine_hostname":"8P0WN42"}},"identity-certificate-expiry":{"result":{"result":"ignored"},"additional_info":{"certificate_info":null,"provisioning_mode":"manual"}},"iotedged-version":{"result":{"result":"ok"},"additional_info":{"actual_version":"1.0.9.4","expected_version":"1.0.9.4"}},"windows-host-version":{"result":{"result":"ignored"},"additional_info":{"moby_runtime_uri":null}}}}

Yes, "docker_version":"19.03.12+azure" confirms what veyalla and cpuguy83 said above.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pierrickcurt picture pierrickcurt  ยท  4Comments

rajatkumarsarma picture rajatkumarsarma  ยท  4Comments

asergaz picture asergaz  ยท  4Comments

lakshmisivareddy picture lakshmisivareddy  ยท  3Comments

alaendle picture alaendle  ยท  4Comments