Category
- [ ] Question
- [ ] Documentation issue
- [x] Bug
Summary
A valid Microsoft Graph path-based upload request for a new file named v1.0.0 in OneDrive Personal returns HTTP 201 Created, but creates a different remote item:
- Requested:
issue3930-test/fresh/v1.0.0
- Actually created:
issue3930-test/fresh/_api/v2.0.0
The unexpected item has the uploaded content (five bytes, with matching reported content hashes), but the returned DriveItem has the wrong name and parentReference. The service also creates an unrequested _api directory.
This has been independently reproduced on two different Linux systems and OneDrive Personal accounts in different Microsoft data centres. It is not specific to Git repositories or the Linux client's SQLite database.
Original report and technical investigation: https://github.com/abraunegg/onedrive/issues/3930
Expected behaviour
The documented small-file upload operation:
PUT https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{parent-id}:/v1.0.0:/content
Authorization: Bearer {access-token}
Content-Type: application/octet-stream
<five-byte payload: "test\n">
should create a file called v1.0.0 directly inside the folder with ID {parent-id}. The returned DriveItem should identify that filename and parent:
{
"name": "v1.0.0",
"size": 5,
"parentReference": {
"driveId": "{drive-id}",
"id": "{parent-id}"
}
}
The API should not create additional subdirectories or silently change the requested item identity. If it cannot satisfy the request, it should return an appropriate error rather than a success response describing a different destination.
Actual behaviour
The service returns HTTP/2 201 Created for the v1.0.0 upload, but its response describes a file named v2.0.0 inside a newly created folder named _api:
issue3930-test/
└── fresh/
├── v0.4.1 # control upload: correct
└── _api/ # never requested
└── v2.0.0 # contains the bytes sent for v1.0.0
There is no fresh/v1.0.0 at the requested destination. A sibling control file, v0.4.1, uploaded through the same code path and account, is created correctly.
The affected file's contents and reported hash match the source. Consequently, a client that validates upload size and hash alone can regard the operation as successful even though the server stored the file at the wrong path.
Representative returned DriveItem fields
The independent maintainer reproduction returned an item equivalent to:
{
"name": "v2.0.0",
"size": 5,
"parentReference": {
"driveType": "personal",
"driveId": "{drive-id}",
"id": "{unexpected-api-folder-id}",
"name": "_api",
"path": "/drives/{drive-id}/root:/issue3930-test/fresh/_api"
}
}
The placeholders above intentionally redact account-specific object IDs. This is a representative excerpt, not a verbatim full HTTP response.
Minimal reproduction
- Use a Microsoft OneDrive Personal account and obtain a Graph access token with appropriate write permissions.
- Create an isolated folder
issue3930-test/fresh and record its DriveItem ID ({parent-id}).
- Create two ordinary five-byte local files:
printf 'test\n' > v0.4.1
printf 'test\n' > v1.0.0
- Upload the control file to the existing parent:
PUT https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{parent-id}:/v0.4.1:/content
Authorization: Bearer {access-token}
Content-Type: application/octet-stream
<contents of v0.4.1>
Observe that it is created as fresh/v0.4.1.
- Upload the affected file:
PUT https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{parent-id}:/v1.0.0:/content
Authorization: Bearer {access-token}
Content-Type: application/octet-stream
<contents of v1.0.0>
- Observe HTTP 201 Created, inspect the returned DriveItem
name, parentReference, and size, and enumerate the remote folder. The operation has created _api/v2.0.0 rather than the requested v1.0.0.
Important qualification: These steps reproduce the confirmed behaviour through the OneDrive Client for Linux, which issues the documented Graph request. An independent, standalone HTTP-client test is still useful to isolate any transport-layer involvement.
Independent reproduction environments
| Property | Original reporter | Independent maintainer reproduction |
|---|---|---|
| Date | 25–26 October 2026 | 26 October 2026 |
| Operating system | CachyOS | Fedora 40 |
| OneDrive account | Personal | Personal |
| OneDrive Client for Linux | v2.5.12 | v2.5.12 |
| D compiler | LDC 2.113 | DMD 2.103 |
| libcurl | 8.23.0 | 8.6.0 |
| Microsoft data centre | Germany West Central | Australia Southeast |
| Requested name | v1.0.0 | v1.0.0 |
| Returned name/path | _api/v2.0.0 | _api/v2.0.0 |
| Control file v0.4.1 | Succeeded normally | Succeeded normally |
The independent reproduction used plain five-byte files, not a Git repository, rsync, or any other local synchronisation tool. Different distributions, compilers, libcurl versions, and Microsoft data centres produce the same highly specific transformation.
We have not yet established whether OneDrive for Business or SharePoint Online are affected.
Microsoft service request correlation — independent reproduction
The following values were captured in the Fedora 40 reproduction and can be used to investigate server-side telemetry:
- UTC date/time: 2026-10-26 03:41:03 UTC (approximately)
- Operation:
PUT https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{parent-id}:/v1.0.0:/content
- HTTP response:
201 Created over HTTP/2
- Graph
request-id: 6292c9ee-860d-460c-8f37-fc4d67644435
- Graph
client-request-id: 6292c9ee-860d-460c-8f37-fc4d67644435
-
splogid: 8f8748a2-60be-0001-02ae-852b4d62a95f
- Microsoft data centre: Australia Southeast
- Server diagnostic: Slice
E, Ring 3, ScaleUnit 001
A later response in the same reproduction carried request ID 3635e9fe-ec08-48aa-abed-7e88d5317fec and described the unexpected v2.0.0 DriveItem. Full sanitised transaction logs can be made available if needed.
No intermediate HTTP 3xx response was recorded for the failing upload. We do not know which internal Microsoft component performed the path translation.
The original reporter also captured a path-based GET for a requested v1.0.0 item that returned metadata for the unexpected _api/v2.0.0 item. This caused the application to treat the wrong remote object as a match for the local file.
Thus, the issue may affect both creation and resolution of path-addressed DriveItems. The upload behaviour has been independently reproduced; the lookup behaviour is currently supported by the original reporter's logs.
Why this does not appear to be a client-side filename change
The relevant Linux client upload implementation builds the documented path-based URL as follows:
string url = driveByIdUrl ~ parentDriveId
~ "/items/" ~ parentId ~ ":/"
~ encodeComponent(filename) ~ ":/content";
For the filename v1.0.0, the outgoing request URL logged by the client contains the requested literal filename. There is no client-side rename to v2.0.0 and no client-generated _api folder.
This URL construction is unchanged between the Linux client's v2.5.11 and v2.5.12 release tags. The problem therefore is not identified as a v2.5.12 application regression.
We cannot yet prove the internal Graph/OneDrive service root cause; the reproducible contract violation is that the successful API response represents a different destination from the request.
Downstream consequences for sync and backup software
- Incorrect destination despite HTTP success: A valid operation returns 201 and matching contents but the wrong remote path.
- Repeated upload attempts: The intended
v1.0.0 remains absent, so clients may retry on subsequent scans.
- Unexpected folder creation:
_api appears without being requested.
- Incorrect path lookup: The original reporter observed a GET for the intended path resolving to the unexpected item.
- Local reconciliation errors: The Linux client attempts to save the returned item under the unknown
_api parent and SQLite correctly reports FOREIGN KEY constraint failed.
- Potential automated backup impact: The original case involved a Git repository backup, where version tag filenames such as
v1.0.0 are ordinary data.
The SQLite foreign-key error is a consequence, not the cause, of the incorrect remote DriveItem identity.
Hypothesis: versioned API route collision
The exact transformation is suspicious:
v1.0.0 → _api/v2.0.0
The public Microsoft Graph API uses /v1.0/, while OneDrive services also use internal API routes containing /_api/v2.0/. One possibility is that a route-translation or path-normalisation stage confuses the filename prefix v1.0 with a versioned API path component.
This is only a hypothesis. The logs do not establish which Microsoft component, if any, performs this transformation. We ask Microsoft to use the correlation IDs above to determine the actual cause.
We searched both open and closed issues in this repository and did not find an existing report of this exact v1.0.0 → _api/v2.0.0 transformation. Related precedents include:
These are not exact duplicates, but they demonstrate a history of filename-sensitive path-handling issues.
Questions for Microsoft engineering
- Why does a valid path-based PUT for
v1.0.0 return HTTP 201 while creating _api/v2.0.0 under a different parent?
- Is there a routing/path-normalisation collision between the filename prefix
v1.0 and internal API version routes?
- Can the supplied
request-id and splogid identify where the incorrect name and parent are introduced?
- Why is a successful response returned when the requested resource identity is not preserved?
- Does the same issue affect path-based GET lookups and
createUploadSession operations?
- Which other version-like filenames, if any, are affected?
- Is the issue confined to OneDrive Personal, or can it affect Business/SharePoint?
- Is there a supported workaround preserving the exact requested filename and parent, and is a service-side correction planned?
Our preference is for a service-side correction, rather than implementing filename-specific transformations in client applications for otherwise valid Graph API requests.
References
We can provide additional sanitised HTTP diagnostics and repeat targeted tests against our Personal account to assist the investigation. Please advise what additional information would be most useful.
Reference: https://github.com/OneDrive/onedrive-api-docs/issues/1934