Closed czgtest closed 5 years ago
repro on : amd64 /amd64.debug Windows10:
step:
C:\Users\iotedge>docker logs SampleModulePython IoT Hub Client for Python transport.connect raised error Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/azure/iot/device/common/mqtt_transport.py", line 252, in connect rc = self._mqtt_client.connect(host=self._hostname, port=8883) File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 839, in connect return self.reconnect() File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 962, in reconnect sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0)) File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection raise err File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Known issue for Python SDK. This is because EdgeHub is not ready for connect when custom module starts and SDK will throw error in this case. Edge runtime will restart the custom module to retry.
repro on : amd64 /amd64.debug Windows10:
step:
C:\Users\iotedge>docker logs SampleModulePython IoT Hub Client for Python transport.connect raised error Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/azure/iot/device/common/mqtt_transport.py", line 252, in connect rc = self._mqtt_client.connect(host=self._hostname, port=8883) File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 839, in connect return self.reconnect() File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 962, in reconnect sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0)) File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection raise err File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception: