Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: OneDrive upload fails with "400 Client Error: Bad Request for url #210

Open
ScottWell1 opened this issue Jan 3, 2025 · 0 comments

Comments

@ScottWell1
Copy link

Description of the bug

I have had Octoprint-OneDrive-Backup working successfully for several months. I create a backup on the first of each month (using the "backup-scheduler" plugin). OneDrive-Backup has successfully uploaded each month (the OneDrive folder contains the backups for August-1, September-1, October-1, November-1, and December-1).

However, it failed trying to upload the January-1 backup. I tried a manual backup on January-2. The backup completed, but OneDrive-Backup failed to upload it.

I uninstalled OneDrive-Backup (and chose to cleanup variables), restarted, reinstalled, and restarted again.

I used the plugin's settings page to login and got a "successful" response. I was also able to use the plugin to get a list of OneDrive folders and choose my backup folder -- so it seems authentication is "good" and the plugin can communicate with Onedrive, at least to get the folder list.

I ran another manual backup, and Onedrive-backup again failed to upload. The problem looks similar to the older issue #112 but I am using "OneDrive Personal" -- I have never had a Onedrive work or school account.

The error in octoprint log is as follows (I have used "X" to obscure the item id and request id, as I don't know if those are sensitive or not):

2025-01-02 15:43:12,661 - octoprint.plugins.onedrive_backup.OneDriveComm - ERROR - 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/drive/items/XXXXXXXXXXXXXXXX!20100:/octoprint-backup-20250102-154227.zip:/createUploadSession
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.11/site-packages/octoprint_onedrive_backup/onedrive.py", line 314, in _graph_request
    response.raise_for_status()
  File "/home/pi/oprint/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/drive/items/XXXXXXXXXXXXXXXX!20100:/octoprint-backup-20250102-154227.zip:/createUploadSession
2025-01-02 15:43:12,661 - octoprint.plugins.onedrive_backup.OneDriveComm - ERROR - Error creating upload session: {'code': 'invalidRequest', 'message': 'Invalid request', 'innerError': {'date': '2025-01-02T23:43:12', 'request-id': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'client-request-id': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'}}

Plugin version

1.0.1

OctoPrint version

1.10.3

OctoPrint logs

2025-01-02 15:43:12,227 - octoprint.plugins.backup - INFO - ... done creating backup zip.
2025-01-02 15:43:12,231 - octoprint.plugins.onedrive_backup.OneDriveComm - INFO - Starting upload session for octoprint-backup-20250102-154227.zip
2025-01-02 15:43:12,661 - octoprint.plugins.onedrive_backup.OneDriveComm - ERROR - 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/drive/items/XXXXXXXXXXXXXXXX!20100:/octoprint-backup-20250102-154227.zip:/createUploadSession
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.11/site-packages/octoprint_onedrive_backup/onedrive.py", line 314, in _graph_request
response.raise_for_status()
File "/home/pi/oprint/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/drive/items/XXXXXXXXXXXXXXXX!20100:/octoprint-backup-20250102-154227.zip:/createUploadSession
2025-01-02 15:43:12,661 - octoprint.plugins.onedrive_backup.OneDriveComm - ERROR - Error creating upload session: {'code': 'invalidRequest', 'message': 'Invalid request', 'innerError': {'date': '2025-01-02T23:43:12', 'request-id': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'client-request-id': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant