Skip to content

Microsoft.Graph 5.75.0 graphServiceClient.Users[userId].Calendar.Events.GetAsync() throwing Microsoft.Kiota.Abstractions.ApiException: The server returned an unexpected status code and the error registered for this code failed to deserialize: 503 #3010

@mghabin

Description

@mghabin

Hello,

Details:

  • Multiple tenants affected.
  • Multiple users affected.
  • Microsoft.Graph 5.75.0
  • Method used: graphServiceClient.Users[userId].Calendar.Events.GetAsync()
  • Calls made using delegated permissions (The tenants admins consented, and service principle is living in the customer tenant with right permissions)
  • Issue started to happen in last month and we don't want this to grow.

Code used:

private readonly string defaultExpandExtendedProperties = $"singleValueExtendedProperties($filter=" +
     $"id eq '{ExtendedPropertyIds.A}'" +
     $"or id eq '{ExtendedPropertyIds.B}'" +
     $")";

var filterParts = new List<string>
{
    $"start/dateTime ge '{startUtc}'",
    $"start/dateTime lt '{endUtc}'",
    $"singleValueExtendedProperties/Any(p: p/id eq '{ExtendedPropertyIds.A}' and p/value eq '{AValue}') " +
    $"or singleValueExtendedProperties/Any(p: p/id eq '{ExtendedPropertyIds.B}' and p/value eq '{BValue}')",
};
var events = await graphServiceClient.Users[userId].Calendar.Events.GetAsync((requestConfiguration) =>
{
    requestConfiguration.Headers.Add("Prefer", $"outlook.timezone=\"{timeZone}\"");
    requestConfiguration.QueryParameters.Expand = [this.defaultExpandExtendedProperties];
    requestConfiguration.QueryParameters.Top = 50;
    requestConfiguration.QueryParameters.Filter = string.Join(" and ", filterParts);
    requestConfiguration.QueryParameters.Select = ["id", "subject", "body", "bodyPreview", "start", "end", "organizer", "attendees", "singleValueExtendedProperties", "recurrence", "onlineMeeting", "originalStartTimeZone", "type"];
});

Results in:

Microsoft.Kiota.Abstractions.ApiException: The server returned an unexpected status code and the error registered for this code failed to deserialize: 503    at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponseAsync(HttpResponseMessage response, Dictionary`2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken)    at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)    at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory`1 factory, Dictionary`2 errorMapping, CancellationToken cancellationToken)    at Microsoft.Graph.Users.Item.Calendar.Events.EventsRequestBuilder.GetAsync(Action`1 requestConfiguration, CancellationToken cancellationToken)   at **Reducted**

Please help us solving this as customers panics from this to grow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions