OfficeDev / ews-managed-api

Other
585 stars 321 forks source link

o365 problem with finditems / (calendar)view for public folder calendar #204

Closed frombalinium closed 6 years ago

frombalinium commented 6 years ago

As of yesterday it no longer works for office 365 while on-prem exchange (any version) is fine Error: Microsoft.Exchange.WebServices.Data.ServiceError.ErrorCannotUseFolderIdForItemId or in text "Expected an item Id but received a folder Id."

this example DOES work as long as you don't restrict it

Dim View1 As New ItemView(10) View1.Traversal = ItemTraversal.Shallow Dim Result As FindItemsResults(Of Item) = exService.FindItems(fldID, View1)

this does NOT work and produces above error

Dim cv As New CalendarView(DateTime.Now.AddYears(-1), DateTime.Now.AddDays(-1)) Dim cal As CalendarFolder = CalendarFolder.Bind(exService, fldID) cv.MaxItemsReturned = 5 Dim items As FindItemsResults(Of Appointment) = cal.FindAppointments(cv)

davster commented 6 years ago

Can you paste in your fldId value? Don't worry, it doesn't contain any PII.

frombalinium commented 6 years ago

Here you are AQEuAAADGkRzkKpmEc2byACqAC/EWgMAfFCxzz7DIUiyV6RXslk1GAAAAxgAAAA=

davster commented 6 years ago

Yep - that's a public folder id. No issues there. Which line does it fail on? Is it the FindAppointments call or the CalendarFolder.Bind? Also, do you by chance have the HTTP response headers, in particular the RequestId and X-BEServer headers?

frombalinium commented 6 years ago

It binds fine. cal object has all the properties one would expect in debug mode. It fails at .FindAppointments. please note that the first example works correctly but that is not of much use when you need soemthing specific.

davster commented 6 years ago

Does this work for you against a non-public folder calendar?

frombalinium commented 6 years ago

yes that works fine. the public folder worked fine too for years until yesterday or so.

fpintos commented 6 years ago

Hi @frombalinium , do you happen to have the requestID and X-BEServer headers that @davster asked for?

I wrote a LinqPad script to query the public folders accessible to a user and show the calendar items from the first calendar folder it finds; perhaps you can run it (or a modified version) and capture the response headers with Fiddler? That might give us a repro and additional information to work with.

Get the script in this GIST and use LinqPad to run it.

frombalinium commented 6 years ago

Sorry that I missed that part of Dave's request. Actually I was able to file a support request today and the engineer (Pedro) looked at the EWS server logs today using my trace. He said that on monday he was able to proceed with the team. If you are able to look at it already that would be great. This is just a restricted finditem call. This also fails. It's not just with appointment type items. Looks like anything you restrict will produce the problem. Also it fails for multiple o365 clients (and for no on-prem users). I would expect your script to fail as well. Here is the trace. Would that be enough for you right now? 29-8-2018 21:03:09 : EwsRequestHttpHeaders --- POST /EWS/Exchange.asmx HTTP/1.1 Content-Type: text/xml; charset=utf-8 Accept: text/xml User-Agent: ExchangeServicesClient/15.00.0913.015 Accept-Encoding: gzip,deflate X-AnchorMailbox: removed@removed.com X-PreferServerAffinity: True X-PublicFolderMailbox: removed@removed.onmicrosoft.com

29-8-2018 21:03:09 : EwsRequest --- <?xml version="1.0" encoding="utf-8"?>

removed@removed.com IdOnly 29-8-2018 21:03:09 : EwsResponseHttpHeaders --- HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Encoding: gzip Vary: Accept-Encoding request-id: c152cf90-8e0e-4255-af79-d145311250eb X-CalculatedFETarget: DM5PR0401CU002.internal.outlook.com X-BackEndHttpStatus: 200,200 X-FEProxyInfo: DM5PR0401CA0053.NAMPRD04.PROD.OUTLOOK.COM X-CalculatedBETarget: DM5PR03MB2796.namprd03.prod.outlook.com X-RUM-Validated: 1 x-EwsHandler: FindItem X-BeSku: Gen9 X-DiagInfo: DM5PR03MB2796 X-BEServer: DM5PR03MB2796 X-FEServer: DM5PR0401CA0053,AM6PR0402CA0035 Cache-Control: private Content-Type: text/xml; charset=utf-8 Date: Wed, 29 Aug 2018 19:03:06 GMT Set-Cookie: exchangecookie=eab33aaab4b04040800eb7e6a6d02416; path=/ Server: Microsoft-IIS/10.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET 29-8-2018 21:03:09 : EwsResponse --- Expected an item Id but received a folder Id. ErrorCannotUseFolderIdForItemId 0
frombalinium commented 6 years ago

