Я создал контейнер, содержащий этот образец Python script https://github.com/Azure/azure-iot-sdk-python-preview/blob/master/azure-iot-device/samples/advanced-edge-scenarios/send_message.py.
Мой Dockerfile выглядит следующим образом
FROM arm32v7/python:3
RUN pip install azure-iot-device
ADD testscript.py /
CMD [ "python", "./testscript.py" ]
Я создаю Контейнер использует Docker задач в конвейере в Azure DevOps, и я использую Raspberry с Raspbian Stretch в качестве сервера сборки.
Я установил Azure IoT Edge Runtime на другой Raspberry. При развертывании контейнера с IoT Hub на Raspberry статус будет закрыт, а в журналах будет показано следующее:
transport.connect raised error
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/azure/iot/device/common/mqtt_transport.py", line 366, in connect
rc = self._mqtt_client.connect(
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 937, in connect
return self.reconnect()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1071, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File "/usr/local/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/azure/iot/device/common/pipeline/pipeline_stages_mqtt.py", line 117, in _run_op
self.transport.connect(password=self.sas_token)
File "/usr/local/lib/python3.8/site-packages/azure/iot/device/common/mqtt_transport.py", line 387, in connect
raise exceptions.ConnectionFailedError(cause=e)
azure.iot.device.common.transport_exceptions.ConnectionFailedError: ConnectionFailedError(None) caused by gaierror(-3, 'Temporary failure in name resolution')
ConnectOperation: completing with error ConnectionFailedError(None) caused by gaierror(-3, 'Temporary failure in name resolution')
ConnectionLockStage(ConnectOperation): op failed. Unblocking queue with error: ConnectionFailedError(None) caused by gaierror(-3, 'Temporary failure in name resolution')
ConnectOperation: completing with error ConnectionFailedError(None) caused by gaierror(-3, 'Temporary failure in name resolution')
Callback completed with error ConnectionFailedError(None) caused by gaierror(-3, 'Temporary failure in name resolution')
["azure.iot.device.common.transport_exceptions.ConnectionFailedError: ConnectionFailedError(None) caused by gaierror(-3, 'Temporary failure in name resolution')\n"]
Это проблема сети?