question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Network errors - bad connection to IoTHub

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
olivakarcommented, Jul 16, 2020

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.

0reactions
az-iot-builder-01commented, Sep 3, 2020

@njbuch, @SampleText2k77, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Azure IoT Hub error codes | Microsoft Learn
Understand how to fix errors reported by Azure IoT Hub. ... The device lost underlying network connectivity longer than the MQTT keep-alive, ...
Read more >
Sudden connection problems - azure iot hub - Stack Overflow
We have two Multitech Coundit gateways that have run impeccably for approx. 1 year, but suddenly can no longer connect to Azure IOT...
Read more >
Azure IoT Device Client C SDK
These include network availability and IoT hub connectivity issues, authentication failures. When the device client ceases attempting to re-connect (if the ...
Read more >
Microsoft Azure IOT Hub - Datadog Docs
Number of cloud-to-device messages rejected by the device. azure.devices_iothubs.c2d.methods.failure (count), Count of all failed direct method calls. azure.
Read more >
Microsoft Azure IoT Hub API V2.10 - Logic IO
A connection to a network that can access the IoT Hub must be established and the connection can ... Connection rejected, bad user-name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found