Help understanding failed shadowUpdate and shadowGet requests
istranic opened this issue · 4 comments
I'm running code where I make a variety of shadowUpdate and shadowGet requests from a python scrips on a raspberry Pi, and I don't want to have OfflinePublishQueueing. Therefore, I use try/except logic around each request such that if a request fails, I pause for a few seconds and try again until it works.
Approximately 30-50% of the time, the requests fail and I get a "Offline request queue has been disabled" exception. It's very intermittent and random, and there appears to be no issue with my internet connection. Is this normal?
I'm wondering if there's anything about my pipeline that makes it prone to these errors. I'm not sure where to look to diagnose this problem, so any & all guidance is highly appreciated.
Hi @istranic ,
So, the exception is kind of expected when the offline request queue is disabled, and you can safely ignore it.
The problem is how frequent this happens, this makes me think you're constantly disconnecting and reconnecting and the most common cause of these constant disconnects, besides bad internet connection, is trying to connect 2 clients with the same client-id, in which case they'd be kicking each other out and reconnecting, can you check that's not the case for you?
I'd also recommend referring to this issue, it may not really the exact same problem but there's a lot of info there that might help you out.
Let me know how it goes and if you need more specific help, trace logs and/or sample code to reproduce the issue would help.
@KaibaLopez I see. Thanks a lot for the tips. Do I need to have different client-ids for all of my IOT clients (including those that are running on different devices), or do the client ids need to be different only for the clients that are running on the same device?
On a separate note, do I need to worry about running myAWSIoTMQTTClient.disconnect() at the end of all all of my sessions, or is it acceptable to terminate a script using Ctrl+C without necessarily running myAWSIoTMQTTClient.disconnect()?
Hmm, I'm pretty sure the client-ids have to be unique to a client broker. meaning that anybody subscribing to a certain topic has to have a unique client-id. So yea, unique client-id even on different devices.
And no need to worry about disconnect, there is no real cleanup being done, so simply Ctrl+C should be fine.
@KaibaLopez Thanks for the clarification.