I tried the script @fpintos but it uses oauth so connects me to my personal account that I have not set up. Instead I ran the above {cal.FindAppointments(cv) } code and cached it with fiddler for you if it is of any help. It does essentialy the same as your script.

POST /EWS/Exchange.asmx HTTP/1.1 Content-Type: text/xml; charset=utf-8 Accept: text/xml User-Agent: ExchangeServicesClient/15.00.0913.015 Accept-Encoding: gzip,deflate X-AnchorMailbox: removed@Client.com X-PreferServerAffinity: True X-PublicFolderMailbox: removed_75a66972@removed.onmicrosoft.com X-ClientStatistics: MessageId=b7cc2545-7cf1-45f3-9ef7-641a3d31fe11,ResponseTime=374,SoapAction=GetFolder; Authorization: Basic R0NhZG1pbkBDcmFuZWwuY29tOkdyb3VwQ2FsISEh Host: outlook.office365.com Cookie: EXOBasicAuth=compactTicket=t%3dEwAIA9P5AwAUv0lYxoez7x2t6RowHa2liVeLW%2fwAATNF%2frMCmst9eaqwXDf6cg5hU9lwDFyeenTFCokkDZGoEwAOpfNfyV7roeakrZvI6vN1UmalRzzEpF0jfKPFw%2b9qmGYwo2inSOodw2G%2fVKJ6qJKapWp60agp25lmCKxpZKdPM8F4sdEoGCF%2f%2bHjIhV36VFFLdcXXZlS81x78CDifrXa4yZCw3DqQnVpn%2b9cc0qUCBgXjeRwMtsfGuJu%2fgU3PrfRGNb3svpGo2SxFdnTKAmumkSUsjku4byd3DZtWSbeQ0%2fMb%2fap%2bQZse3BTIkMgDdMbzeWAQuh8pwDxffJvbgqb9Zgrk5Ei6d4XwyG7a1NFZaSbz0b8SkZLUZ9Hui0wDZgAACKL8MZDmo%2bQq2AGg5erDWhQCci0CQfbScRuNHiaPlY90oTTHxXgqA8OUSFdFXnYK%2fsb7ZMg33ICcm1vqlvjPyAinAmCQNOoXy%2fouwSPz93adapwF0c%2bMhdll2xn03KZBHMIPm17cImraOL8jnjVzTauvcxW%2fQCXTnTal1rmjITvGo3gJLV1vDVZh50XCDi4e4pCpSSa4zXurvMbnfLHCbjzKAMiO4X1FHKdu%2fQb4Yydu0iDIMalARkmzRW9ByIZdumsySq0BQ%2bj%2feaEaMn6EV46XZ32LPcww2a4YD%2fFTR%2bl4zOeuDmj5RpSTrxLweGU25GD9mPx9FL2BN8VC9y6SNrQiKk5l5xQBz9gd1LOwzeXpRN1107DYLTN7GtZlDVvW%2bq4Mbr35umwatP9%2f6x0rhoffsRLvJ4H7td1ReP1w3NnG4gbpYwV7emui4nf7J0bnrkUxPXwW%2fCGewNNWmKrWyQkyzJ3x3GFbV3js7EbR3PBZrVCiecPUhrBge0Jm17%2bU0t1cMjaY44Ix3BX543kA4vVIhy%2bO4CopvTXWvBs8%2bMe0J6BxQRhrwyp6T2NwpcjQDn2kgIR1RoXDVM0OVGPZz0aBp4cR1TU61wrrLBFk9Hs4sRE9qMkpSsSkENb8TJfv0VZCLAI%3d%26amp%3bp%3d&key=removed%40removed.com+microsoft.exchange.webservices+80.101.30.35+&signature=igxo1dylDw8WUm38LpOz+3GPqkYbD/g6CQhr6nPB7k+rD51f+wdtrx25dVwF0/5nqJVh+o6TSCU13OK6hgnjuasEgxBFZyfouGZDBY2nTsbF89j9Ij90LyJGXUB9mTMw/uVSx7tTApJMRDGcis2pWTtT48WRE3K7SfvQSQXOru7Iqt89ermcW8iBLn08Ebos1xYEZu5dSiAvs54fVo8Y4X465YkoWLzEOwVqQukrlSDAbhTYTkX5NU4CXxGAnsslS9jE6MdYwgWq8W9ujnhzvA5vga3F7kPr88V0Z6sFpEDDLfNQFAE7xEh/40CNBTZR39Ib/49n5JOM/WpFC7zgAA==&puid=100300009760C6E9&expireTime=636713864200000000&membername=removed%40removed.com&flags=False&userType=ManagedBusiness&ageGroup=0; exchangecookie=81c4d5fce9594cf5a8d72ec26e6edde1 Content-Length: 1088 Expect: 100-continue

HTTP/1.1 200 OK Cache-Control: private Content-Type: text/xml; charset=utf-8 Vary: Accept-Encoding Server: Microsoft-IIS/10.0 request-id: bf2ff654-ddd9-4122-bd03-e370c6c8b940 X-CalculatedFETarget: CY4PR1201CU001.internal.outlook.com X-BackEndHttpStatus: 200 Set-Cookie: exchangecookie=81c4d5fce9594cf5a8d72ec26e6edde1; path=/ X-FEProxyInfo: CY4PR1201CA0013.NAMPRD12.PROD.OUTLOOK.COM X-CalculatedBETarget: CY4PR03MB3238.namprd03.prod.outlook.com X-BackEndHttpStatus: 200 X-RUM-Validated: 1 x-EwsHandler: FindItem X-AspNet-Version: 4.0.30319 X-BeSku: WCS5 X-DiagInfo: CY4PR03MB3238 X-BEServer: CY4PR03MB3238 X-FEServer: CY4PR1201CA0013 X-Powered-By: ASP.NET X-FEServer: AM6PR0202CA0002 Date: Sat, 01 Sep 2018 00:23:53 GMT Content-Length: 1029

davster commented 6 years ago

That is great. Thank you for the trace information. Could you do me a favor and tell me what the property name is that you are using? It is marked as removed in your traces. With that information, I should be able to reproduce it on our side. I am curious if that extended property that you are specifying actually maps to a well-known schema property which happens to have a strong type. This could explain why it is complaining about a wrong ID type.

frombalinium commented 6 years ago

@davster I don't think that is the problem because the other example fails as well (with the calendar view) however if it helps to repro: PropertyName="Bla_UID"

mpodonyi commented 6 years ago

We are having exactly the same problem with "FindItems". The difference for us is, that we are in a Public Folder and try to receive all E-Mail Groups within this folder. The exception started to appear ~3 days ago. No change in code or by the admins.

SchultzAndreas commented 6 years ago

It seems to be a bug in the Office 365 API. I suddenly have the same problem a few days ago. Also at FindFolders().

brukwa commented 6 years ago

I have reproduced this issue on my German tennant using Ews Editor Currently I am unable to enumerate the list of properties for any Folder that is not IPF.Note. Ews Editor will not display properties for Calendars, Contacts and Tasks in Public Folders hierarchy.

I have created a folder using Outlook. It will not load in Ews Editor. Exception is thrown in (propset) CalendarFolder.Load

I was trying to create a Calendar with Ews Editor and it throws this Exception from Folder.Bind

Is it possible that recently some updates were applied to Exchange Online.

Cadburry commented 6 years ago

I'm facing the same issue since a few days ago (also German versions -but i dont think it has something to do with the langauge.. more with the serviceversion behind) I get the Microsoft.Exchange.WebServices.Data.ServiceResponseException:Expected an item Id but received a folder Id on calling Folder.Load() with a property set of: new PropertySet(FolderSchema.DisplayName, FolderSchema.ChildFolderCount, FolderSchema.TotalCount) On my side the problem only occurs with Public-Folders! (I'm targeting a public contact folder, with the contactfolder of the mailbox it works)

ngyongzhen commented 6 years ago

There is a workaround for this. Instead of using folderObject.Id as the argument, explicitly creating the FolderId and use that as argument. Example: FolderId folderId = new FolderId(folderObject.Id.toString()); <-- EWS API call with folderId instead of folderObject.Id-->

Having said that, it is clearly an issue on Microsoft's end. I am hoping they roll-out a fix for this ASAP.

