Graph API, search for driveItems: general exception, 500 internal error

Syméon del Marmol 35 Reputation points
2023-04-26T08:30:52.5666667+00:00

Hello,

I am trying to use the graph api via HTTP calls to search for items in Sharepoint drives of a specific site, based on their name, but I'm getting a 500 internal server error as a response, with the following body:

{
    "error": {
        "code": "generalException",
        "message": "General exception while processing",
        "innerError": {
            "date": "2023-04-26T08:14:26",
            "request-id": "{request-id}",
            "client-request-id": "{client-request-id}"
        }
    }
}

I followed the instruction on that page to build the request: https://learn.microsoft.com/en-us/graph/api/driveitem-search?view=graph-rest-1.0&tabs=http.

I am sending a simple HTTP GET request: https://graph.microsoft.com/v1.0/sites/{Site-id}/drive/root/search(q='{filename}'), with a Bearer token generated for an application user.

That application has Site.Selected as API permissions, and I can create folders, upload items or download items without any issue on that same site. (so I suppose it is not related to a permission issue).

Would you have any idea why I get that error, and what I'm doing wrong? Is there a config that should be changed or verified in Azure to make it work?

Thanks a lot for your answer :-)

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,987 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,674 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 35,386 Reputation points Microsoft Vendor
    2023-04-27T03:18:59.7833333+00:00

    Hi @Syméon del Marmol

    The 500 status code generally represents a server problem. You could wait for some time then test again. If the issue doesn't fixed, please check whether there is a problem with the step of calling the API. Try to call the API in the graph explorer with a user with the permission of this site to check whether the issue still exists. And this API works well when I test in graph explorer.

    User's image

    If the issue still exists, I suggest you submit a ticket in the admin center with the request-id, then you could get the detailed error information.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Development Systematik 0 Reputation points
    2023-10-17T10:58:32.1633333+00:00

    We get the same Error.
    When we set Site.ReadWriteAll to the application it works like expected. Seems that there ist a bug with site.selected.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.