-
Notifications
You must be signed in to change notification settings - Fork 44
Event hub client - Unauthorized access after ECONNRESET #174
Comments
@MatejSkrbis do you happen to have a small repro for this? |
This error is happening every so often. It wasn't the first time it showed. I cannot reliably reproduce it as it usually takes quite some time before it manifests. I'm also not sure what triggers it. |
I have been trying to debug the same error. It has occurred consistently after my server has been running for a while, approximately ~7 days, and then the event hub client does not reconnect and receive further messages. Package-name: azure-event-hubs Debug set to
|
Looks like the receiver whose link happens to be closed attempts to do something which results in the "UnauthorizedError" From the logs provided by both @MatejSkrbis and @imalao, I see the below sequence of events
Since this closed receiver is not cleared from the cache, I believe some further action on it causes the "UnauthorizedError". It would help to see how the receiver ended up in the closed state but not removed from the cache. @imalao Can you provide logs before the "ECONNRESET" error is thrown? That might help in seeing how the receiver ended up in the closed state but not removed from the cache. If you can provide the logs for a minute before the "UnauthorizedError" error is thrown, then that might help in seeing which action resulted in that error on the receiver. cc @amarzavery |
Here are the full logs from when my program starts to when the "ECONNRESET" error is thrown:
Thanks for your help. |
Thanks @imalao These logs show the successful creation and use of the 2 streaming receivers. But, logs for the time just before the ECONNRESET error is missing. This error happens at 00:22:41. Can you share the logs from just before that? I want to see if the 2 receivers were working fine just before the ECONNRESET error. Also, logs just before the Unauthorized error would also help. The UnauthorizedError in your logs occur at 00:37:51. Was that the first occurrence of this error after 00:22:41? If yes, then can you share the logs for 1 minute duration before this error. If not, then please share the logs for 1 minute duration before the first occurrence of this error after 00:22:41. If you are more comfortable sharing the logs via email, you can do so as well. If you want to share the entire stretch instead of the various chunks, then we would need the logs from say 00:18 to 00:37. For protecting your privacy, feel free to redact the lines with the word "SharedAccess" |
@ramya-rao-a It seems the 2 receivers were working fine just before the ECONNRESET error. Here are the logs:
|
00:37:51 was the first occurrence of the UnauthorizedError error after 00:22:41. There weren't any rhea or azure logs directly before the Unauthorized error any times I have encountered this error. I always get the "Something is busted." error, then some time (15-30 min) passes before the "Acquiring cbs lock" message, and then the Unauthorized Error occurs.
|
So there was no |
Here is an updated sequence of events:
Stack trace for the UnauthorizedError error goes all the way down to
|
As mentioned in amqp/rhea#170, is_itself_closed() can be used to determine if the link was explicitly closed rather than being implicitly closed by one of its parents. I don't fully understand the question about token expiry. I would guess from the error that it may indeed by that but the token management happens above the rhea level and I am not familiar with it. |
@ramya-rao-a There was a
|
@imalao @MatejSkrbis |
My event hub client has been running for about 4 days now with no errors! I will post if I encounter an error again but it looks good so far. Thank you @amarzavery and @ramya-rao-a! |
I just got another UnauthorizedError 2 days ago on version "@azure/event-hubs": "1.0.8". This time I did not have debug enabled as code runs on remote machine and only error was recorded. |
Sorry about that @MatejSkrbis Can you enable debugging and share the logs the next time this happens? |
I will try to catch it, but it can take quite some time as it is not so frequent event. |
It just happened on our server again.
|
@MatejSkrbis I am closing this issue as this was majorly related to the SDK not trying to reconnect after a ECONNRESET. For the latest problem that you have, even though it says the same "Unauthorized error", I have created a new issue #186. Lets continue there. |
After running event hub client for some days locally (with almost no load) I received UnauthorizedError on every partition I was listening to. After that event, client stopped listening and no further messages were received.
Package-name: azure-event-hubs
Package-version: 1.0.7
node.js version: 8.9.4
OS name: Windows 10
I had debug set to
azure:event-hubs:error,azure-amqp-common:error,rhea-promise:error,rhea:events,rhea:frames,rhea:io,rhea:flow
This is part of the output just before Unauthorized access was thrown.
The text was updated successfully, but these errors were encountered: