apache / apache/opendal

bug: onedrive big file write failure

Open
#7,256 1 comment 1 reaction 0 assignees View on GitHub
bug releases-note/fix
Dominant language
Rust
Stars
5.4k
Forks
825
Avg merge
1d 14m
Merged PRs (30d)
127

Description

### Describe the bug

Big file upload to onedrive fails.

### Steps to Reproduce

Upload a big file to trigger create upload session
```
2026-03-20T14:15:15.560999Z ERROR request{method=PUT uri=/zotero/CHTED7JW.zip version=HTTP/1.1}: opendal::services: service=onedrive name= path=CHTED7JW.zip written=22401199: write close failed Unexpected (permanent) at write => {"error":{"code":"invalidRequest","message":"Name from path does not match name from body","innerError":{"date":"2026-03-20T14:15:15", ... }}}

Context:
uri: https://graph.microsoft.com/v1.0/me/drive/root:/zotero_attachments:/createUploadSession
response: Parts { status: 400, version: HTTP/1.1, headers: {"cache-control": "no-store, no-cache, max-age=0, private", "transfer-encoding": "chunked", "content-type": "application/json", ..., "date": "Fri, 20 Mar 2026 14:15:15 GMT"} }
service: onedrive
path: CHTED7JW.zip
written: 22401199
```

### Expected Behavior

no error

### Additional Context

Per doc: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online#upload-bytes-to-the-upload-session

I think it's expecting a path in the full path in url including filename not just the base dir.

I came across this issue recently, so it might works before, but now it fails.

### Are you willing to submit a PR to fix this bug?

- [x] Yes, I would like to submit a PR.

Contributor guide

Open the contributing guide

Research direction

Start with the Rust OneDrive service implementation and its create-upload-session request, then compare the generated URL and request body with the linked Microsoft Graph documentation. Reproduce the failure with a large file and verify that the upload completes without the path/name mismatch error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.