Graph change notification for Teams presence returns 500 InternalServerError

Jan Granqvist 1 Reputation point
2021-03-11T16:14:23.083+00:00

Hi all.

Have an app(C#) that subscribes on presence data through the graph API towards Teams.
Noticed today that the app receives 500 InternalServerError when re-subscribing for events.

Status Code: InternalServerError
Microsoft.Graph.ServiceException: Code: ExtensionError
Message: Operation: Create; Exception: [Status Code: InternalServerError; Reason: Subscription failed for some users. Remove the failing users and retry. (e7c5bd5e-494e-469d-850d-b7c8c03545a5)]
Inner error:
    AdditionalData:
    date: 2021-03-11T14:23:27
    request-id: c1806b30-afa5-4b1b-ab00-2c49b75935fd
    client-request-id: c1806b30-afa5-4b1b-ab00-2c49b75935fd
ClientRequestId: c1806b30-afa5-4b1b-ab00-2c49b75935fd

However, the user in question is still within the AD, but the account has been disabled.
Is this an error message to be expected?
If so, are we talking string comparison here to understand the problem at hand?

TIA
/Janne

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,644 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,866 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Jan Granqvist 1 Reputation point
    2021-03-12T08:52:39.473+00:00

    Yes, I'm trying to re-subscribe with the same list of user-ids, that has not changed.
    The re-subscription have been working for months with this list.
    At new years-eve, one of the user's account((e7c5bd5e-494e-469d-850d-b7c8c03545a5)), part of the list got disabled.

    However, the re-subscription still worked until last week when the response was 500 InternalServerError.

    Apparently there ia a grace period within azure AD on user accounts and therefore the error response got sort of "delayed".


  2. Jan Granqvist 1 Reputation point
    2021-04-07T09:08:14.38+00:00

    Sorry for my late reply.

    Yes, I've looked into the sample, but the problem is not related to the actual subscribe or re-subscribe.

    I noticed that the problem also exists in the initial subscription when trying to include a user with a disabled account.
    If I exclude the user with the disabled account on subscribe/re-subscribe there is no issue,


  3. Jan Granqvist 1 Reputation point
    2021-04-13T06:51:13.627+00:00

    I'm talking about the property 'Microsoft.Graph.User.AccountEnabled' from 'GET https://graph.microsoft.com/v1.0/users', where in this instance was set to false for the user in question ,which is a consequence that an administrator disabled the account from the azure portal.


  4. Rostovskiy, Nikita 6 Reputation points
    2021-12-22T13:53:30.497+00:00
    1. I see some ID in the end of the error message: "... Remove the failing users and retry. (e7c5bd5e-494e-469d-850d-b7c8c03545a5)]". The ID in brackets is ID of a user that causes the error when you try to refresh subscription. I had the same problem on my project. The solution is to detect this particular error and parse user IDs in the bracket (yes, there can be more than one ID), and exclude them from the list.
    2. The reason why refreshing subscription is not failed for some time after user was deleted is that user data is actually removed after 1 month. I guess that's why you will not receive any errors for a long time after user was disabled.
    0 comments No comments