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.

Example code just reconnects does not issue a usable error message

See original GitHub issue

When running the example code, I’m getting errors but the client just reconnects and doesn’t issue any useful error messages.

For example:

node node_modules/aws-iot-device-sdk/examples/device-example.js -t 1  -f certs -d 4000 -D -T paul-pi3 -H a1vfc41l04drxa.iot.us-east-1.amazonaws.com

Just fails with

attempting new mqtt connection...
offline
connection lost - will attempt reconnection in 4 seconds...
close
reconnect
connection lost - will attempt reconnection in 8 seconds...
close

When I hook up CloudWatch, I get a semi-usable error message:

2017-12-09 06:32:12.657 TRACEID:636c2ee2-3f87-58c6-f18c-4248f3190037 PRINCIPALID:4d1552d14416ab4198353b308538604794bcc3a0aa03c79050dd61d3afc20ee9 [ERROR] EVENT:MQTT Client Connect MESSAGE:Connect Status: AUTHORIZATION_ERROR

The client should be fixed to issue usable error messages. It takes more undocumented steps to hook up cloud watch, making “Hello World” scenarios much more difficult to get going.

It would be helpful if the error messages also suggested remediation steps. I have keys issued according to the IOT wizard, so I don’t know what to do next…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
paul-cipherlexcommented, Dec 11, 2017

After adding this policy, of which I could not find as an example in the documentation, the above example works:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iot:Publish",
        "iot:Connect",
        "iot:Receive",
        "iot:Subscribe",
        "iot:GetThingShadow",
        "iot:DeleteThingShadow",
        "iot:UpdateThingShadow"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}
0reactions
liuszengcommented, Dec 11, 2017

Hi @paul-cipherlex ,

I have created an internal tracker for this documentation update request. It will be included in the future releases. Thank you again for your input.

Thanks, Liusu

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does mongoDB have reconnect issues or am i doing it wrong?
First, be sure to enable auto reconnect. How to do so varies from driver to driver, but when the driver detects that an...
Read more >
ADO.NET Connection Pooling with C# Code Examples Tutorial
This tutorial describes how reusing pooled connections, instead of creating new connections, can improve .NET application performance.
Read more >
Solved: Can't Connect To This Network Error [14 Possible Fixes]
This is a step-by-step guide with screenshots to explain the top 14 methods to fix the 'Can't Connect To This Network' Error in...
Read more >
DirectAccess clients can't connect to server - Microsoft Learn
DirectAccess clients may not be able to connect to DirectAccess Server by ... Last Error Code: 0x103 Interface Status: No usable certificate ......
Read more >
Android 13: Unable to reconnect reliably to bonded peripheral
My team is experiencing the same issue. Hope to see an update on this. The HCI indicate 0x3e code for feature request LLCP...
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