Skip to content

We are observing a rare but recurring issue when using msgraph-sdk-python to enumerate SharePoint drive contents. #1447

@GollapalliVaishnavi

Description

@GollapalliVaishnavi

Describe the bug

We are observing a rare but recurring issue when using msgraph-sdk-python to enumerate SharePoint drive contents.
In very infrequent cases (roughly 1 out of 50 executions), entire folders — along with all files inside them — are missing from the SDK response, even though:

 

The folders and files exist in SharePoint
They are visible via the SharePoint UI
The same Microsoft Graph API request, when executed directly via Postman, always returns the correct and complete result

 

This issue was investigated with Microsoft Graph Developer Support, who confirmed:

 

The Graph service behavior is correct
The inconsistent results appear to be SDK-specific
We were advised to raise this directly on the SDK GitHub repository

 When listing folders or files from a SharePoint document library using msgraph-sdk-python, the SDK should consistently return all existing folders and files, matching the results returned by direct Microsoft Graph API calls.

Actual Behavior

Very rarely (≈ 1 in 50 runs), the SDK response:

Omits entire folders
Consequently omits all files within those folders

No errors or warnings are returned by the SDK
Re-running the same code (without any changes) typically returns the missing folders again
There is no observable pattern related to:

Folder names
Folder depth
File count
Recent uploads or updates
Execution timing

Frequency

Very low but non-zero frequency
Approximately once every 50 executions
Occurs across repeated runs of the same workload

Although rare, this issue is concerning because it leads to silent data omission.

Expected behavior

Call the Microsoft Graph API directly using Postman:

GET https://graph.microsoft.com/v1.0/sites/{siteId}/drives/{driveId}/items/{itemId}

All folders and files are returned consistently.

Execute the equivalent folder/file enumeration using msgraph-sdk-python.

In rare cases:

One or more folders are completely missing from the SDK response.

13:23 Meeting ended: 17m 27s AttendanceDownload the attendance report

How to reproduce

Call the Microsoft Graph API directly using Postman:
GET https://graph.microsoft.com/v1.0/sites/{siteId}/drives/{driveId}/items/{itemId}
All folders and files are returned consistently.

Execute the equivalent folder/file enumeration using msgraph-sdk-python.

In rare cases:

One or more folders are completely missing from the SDK response.

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions