question

MrTomHawkins-9358 avatar image
0 Votes"
MrTomHawkins-9358 asked IslamWaheed-4837 commented

Occasional MessagingException when sending Push Notifications through Azure NotificationHub

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.

azure-webappsazure-notification-hubs
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MrTomHawkins-9358,

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

0 Votes 0 ·

Hi @MrTomHawkins-9358,

Checking to see if you are still facing this issue. Please send us an email if you're still experiencing this error.

0 Votes 0 ·

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,

0 Votes 0 ·

1 Answer

sadomovalex avatar image
0 Votes"
sadomovalex answered sadomovalex commented

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.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

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.

0 Votes 0 ·

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.

0 Votes 0 ·