azure-iot-sdk-python: Network errors - bad connection to IoTHub

Context

  • OS and version used: Raspian Buster
  • Python version: 3.5.3
  • pip version: 9.0.1
  • list of installed packages: aniso8601 (8.0.0) azure-iot-device (2.1.3) certifi (2020.4.5.2) chardet (3.0.4) click (7.1.2) dnspython (1.16.0) Flask (1.1.2) Flask-RESTful (0.3.8) idna (2.9) itsdangerous (1.1.0) janus (0.4.0) Jinja2 (2.11.2) MarkupSafe (1.1.1) numpy (1.12.1) paho-mqtt (1.5.0) pip (9.0.1) pygame (1.9.6) pymongo (3.10.1) PySocks (1.7.1) pytz (2020.1) requests (2.23.0) requests-unixsocket (0.2.0) setuptools (33.1.1) six (1.15.0) urllib3 (1.25.9) Werkzeug (1.0.1)
  • cloned repo: NA

Description of the issue

When running this python IoTEdge module, the connection to the IoTHub fails, and fills the logs with errors.

Code sample exhibiting the issue

Not sure which part of the code has the problem.

Console log of the issue

MQTTPublishOperation: completing with error ConnectionDroppedError('The client is not currently connected.',)
ConnectOperation: completing with error ConnectionDroppedError('Paho returned rc==1',)
ConnectionLockStage(ConnectOperation): op failed.  Unblocking queue with error: ConnectionDroppedError('Paho returned rc==1',)
ConnectionLockStage(ConnectOperation): failing ConnectOperation op because of error
ConnectOperation: completing with error ConnectionDroppedError('Paho returned rc==1',)
ConnectionLockStage(ConnectOperation): failing ConnectOperation op because of error
ConnectOperation: completing with error ConnectionDroppedError('Paho returned rc==1',)
ConnectionLockStage(ConnectOperation): failing ConnectOperation op because of error
ConnectOperation: completing with error ConnectionDroppedError('Paho returned rc==1',)
failed to receive on socket: [Errno 32] Broken pipe
failed to receive on socket: [Errno 32] Broken pipe
failed to receive on socket: [Errno 32] Broken pipe
failed to receive on socket: [Errno 32] Broken pipe
failed to receive on socket: [Errno 32] Broken pipe
Unexpected error in <azure.iot.device.common.pipeline.pipeline_stages_mqtt.MQTTTransportStage object at 0xb1ff5b30>._run_op() call
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/azure/iot/device/common/pipeline/pipeline_stages_base.py", line 102, in run_op
    self._run_op(op)
  File "/usr/local/lib/python3.5/dist-packages/azure/iot/device/common/pipeline/pipeline_thread.py", line 198, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/azure/iot/device/common/pipeline/pipeline_stages_mqtt.py", line 218, in _run_op
    self.transport.publish(topic=op.topic, payload=op.payload, callback=on_published)
  File "/usr/local/lib/python3.5/dist-packages/azure/iot/device/common/mqtt_transport.py", line 549, in publish
    raise _create_error_from_rc_code(rc)
azure.iot.device.common.transport_exceptions.ConnectionDroppedError: ConnectionDroppedError('The client is not currently connected.',)

MQTTPublishOperation: completing with error ConnectionDroppedError('The client is not currently connected.',)
ConnectOperation: completing with error ConnectionDroppedError('Paho returned rc==1',)
ConnectionLockStage(ConnectOperation): op failed.  Unblocking queue with error: ConnectionDroppedError('Paho returned rc==1',)
failed to receive on socket: [Errno 32] Broken pipe

AB#7495927

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

Please zip your code at this point coz it will be difficult for me to say otherwise from where it is occurring.

Direct methods mean this API receive_method_request. But the cause of the problem isolated and shown here in code snippet seems to be receive_twin_desired_properties_patch which is another API.