Graph Search API - Searching Sites fails with Application Permissions inconsistently
I am trying to search SharePoint sites using Graph Search with Application Permissions, the call fails with error given below 9 out of 10 times, following is my payload,
Request type: Post
Request URL: https://graph.microsoft.com/v1.0/search/query
Request body: { "requests": [ { "entityTypes": [ "site" ], "query": { "queryString": "contoso", }, "region": "EMEA" } ] }
Following is the response that i get,
{ "error": { "code": "InternalServerError", "message": "The call failed, please try again.", "target": "", "details": [ { "code": "InternalServerError", "message": "The call failed, please try again.", "target": "", "details": [ { "code": "FanoutExternalTimeoutException", "message": "The call failed, please try again.", "target": "", "details": [ { "code": "TwoStepFanout_FirstStepFailed", "message": "The call failed, please try again.", "target": "", "serviceName": "Xap", "moduleName": "SubstrateSearch.FanoutV2.MultiDimensionSearchFanoutPluginV2", "contactTeam": "3sdri", "httpCode": 500 }, { "code": "FanoutExternalTimeoutException", "message": "The call failed, please try again.", "target": "", "serviceName": "FanoutService", "moduleName": "Fanout", "contactTeam": "ShardSearchDRI", "httpCode": 500 } ], "serviceName": "FanoutService", "moduleName": "Fanout", "contactTeam": "ShardSearchDRI", "httpCode": 500 } ], "moduleName": "SubstrateFanoutSearchWorkflow", "httpCode": 500 } ], "moduleName": "SearchAllTopLevelInternalWorkflow", "httpCode": 500 }, "Instrumentation": { "TraceId": "921cc798-aff6-7e6e-58d4-fa7a6844155a" } }
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: fc9c6a3a-4dd5-6096-e838-4451fa72c7b8
- Version Independent ID: 283e3382-85f7-fee0-278b-73d6320bfa2f
- Content: Discover a Multi-Geo tenant configuration
- Content Source: docs/solution-guidance/multigeo-discovery.md
- Product: sharepoint
- GitHub Login: @VesaJuvonen
- Microsoft Alias: vesaj
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
I have the same problem doing a simple search
2023-09-18 23:20:27.003 Error: 500, {"error":{"code":"InternalServerError","message":"The call failed, please try again.","target":"","details":[{"code":"InternalServerError","message":"The call failed, please try again.","target":"","details":[{"code":"FanoutExternalTimeoutException","message":"The call failed, please try again.","target":"","details":[{"code":"TwoStepFanout_FirstStepFailed","message":"The call failed, please try again.","target":"","serviceName":"Xap","moduleName":"SubstrateSearch.FanoutV2.MultiDimensionSearchFanoutPluginV2","contactTeam":"3sdri","httpCode":500},{"code":"FanoutExternalTimeoutException","message":"The call failed, please try again.","target":"","serviceName":"FanoutService","moduleName":"Fanout","contactTeam":"ShardSearchDRI","httpCode":500}],"serviceName":"FanoutService","moduleName":"Fanout","contactTeam":"ShardSearchDRI","httpCode":500}],"moduleName":"SubstrateFanoutSearchWorkflow","httpCode":500}],"moduleName":"SearchAllTopLevelInternalWorkflow","httpCode":500},"Instrumentation":{"TraceId":"97e205b6-b55c-fdab-e7a8-e14b1de9eb87"}}
Same here, any query, any entityTypes, using Application Permissions on v1.0 or beta endpoint, results in {"code":"InternalServerError","message":"The call failed, please try again.","target":""}
The app reg has Files.Read.All, Sites.Read.All as described here for Application Permissions: https://learn.microsoft.com/en-us/graph/api/search-query?view=graph-rest-1.0&tabs=http
Also including the Region as described here: https://learn.microsoft.com/en-us/graph/search-concept-searchall
I was having the same issue in a PowerShell script. Until I noticed I was passing in region as an array (region = @("US")).
After changing it to a string literal (region = "US") I started getting 200s consistently.
PS: dmoorjmalani, I also think EMEA is not a valid region. It has to be either US or GBR.
Hope this helps.
Thank you for taking the time to file an issue. We periodically archive older or inactive issues as part of our issue management process, which automatically closes them once they are archived.
If you’d like to understand more about why and how we handle archived (closed) issues, please see Our approach to closed issues.
We appreciate your contribution and if this is still an active issue with the latest SPFx versions, please do resubmit the details. We needed to perform a cleanup, so that we can start with a clean table with a new process. We apologize for the inconvenience this might cause.