相关文章推荐
大鼻子的柿子  ·  超级简历WonderCV - 知乎·  1 年前    · 
暗恋学妹的消炎药  ·  An API ...·  1 年前    · 
忐忑的围巾  ·  Power ...·  1 年前    · 

I'm using Azure Notification Hub to send Push Notifications (from an Azure web app), and am occasionally getting errors like this in my logs:

Microsoft.Azure.NotificationHubs.Messaging.MessagingException: Unexpected exception encountered TrackingId:c9d0dc7e-c98a-4f38-bfb4-cff867b0aa02,TimeStamp:2020-09-02T14:05:12.0050613Z
---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request.
---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request

I'm only sending a max of 10 messages every minute using the NotificationHubClient package from Nuget (v3.3.0). These errors only started happening within the past week, but I'm getting a couple dozen a day now. I cannot reliably reproduce the error, it only seems to happen now and then, with a different set of recipients each time. I'm using the free Notification Hub tier, so I don't have access to per-message telemetry.

Hi @MrTomHawkins ,

We apologies for the frustration on this issue. We would like to assist you further through a free support ticket. Can you please send us an email to AzCommunity[at]Microsoft[dot]com with your subscription ID and the link to this thread? We look forward to your reply.

Thanks,
Grace

Dear Grmacjon,
Please I need your support, I'm facing this issue when sending Push Notifications through Azure NotificationHub
( SendTemplateNotificationAsync )

Error :
{"Unexpected exception encountered TrackingId:9f9e81b4-c5f5-4708-9193-d6b4a73509bf,TimeStamp:2021-09-08T12:53:55.7152370Z"}d exception encountered TrackingId

Appreciate your support.
Thanks,

just to check: in free tier there is 1mln pushes limit with 500 active devices per namespace ( here ). Are you sure that didn't reach these limits?
Also what service plan your Azure web app is using? Limits may be also reached there.

Thanks for the response. I am on the B1 App Service plan. As for the Notification Hub, I'm only at 15,000 pushes for the month, and I manage Device Tokens myself, so I'm not using any of the 500 allotted devices. My Azure dashboard doesn't report any issues (at least not easily found by me), so it doesn't seem that I'm hitting any of the App Service limits. If I was, I wouldn't expect the push notifications that go out a minute later to work, but they do.

one more reason which in theory may affect sending push notifications is push notification body (payload) - is it there any correlation between notifications payloads and failures? E.g. different json format is used for some push notifications, etc?

Otherwise this error looks like transport-level problem. If you would sent push notifications from on-prem server I would think of network related issues first of all (lost connection, etc). But since push notifications are sent from Azure web app - the only thing which I may suggest is to enable monitoring for web app and check its metrics (using Metrics tab in Azure app service page in the portal). Also ticket to MS may be created.