microsoftgraph / msgraph-sdk-android

Microsoft Graph SDK for Android! https://graph.microsoft.io
Other
51 stars 43 forks source link

Unable to execute search intermittently #47

Closed kumaraish closed 7 years ago

kumaraish commented 7 years ago

Hi, I am observing a strange issue here. I am executing a search for a file against OneDrive using graph APIs. The search returns results at times, while sometimes, no results are returned; everything else remains the same. This happens intermittently. Here is a verbose curl request I have executed (for a case in which no results, an empty list, is returned).

λ curl -v -H "Authorization : bearer <access_token>" -X GET "https://graph.microsoft.com/v1.0/me/drive/root/microsoft.graph.search(q='metadata.db')"
* Hostname was NOT found in DNS cache
*   Trying 104.211.229.20...
* Connected to graph.microsoft.com (104.211.229.20) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files\cURL\bin\curl-ca-bundle.crt
  CApath: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-SHA384
* Server certificate:
*        subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; OU=Microsoft Corporation; CN=graph.microsoft.com
*        start date: 2017-02-09 00:55:23 GMT
*        expire date: 2018-05-07 17:03:30 GMT
*        subjectAltName: graph.microsoft.com matched
*        issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT SSL SHA2
*        SSL certificate verify ok.
> GET /v1.0/me/drive/root/microsoft.graph.search(q='metadata.db') HTTP/1.1
> User-Agent: curl/7.39.0
> Host: graph.microsoft.com
> Accept: */*
> Authorization : bearer <access_token>
>
< HTTP/1.1 200 OK
< Cache-Control: private
< Transfer-Encoding: chunked
< Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
< request-id: 84db2920-96d9-47fe-98b7-5c1fe2e7a7fe
< client-request-id: 84db2920-96d9-47fe-98b7-5c1fe2e7a7fe
< x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"South India","Slice":"SliceB","ScaleUnit":"002","Host":"AGSFE_IN_2","ADSiteName":"MAA"}}
< OData-Version: 4.0
< Duration: 539.57
< Date: Thu, 20 Apr 2017 15:04:48 GMT
<
{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)","value":[]}* Connection #0 to host graph.microsoft.com left intact

Note that for a successful request also, x-ms-ags-diagnostic returned in response headers is the same.

The corresponding code in my android app is -

List<DriveItem> items= graphServiceClient
    .getMe()
    .getDrive()
    .getRoot()
    .getSearch(Uri.encode(name))
    .buildRequest()
    .get().getCurrentPage();

Note that no exception is thrown; as can be seen in the curl response too (HTTP 200 OK is returned)

Please check this out as a lot of users of my app are also observing this behavior.

MIchaelMainer commented 7 years ago

Thank you for bringing this to our attention. I've passed this along to the service owner.

MIchaelMainer commented 7 years ago

@kumaraish Are you still seeing this issue? If so, can you provide us the request-id returned in the response?

kumaraish commented 7 years ago

@MIchaelMainer No, I haven't encountered this in past 2 days. Though I will continue to run tests for a couple of days more and would update you if I receive this. Was anything fixed on the other side?