Linux (Debian) - IoT Edge - "dns error: failed to lookup address information: Name or service not known"

DataSciencentist2021 141 Reputation points
2021-11-18T13:35:57.133+00:00

Hi,

i just installed the latest Azure IoT Edge on my UP squared running Debian 11 (Bullseye) following the official manual (https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-single-device-linux-symmetric?view=iotedge-2020-11&tabs=azure-portal).

Unfortunately I receive several errors when checking the iotedge status ("sudo iotedge check"):

Connectivity checks (aziot-identity-service)

--------------------------------------------

× host can connect to and perform TLS handshake with iothub AMQP port - Error
Could not connect to Datenlogger-UP.azure.devices.net : could not complete TLS handshake
caused by: dns error: failed to lookup address information: Name or service not known
× host can connect to and perform TLS handshake with iothub HTTPS / WebSockets port - Error
Could not connect to Datenlogger-UP.azure.devices.net : could not complete TLS handshake
caused by: dns error: failed to lookup address information: Name or service not known
× host can connect to and perform TLS handshake with iothub MQTT port - Error
Could not connect to Datenlogger-UP.azure.devices.net : could not complete TLS handshake
caused by: dns error: failed to lookup address information: Name or service not known

‼ 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.
caused by: Could not open container engine config file /etc/docker/daemon.json
caused by: No such file or directory (os error 2)
‼ 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 - 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.
caused by: Could not open container engine config file /etc/docker/daemon.json
caused by: No such file or directory (os error 2)
× production readiness: Edge Agent's storage directory is persisted on the host filesystem - Error
Could not check current state of edgeAgent container
caused by: docker returned exit code: 1, stderr = Error: No such object: edgeAgent
× production readiness: Edge Hub's storage directory is persisted on the host filesystem - Error
Could not check current state of edgeHub container
caused by: docker returned exit code: 1, stderr = Error: No such object: edgeHub
√ Agent image is valid and can be pulled from upstream - OK

Connectivity checks

-------------------

× container on the default network can connect to upstream AMQP port - Error
Container on the default network could not connect to Datenlogger-UP.azure.devices.net:5671
caused by: docker returned exit code: 1, stderr = One or more errors occurred. (Name does not resolve)
× container on the default network can connect to upstream HTTPS / WebSockets port - Error
Container on the default network could not connect to Datenlogger-UP.azure.devices.net:443
caused by: docker returned exit code: 1, stderr = One or more errors occurred. (Name does not resolve)
× container on the default network can connect to upstream MQTT port - Error
Container on the default network could not connect to Datenlogger-UP.azure.devices.net:8883
caused by: docker returned exit code: 1, stderr = One or more errors occurred. (Name does not resolve)
× container on the IoT Edge module network can connect to upstream AMQP port - Error
Container on the azure-iot-edge network could not connect to Datenlogger-UP.azure.devices.net:5671
caused by: docker returned exit code: 1, stderr = One or more errors occurred. (Name does not resolve)
× container on the IoT Edge module network can connect to upstream HTTPS / WebSockets port - Error
Container on the azure-iot-edge network could not connect to Datenlogger-UP.azure.devices.net:443
caused by: docker returned exit code: 1, stderr = One or more errors occurred. (Name does not resolve)
× container on the IoT Edge module network can connect to upstream MQTT port - Error
Container on the azure-iot-edge network could not connect to Datenlogger-UP.azure.devices.net:8883
caused by: docker returned exit code: 1, stderr = One or more errors occurred. (Name does not resolve)
22 check(s) succeeded.
3 check(s) raised warnings.
11 check(s) raised errors.

I tried several different things to solve the problems for several hours now (e.g. disable/enable the UFW-firewall, change DNS server, set DNS server in container engine settings), but nothing helped.

I also do not understand the following warnings:

  1. "Container engine is not configured with DNS server setting, which may impact connectivity to IoT Hub."
    --> I configured the DNS server as it is shown here: https://learn.microsoft.com/en-us/azure/iot-edge/troubleshoot-common-errors?view=iotedge-2020-11.
  2. "production readiness: container engine - Warning Device is not using a production-supported container engine (moby-engine)."
    --> I double-checked: the moby-engine is installed.

Do you have any further ideas and solutions?

If you need any further information, please let me know!

Best regards

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.
543 questions
Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
599 questions
0 comments No comments
{count} votes

Accepted answer
  1. Matthijs van der Veer 4,376 Reputation points MVP
    2021-11-19T07:48:24.683+00:00

    I think you're right this looks like a DNS issue. From my experience, you can try these two things and see if it helps:

    1. Confirm this is a DNS issue:
    On the device, can you run

    curl -v https://Datenlogger-UP.azure.devices.net
    

    If this results in a curl: (6) Could not resolve host: Datenlogger-UP.azure.devices.net, you either have provided the wrong connection string, or your device can't reach the hub.
    Note: you might have included Datenlogger-UP.azure.devices.net in this question as a placeholder, but it shows up as unresolvable from my system.

    2. Double-check that you have the following entries in your /etc/hosts file

    127.0.0.1       localhost
    127.0.1.1       <YOUR HOSTNAME>
    

    The <YOUR HOSTNAME> value should match the hostname of your device (run hostname to verify)

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful