You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the description field being set in the DriveItemUploadableProperties is a json object that is stringified. I suspect its possible that it may contain a character that the API does not like.
To rule this out, are you able to make a successfull request if you create an upload session with a hardcoded description that is a plain string to validate?
Thanks @andrueastman.
I think you're correct about the description field causing the issue but I'm not sure what characters are causing this. I tried sending the body above from my machine but this did not reproduce the issue even though it was failing for other users.
I ended up removing the description altogether and that resolved the issue.
Describe the bug
I'm trying to create an upload session using the Graph SDK. With many different OneDrive accounts this results in an ODataError : Invalid Request.
Additional Details:
Expected behavior
Upload Session should be created successfully or at least a meaningful error returned to understand what's wrong with the request.
How to reproduce
Using the following code:
SDK Version
Graph: 5.62.0, Graph.Core: 3.2.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
``` Error: Error uploading backup: Microsoft.Graph.Models.ODataErrors.ODataError: Invalid request at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponseAsync(HttpResponseMessage response, Dictionary2 errorMapping, Activity activityForAttributes, CancellationToken cancellationToken) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory1 factory, Dictionary2 errorMapping, CancellationToken cancellationToken) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory1 factory, Dictionary2 errorMapping, CancellationToken cancellationToken) at Microsoft.Graph.Drives.Item.Items.Item.CreateUploadSession.CreateUploadSessionRequestBuilder.PostAsync(CreateUploadSessionPostRequestBody body, Action1 requestConfiguration, CancellationToken cancellationToken) at hassio_onedrive_backup.Graph.GraphHelper.UploadFileAsync(String filePath, DateTime date, String instanceName, TransferSpeedHelper transferSpeedHelper, String destinationFileName, Action2 progressCallback, Boolean flatten, String description) ```Configuration
OS: Linux
Architecture: ARM64, x64
Other information
Sample Request:
URL:
https://graph.microsoft.com/v1.0/drives/4A4F1C96B648045A/items/4A4F1C96B648045A%211858:/hass_backup_2024-11-20-12-45.tar:/createUploadSession
Body:
{"item":{"description":"{\u0022Slug\u0022:\u0022bfebf0aa\u0022,\u0022BackupDate\u0022:\u00222024-11-20T12:45:43.188392\u002B01:00\u0022,\u0022InstanceName\u0022:null,\u0022IsProtected\u0022:false,\u0022Size\u0022:570.58,\u0022BackupType\u0022:\u0022full\u0022,\u0022Addons\u0022:[],\u0022Folders\u0022:[\u0022share\u0022,\u0022addons/local\u0022,\u0022ssl\u0022,\u0022media\u0022]}"}}
The text was updated successfully, but these errors were encountered: