Confluence configuration test fails with http error 500
After configuring the configuration for the SharePoint Connector in Confluence, a 500 error is displayed in the Configuration Test Results at "Search Sites", "Search Lists" or "Search Documents":
Search Sites request failed. Check your SharePoint URL.
500 errorThis problem could occur for SharePoint Online and SharePoint on-premise as well (For on-premise the screenshot looks a bit different).
Usual Causes
- The logged-in user to SharePoint does not have at least read access to the SharePoint site collection to perform search queries on the SharePoint List macro configuration. - Can receive the following error that can be seen in the postquery when analyzing the network calls. - {"error":{"code":"-1, Microsoft.Office.Server.Search.REST.SearchServiceException","message":{"lang":"en-US","value":"The SafeQueryPropertiesTemplateUrl \"The SafeQueryPropertiesTemplateUrl "{0}" is not a valid URL.\" is not a valid URL."}}}
 
- Grant admin consent was not performed when configuring API permissions in Azure. See the documentation here for more info. - The following errors can be seen in the postquery when analyzing the network calls. - "error":{"code":"-1, Microsoft.Office.Server.Search.REST.SearchServiceException","message": {"lang":"en-US","value":"The current principal does not have permission to execute queries on behalf of other users."}
 
Further Investigation
For an investigation please provide our support with the following information:
- A HAR file from the time you executed the check for Confluence. For instruction see Generating HAR files and Analysing Web Requests 
- Execute the query according to the Query Table for "Search Sites", "Search Lists" or "Search Documents" using the free Search Query Tool. - Instruction: Executing a search query using SharePoint Search Query Tool 
- Be sure you use the same SharePoint Account (Online or 2016) you used in the browser before 
- Attach screenshots from the status and the primary results tab. 
 
Query Table
| For | Query | 
|---|---|
| Search Sites | 
 | 
| Search Lists | 
 | 
| Search Documents | 
 |