Note: It appears that this error does not affect ALL O365 tenants. Some tenants works fine while others encounter this error despite running the same code.

SirHenryIII commented 6 years ago

Our Tenant is in the US but I'm working from Germany, don't know if this matter. In my case I tried to open a PF Contact Group. Changed my PowerShell Script `$EWSFolderId = New-Object -TypeName Microsoft.Exchange.WebServices.Data.FolderId($EWSFolder.Id.ToString())

$SearchResult = $EWSFolder.FindItems($Filter, $View)

$SearchResult = $EWS.FindItems($EWSFolderId, $Filter, $View)`

Thanks for the Workaround @ngyongzhen

Cadburry commented 6 years ago

@ngyongzhen ok.. Thx! - but this doesnt fit to my requirements i'm binding a Folder in c# like this:

var contactsfolder = Folder.Bind(service,
                     new FolderId(Settings.FolderID),
                     new PropertySet(BasePropertySet.IdOnly, FolderSchema.TotalCount, FolderSchema.DisplayName));

 contactsfolder.Load(new PropertySet(FolderSchema.DisplayName, FolderSchema.ChildFolderCount, FolderSchema.TotalCount));

on folder.Load the exception is raised. Does anybody know.. does the exception message "Expected an item Id but received a folder Id" comes from the service-side or is the message generated and raised by the managed-api?

davster commented 6 years ago

We identified the problem on the server side and I checked in a fix for it last night. I am going to see if we can push out the changes quickly to unblock you. I am currently backporting the fix to the dominant build in production so this should roll out in the next few days. Sorry for the inconvenience.

ellingent commented 6 years ago

Thank you for fixing this!

bureyburey commented 6 years ago

any ETA on when the fix will be up?

Codesmiths commented 6 years ago

Any ETA on this? The "work around" does not work for me, and this is killing a production application.

davster commented 6 years ago

The fix is checked in and I am currently backporting the changes to previous builds. Those should go in today and then a few days for rollout (estimate).

bureyburey commented 6 years ago

Nice Thanks for keeping us updated :)

Codesmiths commented 6 years ago

Thank you!

aluitink commented 6 years ago

Anyone know if there is a Service Health advisory or incident ID for this?

aluitink commented 6 years ago

@davster can you confirm this fix is deployed? I've tested and no longer seeing this issue.

Cadburry commented 6 years ago

@aluitink @davster I'm still facing the issue - maybe it has not been deployed on all sites yet and deploying is in progress.. - i will try it again later - will keep you updated!

aluitink commented 6 years ago

@Cadburry, I've continued testing and also still see this issues intermittently.

davster commented 6 years ago

The fix is rolling out WW. As such, there will be some servers that have been patched and some that have not which will give you the intermittent behavior you are seeing. This could even be true for a single mailbox as the database holding the mailbox could be load balanced to another server, etc... But we should be in this state for only a short period of time.

frukeus commented 6 years ago

@davster Thanks for the update. Still no working for us. Are there any channels where we can check if the fix has been rolled out into our tenant? service health, twitter etc?

Cadburry commented 6 years ago

@davster Thanks a lot for your efforts - its working now again on my side!! @aluitink

Aym3nTN commented 6 years ago

@davster Thanks for your efforts! Please let us know once the fix is rolled out WW.

frombalinium commented 6 years ago

Thanks guys @microsoft for monitoring this forum and picking it up. A couple of clients have reported that the software now works again as it used to and the bug is gone. I do want to share with you that the support experience through the official channels was a rough one. o365 support did a remote session, concluded that there was indeed a problem and it ended there. I think these guys should have a way to escalate such issues including the call history. I posted my problem on technet and redit first without anyone seriously looking at it. I had 5 customers calling microsoft to report the problem to get some call volume hoping that it would ring a bell. It's only after posting to this forum that the ball started rolling (for which I am utterly gratefull). During a week or so I was taking the blows of upset customers before I had anything to show that it was indeed a bug in EWS. Next time I will post the issue directly here knowing that the good guys are watching it! Thanks again.

davster commented 6 years ago

@frombalinium - thanks for the input. I have forwarded your concerns about your support experience to our internal group to see how we can improve. I agree that the experience that you described above isn't acceptable. The various dev teams do subscribe to these channels, so there is definitely MSFT presence on these from the product side of things. Let me know if you run into any more related issues.

Lantizia commented 6 years ago

Hey,

On the same day this issue was logged we also noticed a script stopped working. I've boiled it down to what we send and what we get back...

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <s:Header>
    <t:RequestServerVersion Version="Exchange2013_SP1"/>
  </s:Header>
  <s:Body>
    <m:FindItem>
      <m:ItemShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="item:Subject"/>
          <t:FieldURI FieldURI="calendar:IsAllDayEvent"/>
          <t:FieldURI FieldURI="calendar:StartWallClock"/>
          <t:FieldURI FieldURI="calendar:EndWallClock"/>
        </t:AdditionalProperties>
      </m:ItemShape>
      <m:IndexedPageItemView Offset="0"/>
      <m:ParentFolderIds>
        <t:FolderId Id="AQEuAAADGkRzkKpmEc2byACqAC/EWgMAouZN+j474U2fhmokbCNCbwADGTqv/AAAAA=="/>
      </m:ParentFolderIds>
    </m:FindItem>
  </s:Body>
</s:Envelope>

Response...

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1143" MinorBuildNumber="18" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
  </s:Header>
  <s:Body>
    <m:FindItemResponse 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:FindItemResponseMessage ResponseClass="Error">
          <m:MessageText>The specified object was not found in the store., Item not found.</m:MessageText>
          <m:ResponseCode>ErrorItemNotFound</m:ResponseCode>
          <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
        </m:FindItemResponseMessage>
      </m:ResponseMessages>
    </m:FindItemResponse>
  </s:Body>
</s:Envelope>

The error just isn't true, the folder ID is perfectly fine and there are those items to find within it.

