OfficeDev / ews-managed-api

Other
585 stars 317 forks source link

ExchangeService.FindFolders with WellKnownFolderName.PublicFoldersRoot fails #294

Open PhilbyTheGreat opened 1 year ago

PhilbyTheGreat commented 1 year ago

Starting at 12th of April around 6:16pm AEST, calling FindFolders using a WellKnownFolderName.PublicFoldersRoot fails with a "Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 1, position 1775." message. The xml body that we are sending looks like

Milliseconds obfuscated@obfuscated.com IdOnly Using fiddler to examine the response shows something like NoError *a:ErrorInternalServerErrorAn internal server error occurred. The operation failed.ErrorInternalServerErrorAn internal server error occurred. The operation failed. This obviously isn't valid xml. We haven't changed anything for this to start happening. It's been running multiple times a day for months without failure. This is surely a problem with the https://outlook.office365.com/EWS/Exchange.asmx endpoint, but I thought I'd mention it here in case anyone can help! Interestingly enough, this failed 27 times in a row and then we started seeing [this issue](https://github.com/OfficeDev/ews-managed-api/issues/293). If we swap to using a different impersonated user (using oauthcredentials), we go back to getting the "Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 1, position 1775." message. I'm not game enough to try enough times to get this user to hit the concurrency limit.
Tunrip commented 1 year ago

Yes, we've noticed exactly the same thing, including the subsequent "exceeded the available concurrent connections for your account" message after this problem has occurred enough times. This started on 6th April for us and 11th April at a client site. Tried updating our project using the EWS Managed API to the latest versions of Microsoft.Identity.Client and Microsoft.IdentityModel.Abstractions but this has made no difference.

Tunrip commented 1 year ago

It appears to read the list of folders and an error occurs on/after the last entry. When the error occurs it just whacks it in the XML in an invalid format causing the error we've identified. It looks to me like that error happens because on the server it has continued past 'EOF' - it's found the last identified folder in the list but tried to carry on doing things after that.

xpavciak commented 1 year ago

I face the same problem. Do we have a feedback from MS ?

mariusan commented 1 year ago

I face the same problem. Do we have a feedback from MS ?

One of our clients has raised a ticket with Msft but has not received a helpful reply yet.

Tunrip commented 1 year ago

Thought I'd try restricting the number of items returned by FindFolders using a FolderView with a PageSize of 1. Wondered if this would return the first item before encountering the error, but it just causes the error to occur on the first item. Also tried restricting the PropertySet to IdOnly but same problem.

joshmadams commented 1 year ago

Seeing this same error, started 4/12 around 7am EST. We have opened a ticket with MS as well.

emoreau99 commented 1 year ago

Same here. Hopefully a solution will be found!

Tunrip commented 1 year ago

I have posted about this on the Microsoft Q&A forum, as some googling suggested this may help get it spotted by the appropriate team. https://learn.microsoft.com/en-us/answers/questions/1229639/exchange-web-services-ews-findfolders-produces-a-5

RobEnverus commented 1 year ago

We are running into the same exact problem as well!!!

MarkEnverus commented 1 year ago

We have the exact same issue as well. Is anyone at MS even responding to this?

dseph commented 1 year ago

MS knows about this issue and is investigating. Look at the response in code and strip the appended html page from the response as a temporary work around while they are working on the issue.

BoudewijnPopkema commented 1 year ago

We are experiencing the same issue for the past week, trying to retrieve mails from public folders. It started with one tenant and is now also occurring on others.

mariusan commented 1 year ago

Might be the same issue: https://admin.microsoft.com/Adminportal/Home#/servicehealth/:/alerts/EX540990

dseph commented 1 year ago

They are working on a fix for issues with OWA and EWS accessing public folders. One issue is with html/xml being in the response body of an EWS call against public folder. Another is with the EWSMaxConcurrency error being thrown when it should not be. They are working to a fix pushed out. It may take one to a few days before they have the fix pushed out. Check your portals late tonight for updates. Issues with mail delivery may be a different from what's happening in this event.

PhilbyTheGreat commented 1 year ago

It looks like this started working again for us shortly after 16/04/2023 11:30PM AEST! Should I mark this as closed?

vlw007 commented 1 year ago

We also see resolution on one tenant at 15 April 1200 CST and another tenant at 16 April 1100

Tunrip commented 1 year ago

It's working for us now internally. Tried at a client site and immediately ran straight into the "Microsoft.Exchange.WebServices.Data.ServiceResponseException: You have exceeded the available concurrent connections for your account." error unfortunately! Still, the XML problem seems to be fixed at least!

Tunrip commented 1 year ago

Looked further into the client site still not working and realised this still has the original XML error. Originally at the client site it took an additional 5 days for the original problem to occur, so guess this related to how quickly the changes roll out to the various Office 365 tenants.

Tunrip commented 1 year ago

Looks like this is now fully resolved :)