OneDrive / onedrive-api-docs

Official documentation for the OneDrive API
MIT License
447 stars 228 forks source link

Either 'folder' or 'file' must be provided, but not both. #1780

Open samvv opened 5 months ago

samvv commented 5 months ago

Category

Expected or Desired Behavior

OneDrive should respond with 200 OK.

Observed Behavior

I'm writing a file migration service for OneDrive using Microsoft Graph and testing it on the drive of a SharePoint site. I'm occasionally getting very weird error messages seemingly out of nowhehere. They happen very occasionally, not necessarily always on the same file.

What I basically do is this (to my knowledge, I'm using an API wrapper in Rust):

This works, always:

POST /drives/{drive-id}/root:{file-path}:/createUploadSession
{ ... }

This works most of the time:

PATCH /drives/{drive-id}/root:/{file-path}
{
  "fileSystemInfo": {
    "lastModifiedDateTime": "2024-01-30T13:01:51.909+00:00"
  }
}

The second API call very rarely returns status 400 with the following body:

Some(
    Object {
        "error": Object {
            "code": String("invalidRequest"),
            "innerError": Object {
                "client-request-id": String("183e765d-355b-4d67-816a-c5fdf6f4e839"),
                "date": String("2024-02-08T20:39:27"),
                "request-id": String("183e765d-355b-4d67-816a-c5fdf6f4e839"),
            },
            "message": String("Either 'folder' or 'file' must be provided, but not both."),
        },
    },
)

Steps to Reproduce

I don't know! This happens so occasionally that I have no clue how to reproduce it. Maybe someone from the Microsoft team has an idea?

Denwah commented 4 months ago

I have the same issue