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.

MQTT Connection time out exception when using Cognito Credentials.

See original GitHub issue

I tried to connect to the AWS IoT MQTT with credentials fetched through a cognito identity and the following exception is received.

Connect timed out
Traceback (most recent call last):
  File "C:/Users/Software/Desktop/Test folder for Kivy/mqtt with cognito.py", line 161, in <module>
    myAWSIoTMQTTClient.connect()
  File "C:\Users\Software\Desktop\Test folder for Kivy\venv\lib\site-packages\AWSIoTPythonSDK\MQTTLib.py", line 513, in connect
    return self._mqtt_core.connect(keepAliveIntervalSecond)
  File "C:\Users\Software\Desktop\Test folder for Kivy\venv\lib\site-packages\AWSIoTPythonSDK\core\protocol\mqtt_core.py", line 199, in connect
    raise connectTimeoutException()
AWSIoTPythonSDK.exception.AWSIoTExceptions.connectTimeoutException

Process finished with exit code 1

The same code is working when a normal IAM credential is used to connect to the MQTT service. The policies attached for the Cognito identity and IAM credential are the same(AWSIoTFullAccess).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Nov 24, 2020

Greetings! It looks like this issue hasn’t been active in longer than a week. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one, also please try V2 as this might be solved there too.

0reactions
github-actions[bot]commented, Dec 2, 2020

Greetings! It looks like this issue hasn’t been active in longer than a week. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one, also please try V2 as this might be solved there too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MQTT Connection time out exception when using Cognito ...
I tried to connect to the AWS IoT MQTT with credentials fetched through a cognito identity and the following exception is received.
Read more >
Diagnosing connectivity issues - AWS IoT Core
Make sure that there is a policy attached to the certificate you are using to call AWS IoT. All publish/subscribe operations are denied...
Read more >
Consistent timeouts on AWS IoT - Stack Overflow
Turns out the issue is that you need to: have both a policy and a certificate in the console; explicitly associate them to...
Read more >
AWS iot MQTT connection timeout error
Hi guys, I have been trying to get my CY8CPROTO-062-4343W board to AWS but currently failing at the MQTT connection stage.
Read more >
class IoT. Client - Boto3 Docs 1.26.33 documentation - AWS
For information about how to use the credentials provider for IoT, ... The timeout interval can be anywhere between 1 minute and 7...
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