OfficeDev / ews-managed-api

Other
584 stars 316 forks source link

GetFolder's call is failing with "Microsoft.Exchange.WebServices.Data.ServiceResponseException: Mailbox does not exist" #219

Open rsrini83 opened 5 years ago

rsrini83 commented 5 years ago

Hi,

We use EWS managed API to retrieve all user's mailbox data, we are observing the issue for one of the tenants and it started failing with few users and gradually increased to 65 users. All users access is failing with this error (Mailbox does not exist). However, all users mailboxes are working normally. We have enabled EWS logging too and didn't find anything in the logs.

Environment: EWS Version: 2.2.0 EWS Call (which is failing): GetFolders Impersonation: Yes Authentication: Using oAuth2.0 (by using refresh token).

--Srinu

pkropachev commented 5 years ago

Do you use Office 365? Could you attach raw SOAP request/response for bad case?

rsrini83 commented 5 years ago

Yes, we use Office 365.

Right now I have SOAP response, will share the SOAP request in some time,

</s:Header>
<s:Body>
  <m:GetFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    <m:ResponseMessages>
      <m:GetFolderResponseMessage ResponseClass="Error">
        <m:MessageText>Mailbox does not exist.</m:MessageText>
        <m:ResponseCode>ErrorNonExistentMailbox</m:ResponseCode>
        <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
        <m:Folders />
      </m:GetFolderResponseMessage>
    </m:ResponseMessages>
  </m:GetFolderResponse>
</s:Body>

</s:Envelope>

rsrini83 commented 5 years ago

Here is the soap request and soap response

smtpaddress@dom.com AllProperties

9088828b-bb83-fbb7-c561-9d39f7d4a1b8: 2019-01-01 09:42:35,030 [Adam.McNamara@ipaustralia.gov.au] INFO: HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Encoding: gzip Vary: Accept-Encoding request-id: f56a1bce-36e0-4232-a610-24037238dc5b client-request-id: f9d8b7ce-f3bd-4991-ae80-365730437a08 X-CalculatedBETarget: SYAPR01MB3069.ausprd01.prod.outlook.com X-BackEndHttpStatus: 200 X-RUM-Validated: 1 x-ms-appId: ccfce3fd-78bf-44be-9564-26f3fcfcf39e x-EwsHandler: GetFolder X-BeSku: WCS5 X-DiagInfo: SYAPR01MB3069 X-BEServer: SYAPR01MB3069 X-FEServer: SYXPR01CA0137 Cache-Control: private Content-Type: text/xml; charset=utf-8 Date: Tue, 01 Jan 2019 09:42:34 GMT Set-Cookie: exchangecookie=1e0ee3de0a744a5f88e8b3ecba844308; expires=Wed, 01-Jan-2020 09:42:34 GMT; path=/; HttpOnly Server: Microsoft-IIS/10.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET

9088828b-bb83-fbb7-c561-9d39f7d4a1b8: 2019-01-01 09:42:35,046 [Adam.McNamara@ipaustralia.gov.au] INFO: <?xml version="1.0" encoding="utf-8"?>

</s:Header>
<s:Body>
  <m:GetFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    <m:ResponseMessages>
      <m:GetFolderResponseMessage ResponseClass="Error">
        <m:MessageText>Mailbox does not exist.</m:MessageText>
        <m:ResponseCode>ErrorNonExistentMailbox</m:ResponseCode>
        <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
        <m:Folders />
      </m:GetFolderResponseMessage>
    </m:ResponseMessages>
  </m:GetFolderResponse>
</s:Body>

</s:Envelope>

pkropachev commented 5 years ago

I've faced with such problem once. But in my case "Exchange Online (Plan 2)" license was unchecked for some users in product licenses. screenshot 2019-01-05 at 15 51 54 Also, in this case, users don't have access to mailboxes through OWA. screenshot 2019-01-05 at 15 54 58 This is different from your case (you've said users have access to them mailboxes). I think there is sense to contact with Microsoft Technical Support and describe your problem.