WebSocket connection to 'wss://a85xxxxxxxx.iot.us-west-1.amazonaws.com/mqtt?....' failed
See original GitHub issueHello All,
I am facing some weird issues when the reconnection workflow is executed.
“aws-iot-device-sdk”: “^2.2.1”,
MQTT connection successfully established with AWS IoT.
When UI is idle it starts to reconnect workflow.
But unfortunately, it didn’t get succeed and continuously retry after some time.
I can not find any reason for such behavior from error.
When I searched for a similar issue I can see for others it shows errors like handshake failure etc.

My connection configuration looks like(Angular 6):
var awsIot = require('aws-iot-device-sdk'); this.iotDevice = new awsIot.device({ host: <Endpoint>, clientId: <clientId>, accessKeyId:<accessKeyId>, secretKey: <secretAccessKey>, sessionToken: <sessionToken>, protocol: 'wss', baseReconnectTimeMs: 1000, debug: false });
Thanks in advance.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)

Top Related StackOverflow Question
@harshkoralwala glad you where able to fix your problem!
@heyralfs hopefully your problem was solved, but if it wasn’t please open a new ticket detailing your specific problem.
@jmklix @heyralfs
The issue was with local storage. My application was clearing all local storage data on some activity. So it looks like for the re-connect scenario, the module needs some stored data from local storage. After not removing local storage data, the Same issue was not found.
Hope this helps