itemNotFound for file that does exist

Michael Millar 1 Reputation point
2021-02-03T12:27:14.553+00:00

I am setting user permissions (read or write) to files stored in OneDrive using the Graph API. The owner of the file is making the call to the API and the BaseURL for the request is in the form:

     https://graph.microsoft.com/v1.0/me/drive/root:/pathtofile/filename:/invite  

This works most of the time, but every now and then, the resource "isn't found" and I get a response like this:

     {  
        "error": {
          "code": "itemNotFound",
          "message": "The resource could not be found.",
          "innerError": {
            "date": "2021-02-01T12:19:21",
            "request-id": "ef47abe9-4576-4e14-930e-32638445c87c",
            "client-request-id": "ef47abe9-4576-4e14-930e-32638445c87c"
          }
        }
      }

The resource does exist. Sometimes a retry after a few seconds is successful, sometimes it doesn't seem to be successful for several minutes. This isn't good for users and any help resolving the issue / improving reliability would be gratefully received.

Regards,
Michael

Microsoft Security | Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Diya Ahuja 5 Reputation points
    2023-06-30T18:07:28.0133333+00:00

    The issue you are experiencing is likely due to the fact that the resource is not always immediately available when the API call is made. This is because the resource may be in the process of being created or updated, and the API call is being made before the resource is ready.

    To improve reliability, you can try adding a delay before making the API call, or you can use the if-none-match request header to check if the resource has been updated since the last time the API call was made. If the resource has not been updated, the API will return a 304 Not Modified response, which can be used to avoid making unnecessary API calls.

    0 comments No comments

  2. r roberts 0 Reputation points
    2025-11-17T22:49:46.43+00:00

    DIT PNG BESTAND HEEFT VERSCHILLENDE NRS ALS BESTANDsnaam, dus niet te achterhalen wat het precies is (sorry ik ben een leek)

    IK KAN DIT MET GEEN MOGELIJKHEID VERWIJDEREN UIT DE PRULLENBAK;

    AL 2 ? JAAR of langer NIET ...
    hoe kom ik er van af?
    het zijn grote bestanden van een paar MB'sERROR BESTAND NIET VERWIJDERBR PRULLENBK

    ERROR MELDING

    ERROR BESTAND PRULLENBAK

    kan iemand mij helpen deze te verwijderen uit de prullenbak en de error op te lossen?

    {"error":{"innerError":{},"loggableMessage":{"_value":"The resource could not be found.","_type":"unsafe","__isPrivacyDataWrapper":true},"name":"GraphError","correlationId":"c840ad8b-4e5d-4ce7-8fbb-7ab132b5d628","isExpected":false,"code":"itemNotFound","extraData":{"apiEventName":"VroomDataRequest.item"},"response":{"error":{"code":"itemNotFound","message":"The resource could not be found.","innerError":{"date":"2025-11-17T21:11:57","request-id":"c840ad8b-4e5d-4ce7-8fbb-7ab132b5d628","client-request-id":"c840ad8b-4e5d-4ce7-8fbb-7ab132b5d628"}}},"status":404,"serverStack":"","request":{},"error":{}}}

    0 comments No comments

Your answer

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