You said a bug fix was being applied worldwide but given no way to track this :(. I've opened a ticket (number 11536035) with the 365 support team but got nothing back - probably because they're confused on what on earth this Github issue is about (as I linked to it).

If you have an alternate way of doing this request (an XML example like above would be useful - as this is a bash script using curl, yes BASH :P) that'd be handy in the meanwhile. I've looked at the workarounds supplied but I can't see how they'd translate to what would actually be sent XML wise.

davster commented 6 years ago

The error is a different issue. The previous error was "Expected an item Id but received a folder Id". This one is saying that it cant find something in the store. Can you give me a request id, X-BEHeader and request Date/time from a repro? These come from the response HTTP headers.

Out of curiosity, what happens if you call GetFolder on that folder? Do you get folder information back or the item not found again? And then, what if you remove the additional properties from the FindItem request - does that work, or same deal?

As an aside, you are missing your BaseShape element in your request.

<ItemShape>
   **<t:BaseShape>IdOnly</t:BaseShape>**
   <t:AdditionalProperties> ...
   </t:AdditionalProperties>
</ItemShape>

It works because BaseShape happens to have a defult value of IdOnly which maybe you are taking advantage of. I doubt we will change that, so you are probably ok there.

Lantizia commented 6 years ago

If I follow you correctly, you are after the below?

curl -v -u <REDACTED USER@DOMAIN.COM USERNAME>:<REDACTED PASS> https://outlook.office365.com/EWS/Exchange.asmx -d '<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <s:Header>
    <t:RequestServerVersion Version="Exchange2013_SP1"/>
  </s:Header>
  <s:Body>
    <m:FindItem>
      <m:ItemShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="item:Subject"/>
          <t:FieldURI FieldURI="calendar:IsAllDayEvent"/>
          <t:FieldURI FieldURI="calendar:StartWallClock"/>
          <t:FieldURI FieldURI="calendar:EndWallClock"/>
        </t:AdditionalProperties>
      </m:ItemShape>
      <m:IndexedPageItemView Offset="0"/>
      <m:ParentFolderIds>
        <t:FolderId Id="AQEuAAADGkRzkKpmEc2byACqAC/EWgMAouZN+j474U2fhmokbCNCbwADGTqv/AAAAA=="/>
      </m:ParentFolderIds>
    </m:FindItem>
  </s:Body>
</s:Envelope>'
*   Trying 52.97.146.178...
* Connected to outlook.office365.com (52.97.146.178) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 597 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: outlook.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=US,ST=Washington,L=Redmond,O=Microsoft Corporation,CN=outlook.com
*    start date: Wed, 01 Aug 2018 00:00:00 GMT
*    expire date: Sat, 01 Aug 2020 12:00:00 GMT
*    issuer: C=US,O=DigiCert Inc,CN=DigiCert Cloud Services CA-1
*    compression: NULL
* ALPN, server did not agree to a protocol
* Server auth using Basic with user '<REDACTED USER@DOMAIN.COM USERNAME>'
> POST /EWS/Exchange.asmx HTTP/1.1
> Host: outlook.office365.com
> Authorization: Basic <REDACTED HASH LIKELY THE PASSWORD IN SOME FORM>
> User-Agent: curl/7.47.0
> Accept: */*
> Content-Length: 919
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 919 out of 919 bytes
< HTTP/1.1 200 OK
< Cache-Control: private
< Transfer-Encoding: chunked
< Content-Type: text/xml; charset=utf-8
< Server: Microsoft-IIS/10.0
< request-id: 8c62bba8-43d8-4204-8d04-164bc0cb0ec1
< X-CalculatedFETarget: DB7PR08CU001.internal.outlook.com
< X-BackEndHttpStatus: 200
< Set-Cookie: exchangecookie=559e69f5f14f4e0da0600508efd02ed7; expires=Thu, 26-Sep-2019 15:43:37 GMT; path=/; HttpOnly
< X-FEProxyInfo: DB7PR08CA0023.EURPRD08.PROD.OUTLOOK.COM
< X-CalculatedBETarget: DB7PR04MB4187.eurprd04.prod.outlook.com
< X-BackEndHttpStatus: 200
< X-RUM-Validated: 1
< x-EwsHandler: FindItem
< X-AspNet-Version: 4.0.30319
< X-BeSku: WCS5
< X-DiagInfo: DB7PR04MB4187
< X-BEServer: DB7PR04MB4187
< X-FEServer: DB7PR08CA0023
< X-Powered-By: ASP.NET
< X-FEServer: LO2P265CA0383
< Date: Wed, 26 Sep 2018 15:43:37 GMT
< 
<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1143" MinorBuildNumber="18" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></s:Header><s:Body><m:FindItemResponse 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:FindItemResponseMessage ResponseClass="Error"><m:MessageText>The specified object was not found in the store., Item not found.</m:MessageText><m:ResponseCode>ErrorItemNotFound</m:ResponseCode><m:DescriptiveLinkKey>0</m:DescriptiveLinkKey></m:FindItemResponseMessage></m:ResponseMessages></m:FindItemResponse></s:Body></s:Envelope>
Lantizia commented 6 years ago

What I will add is this. The issue we are having (albeit admittedly we're just using a straight XML file with curl)... occurred on exactly the same day as this other problem and the same XML was working fine before that and returning results.

Noticed a few more people talking about it over here too...

https://social.technet.microsoft.com/Forums/en-US/7d800bef-48c8-42ad-a737-ece8aa16d683/exchangeonlineews-findappointments-method-on-public-folder-calendar-error-returns-folderid-not?forum=exchangesvrdevelopment

davster commented 6 years ago

I pulled your logs for the above request, and it is complaining that it can't find the public folder (error should be folder not found, not item not found). I have looped in the PF feature team. In the meantime, try adding an X-AnchorMailbox header and set it to the smtp address of your public folder mailbox to see if that works.

Lantizia commented 6 years ago

Yeah that is one of the things I've already tried, didn't have any effect.

frukeus commented 6 years ago
Exception type: ServiceResponseException 
Exception message: The specified object was not found in the store., Can't connect to the mailbox of user Mailbox database guid: 41dafc9e-716d-4029-bf90-ef4dd62d4699 because the ExchangePrincipal object contains outdated information. The mailbox may have been moved recently.

Anyone experience this issue with the EWS API?

davster commented 6 years ago

@frukeus - Could you provide the HTTP response headers for the failed request? I would like to confirm that it is the same issue as @Lantizia is seeing. I forwarded this to the public folders team to investigate as well. Actually, this one might be a bit different as the error message talks about the mailbox being inaccessible. Regardless, the response headers would help.

frukeus commented 6 years ago

Transfer-Encoding chunked Content-Encoding gzip Vary Accept-Encoding request-id 4bfc5e45-4398-4f49-9c97-0b54cf1f7cf4 X-CalculatedFETarget AM0PR01CU001.internal.outlook.com X-BackEndHttpStatus 200,200 X-FEProxyInfo AM0PR01CA0006.EURPRD01.PROD.EXCHANGELABS.COM X-CalculatedBETarget AM0P191MB0403.EURP191.PROD.OUTLOOK.COM X-RUM-Validated 1 x-EwsHandler FindFolder X-BeSku WCS5 X-DiagInfo AM0P191MB0403 X-BEServer AM0P191MB0403 X-FEServer AM0PR01CA0006,SG2PR0401CA0017 Cache-Control private Content-Type text/xml; charset=utf-8 Date Fri, 28 Sep 2018 03:08:33 GMT Set-Cookie exchangecookie=432be5b09af342359f679350229e778f; path=/ Server Microsoft-IIS/10.0 X-AspNet-Version 4.0.30319 X-Powered-By ASP.NET

That's all tt I could extract

davster commented 6 years ago

Per the PF team:

We set X-AnchorMailbox to handle cross-forest scenarios where

  1. User and PF mailboxes are in different forests
  2. PF mailboxes are spread across different forests

This tenant has only one PF mailbox and it is in Eurp192. I see some of the user mailboxes in eurprd04, if the user trying to access the mailbox is in a different forest, ask them to include X-AnchorMailbox header.

Default public folder mailbox for the given user can be found as follows: (Get-Mailbox ). EffectivePublicFolderMailbox

As the tenant has only 1 PF mailbox, it would be the default public folder mailbox for all the users.

frukeus commented 6 years ago

This issue seemed to have been resolved by itself over the weekend. We didn't make any code changes yet everything is back working.

Per the PF team:

We set X-AnchorMailbox to handle cross-forest scenarios where

  1. User and PF mailboxes are in different forests
  2. PF mailboxes are spread across different forests

This tenant has only one PF mailbox and it is in Eurp192. I see some of the user mailboxes in eurprd04, if the user trying to access the mailbox is in a different forest, ask them to include X-AnchorMailbox header.

Default public folder mailbox for the given user can be found as follows: (Get-Mailbox ). EffectivePublicFolderMailbox

As the tenant has only 1 PF mailbox, it would be the default public folder mailbox for all the users.

Lantizia commented 6 years ago

For the hell of it I thought I'd try an X-AnchorMailbox that is not my mailbox and it has worked! e.g. Username: lantizia@company.com X-AnchorMailbox: support@company.com

Whereas I have been using... e.g. Username: lantizia@company.com X-AnchorMailbox: lantizia@company.com

Now that I've got that working... I thought I'd try it again without the X-AnchorMailbox. BINGO, it works fine now.

It's as though making just that one request with X-AnchorMailbox has made it realise it needs to jiggle things about on the 365 servers and now it's not needed any more.

Very frustrating, especially for all these people in the forum link below who have been experiencing this for over a month (and I've yet to have any decent reply back from an open case with Microsoft for now 10 days on this)...

https://social.technet.microsoft.com/Forums/en-US/ee6e943f-e103-4abf-957f-19a42aa8a91b/ews-with-o365-has-been-broken-for-the-past-24-hours-for-us?forum=onlineservicesexchange

ecboyes commented 5 years ago

Is anyone still having this problem?? I am and can't understand why the fix didn't resolve it

frombalinium commented 3 years ago

Hi David,

Sorry to bother you and spamming on this old issue. But you seem to be a shortcut to the level I need to be.

I am a ISV and some companies use my EWS code. A lot of them on O365 The code initiates pull subscriptions and polls them later on (within the timeout period)

Currently I have a office 365 user where this stopped working. We can still initiate the pull subscription but when we try to poll it, it's gone. The error we get is The SMTP address has no mailbox associated with it.

Has there been a recent update that could have broken something?

regards,

John in 't Veld OpusFlow


Van: David Sterling [mailto:notifications@github.com] Verzonden: maandag 10 september 2018 18:15 Aan: OfficeDev/ews-managed-api CC: John in 't Veld; Mention Onderwerp: Re: [OfficeDev/ews-managed-api] o365 problem with finditems / (calendar)view for public folder calendar (#204)

The fix is rolling out WW. As such, there will be some servers that have been patched and some that have not which will give you the intermittent behavior you are seeing. This could even be true for a single mailbox as the database holding the mailbox could be load balanced to another server, etc... But we should be in this state for only a short period of time.

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/OfficeDev/ews-managed-api/issues/204#issuecomment-419970810, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ao2x738ToxanGpbPxeyq3IF2vGMapogEks5uZpADgaJpZM4WTkMO.