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: AssertError@src/itemdb.d(892): Assertion failure #3143

Closed
sebastian-be opened this issue Mar 1, 2025 · 21 comments · Fixed by #3116
Closed

Bug: AssertError@src/itemdb.d(892): Assertion failure #3143

sebastian-be opened this issue Mar 1, 2025 · 21 comments · Fixed by #3116
Labels
Milestone

Comments

@sebastian-be
Copy link

Describe the bug

When running onedrive either --sync or --monitor, following error occurs (syslog of --monitor)

2025-03-01T11:08:02.732453+01:00 host od-user[1977946]: core.exception.AssertError@src/itemdb.d(892): Assertion failure
2025-03-01T11:08:02.734891+01:00 host od-user[1977946]: ----------------
2025-03-01T11:08:02.734993+01:00 host od-user[1977946]: ??:? _d_assert [0x7eb6387b7942]
2025-03-01T11:08:02.735075+01:00 host od-user[1977946]: ??:? [0x64aaeabacf01]
2025-03-01T11:08:02.735145+01:00 host od-user[1977946]: ??:? [0x64aaeabbbd22]
2025-03-01T11:08:02.735231+01:00 host od-user[1977946]: ??:? [0x64aaeabdeb40]
2025-03-01T11:08:02.735320+01:00 host od-user[1977946]: ??:? [0x64aaeabde155]
2025-03-01T11:08:02.735446+01:00 host od-user[1977946]: ??:? [0x64aaeac8368a]
2025-03-01T11:08:02.735571+01:00 host od-user[1977946]: ??:? [0x64aaeac813cc]
2025-03-01T11:08:02.735686+01:00 host od-user[1977946]: ??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7eb6387eedcc]
2025-03-01T11:08:02.735780+01:00 host od-user[1977946]: ??:? _d_run_main2 [0x7eb6387eebe6]
2025-03-01T11:08:02.735866+01:00 host od-user[1977946]: ??:? _d_run_main [0x7eb6387eea3c]
2025-03-01T11:08:02.735948+01:00 host od-user[1977946]: ??:? [0x64aaeacacf61]
2025-03-01T11:08:02.736027+01:00 host od-user[1977946]: ??:? [0x7eb637e2a1c9]
2025-03-01T11:08:02.736100+01:00 host od-user[1977946]: ??:? __libc_start_main [0x7eb637e2a28a]
2025-03-01T11:08:02.736164+01:00 host od-user[1977946]: ??:? [0x64aaeab7b294]

Please indicate if / what more info is needed?

Operating System Details

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.2 LTS"

Client Installation Method

From 3rd Party Source (PPA, OpenSuSE Build Service etc)

OneDrive Account Type

Personal

What is your OneDrive Application Version

onedrive v2.5.4-1+np1+1.1

What is your OneDrive Application Configuration

Disabling GUI notifications as per user configuration
Application version                          = onedrive v2.5.4-1+np1+1.1
Compiled with                                = LDC 2106
Curl version                                 = libcurl/8.12.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7
User Application Config path                 = /home/user/.config/onedrive
System Application Config path               = /etc/onedrive
Applicable Application 'config' location     = /home/user/.config/onedrive/config
Configuration file found in config location  = true - using 'config' file values to override application defaults
Applicable 'sync_list' location              = /home/user/.config/onedrive/sync_list
Applicable 'items.sqlite3' location          = /home/user/.config/onedrive/items.sqlite3
Config option 'drive_id'                     = 
Config option 'sync_dir'                     = /homext/user/onedrive
Config option 'enable_logging'               = false
Config option 'log_dir'                      = /var/log/onedrive
Config option 'disable_notifications'        = true
Config option 'skip_dir'                     = 
Config option 'skip_dir_strict_match'        = false
Config option 'skip_file'                    = ~*|.~*|*.tmp
Config option 'skip_dotfiles'                = false
Config option 'skip_symlinks'                = false
Config option 'monitor_interval'             = 1800
Config option 'monitor_log_frequency'        = 12
Config option 'monitor_fullscan_frequency'   = 12
Config option 'read_only_auth_scope'         = false
Config option 'dry_run'                      = false
Config option 'upload_only'                  = false
Config option 'download_only'                = false
Config option 'local_first'                  = false
Config option 'check_nosync'                 = false
Config option 'check_nomount'                = false
Config option 'resync'                       = false
Config option 'resync_auth'                  = false
Config option 'cleanup_local_files'          = false
Config option 'classify_as_big_delete'       = 1000
Config option 'disable_upload_validation'    = false
Config option 'disable_download_validation'  = false
Config option 'bypass_data_preservation'     = false
Config option 'no_remote_delete'             = false
Config option 'remove_source_files'          = false
Config option 'sync_dir_permissions'         = 755
Config option 'sync_file_permissions'        = 644
Config option 'space_reservation'            = 52428800
Config option 'permanent_delete'             = false
Config option 'application_id'               = d50ca740-c83f-4d1b-b616-12c519384f0c
Config option 'azure_ad_endpoint'            = 
Config option 'azure_tenant_id'              = 
Config option 'user_agent'                   = ISV|abraunegg|OneDrive Client for Linux/v2.5.4-1+np1+1.1
Config option 'force_http_11'                = false
Config option 'debug_https'                  = false
Config option 'rate_limit'                   = 0
Config option 'operation_timeout'            = 3600
Config option 'dns_timeout'                  = 60
Config option 'connect_timeout'              = 10
Config option 'data_timeout'                 = 60
Config option 'ip_protocol_version'          = 1
Config option 'threads'                      = 8
Config option 'max_curl_idle'                = 120
Environment var 'XDG_RUNTIME_DIR'            = false
Environment var 'DBUS_SESSION_BUS_ADDRESS'   = false
Config option 'notify_file_actions'          = false

Selective sync 'sync_list' configured        = false

Config option 'sync_business_shared_items'   = false

Config option 'webhook_enabled'              = true
Config option 'webhook_public_url'           = https://host.duckdns.org/webhooks/onedrive
Config option 'webhook_listening_host'       = 127.0.0.1
Config option 'webhook_listening_port'       = 8080
Config option 'webhook_expiration_interval'  = 1800
Config option 'webhook_renewal_interval'     = 300
Config option 'webhook_retry_interval'       = 60

What is your 'curl' version

curl 8.12.0 (x86_64-pc-linux-gnu) libcurl/8.12.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7
Release-Date: 2025-02-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP UnixSockets zstd

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

LABEL=main      /               btrfs   commit=5,compress=lzo,subvol=@ 0 1
UUID=9F5D-9055  /boot/efi       vfat    noauto,defaults        0       1
LABEL=main      /home           btrfs   commit=5,subvol=@home 0 2
LABEL=store     /homext         btrfs   commit=5,subvol=@homext,nodatacow 0 2
LABEL=swap      none            swap    sw              0       0

What are all your local file system partition types

sda                                                                           
├─sda1 vfat   FAT32       9F5D-9055                                           
├─sda2 swap   1     swap  c6687b6c-2536-4dce-9c27-80c4558b5177                [SWAP]
└─sda3 btrfs        main  7aa78bc2-2cca-43b1-b68a-bf5edb14b592   21.7G    21% /home
                                                                              /
sdb    btrfs        store 38970aad-fac8-4ca6-9632-36d9eeb7dd9d      2T    61% /homext

How do you use 'onedrive'

onedrive folder is shared using samba
same acount is also setup on another system, windows with native onedrive client

Steps to reproduce the behaviour

onedrive --sync or
onecrive --monitor

at the end, after db cleanup exception occurs

Complete Verbose Log Output

DEBUG: Initial calculated path = .
DEBUG: The path we are trying to calculate extends to a OneDrive Shared Folder .. need to perform multiple calculations to calculate the full true local path
DEBUG: Failure scope was called
DEBUG: performSynchronisedExitProcess called by: failureScope
DEBUG: Shutting down Sync Engine instance
DEBUG: SyncEngine: Waiting for all internal threads to complete
DEBUG: Shutting down processPool in a thread blocking manner
DEBUG: Shutdown Sync Engine instance is complete
DEBUG: CurlEngine releaseAllCurlInstances() called
DEBUG: CurlEngine curlEnginePool size to release: 3
DEBUG: CurlEngine cleanup() called on instance id: aIyqzchQ6Fi1Sf35
DEBUG: CurlEngine shutdownCurlHTTPInstance() called on instance id: aIyqzchQ6Fi1Sf35
DEBUG: HTTP instance still active: aIyqzchQ6Fi1Sf35
DEBUG: HTTP instance isStopped state before http.shutdown(): false
DEBUG: HTTP instance isStopped state post http.shutdown(): true
DEBUG: HTTP instance shutdown and destroyed: aIyqzchQ6Fi1Sf35
DEBUG: CurlEngine destroyed
DEBUG: CurlEngine cleanup() called on instance id: OswdHa0qSQmYDKnM
DEBUG: CurlEngine shutdownCurlHTTPInstance() called on instance id: OswdHa0qSQmYDKnM
DEBUG: HTTP instance still active: OswdHa0qSQmYDKnM
DEBUG: HTTP instance isStopped state before http.shutdown(): false
DEBUG: HTTP instance isStopped state post http.shutdown(): true
DEBUG: HTTP instance shutdown and destroyed: OswdHa0qSQmYDKnM
DEBUG: CurlEngine destroyed
DEBUG: CurlEngine cleanup() called on instance id: chwjdMRWF58gbz1K
DEBUG: CurlEngine shutdownCurlHTTPInstance() called on instance id: chwjdMRWF58gbz1K
DEBUG: HTTP instance still active: chwjdMRWF58gbz1K
DEBUG: HTTP instance isStopped state before http.shutdown(): false
DEBUG: HTTP instance isStopped state post http.shutdown(): true
DEBUG: HTTP instance shutdown and destroyed: chwjdMRWF58gbz1K
DEBUG: CurlEngine destroyed
DEBUG: CurlEngine releaseAllCurlInstances() completed
DEBUG: Shutting down Client Side Filtering instance
DEBUG: Shutdown of Client Side Filtering instance is complete
DEBUG: Shutting down Database instance
DEBUG: Merge contents of WAL and SHM files into main database file before shutting down database
DEBUG: Attempting to perform a database checkpoint to merge temporary data
DEBUG: Counting open SQL statements
DEBUG: Database checkpoint is complete
DEBUG: Attempting to perform a database vacuum to optimise database
DEBUG: Counting open SQL statements
DEBUG: Database vacuum is complete
DEBUG: Shutdown of Database instance is complete
DEBUG: Shutting down Application Configuration instance
DEBUG: Shutdown of Application Configuration instance is complete
DEBUG: Application is exiting
DEBUG: Shutting down Application Logging instance
core.exception.AssertError@src/itemdb.d(892): Assertion failure
----------------
??:? _d_assert [0x7d033196e942]
??:? [0x61d680718f01]
??:? [0x61d680727d22]
??:? [0x61d68074ab40]
??:? [0x61d68074a155]
??:? [0x61d6807ef68a]
??:? [0x61d6807ec0ff]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7d03319a5dcc]
??:? _d_run_main2 [0x7d03319a5be6]
??:? _d_run_main [0x7d03319a5a3c]
??:? [0x61d680818f61]
??:? [0x7d033162a1c9]
??:? __libc_start_main [0x7d033162a28a]
??:? [0x61d6806e7294]

Screenshots

No response

Other Log Information or Details

n/a, no entries during exec

Additional context

No response

@sebastian-be sebastian-be added the Bug Something isn't working label Mar 1, 2025
@sebastian-be
Copy link
Author

I'll monitor it further, but seems to be also realted to #3115 altough not directly obvious as trace was different.
with onedrive v2.5.4-28-gc803fb9, unable to reproduce

@cyb3rko
Copy link

cyb3rko commented Mar 1, 2025

Seems like the same thing I was referring to in #3122 (comment)

@dimsinel
Copy link

dimsinel commented Mar 1, 2025

Exactly the same here, on Kubuntu 24.04.2
On sync it downloads correctly, but will not upload.

core.exception.AssertError@src/itemdb.d(892): Assertion failure
----------------
??:? _d_assert [0x73c680915942]
??:? [0x589ec0352f01]
??:? [0x589ec0361d22]
??:? [0x589ec0384b40]
??:? [0x589ec0384155]
??:? [0x589ec0429392]
??:? [0x589ec0425f68]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x73c68094cdcc]
??:? _d_run_main2 [0x73c68094cbe6]
??:? _d_run_main [0x73c68094ca3c]
??:? [0x589ec0452f61]
??:? [0x73c68002a1c9]
??:? __libc_start_main [0x73c68002a28a]
??:? [0x589ec0321294]

@abraunegg
Copy link
Owner

abraunegg commented Mar 1, 2025

@sebastian-be , @dimsinel , @cyb3rko
This is the SAME issue as #3115 & #3136

It is:

  • OneDrive Shared Folder related
  • It has to do with a major API change that Microsoft is making to everyone's account (including mine that has now been done overnight)
  • API response inconsistency of values being in some cases UPPERCASE and values being lowercase. Microsoft is not POSIX compliance thus to them it is the same thing .. its not ....

Please stop raising new issues for known problems!

@abraunegg abraunegg added the Duplicate This issue or pull request already exists label Mar 1, 2025
@sebastian-be
Copy link
Author

Please stop raising new issues for known problems!

Gladly BUT ... as trace was different, I was unable to identify as same. Only after trying other workaround, was able to confirm...

@abraunegg
Copy link
Owner

@sebastian-be
The trace output for your Ubuntu platform is due to the binary being built the way it is without debugging.

The clue here is this:

DEBUG: The path we are trying to calculate extends to a OneDrive Shared Folder .. need to perform multiple calculations to calculate the full true local path

This is the cause ... and is failing because:

  1. driveId values are UPPERCASE or lowercase .. the API is being inconsistent , and are now generally UPPERCASE if your rootId contains sea8cc6beffdb43d7976fbc7da445c639
  2. driveId value , if this starts with a zero - it ends up being truncated by the API to 15 characters ..

@abraunegg
Copy link
Owner

To those watching | impacted by this bug(s)

I was working on this issue heavily yesterday (1st March 2025) and the solution was working rather well with all testing.

This morning, when I was re validating the code, overnight there has been an account change to all of my OneDrive Personal accounts where the accounts now have the 'sea8cc6beffdb43d7976fbc7da445c639' Microsoft change.

As such, when I now query the API for all the folders online, the /delta query that this client heavily uses no longer is providing the Shared Folder JSON data that the /delta query was providing yesterday before the 'sea8cc6beffdb43d7976fbc7da445c639' account change.

I have raised a bug with Microsoft for this issue - but until this data quality issue from the Microsoft OneDrive API is fixed, a full resolution for this insideous series of bugs caused by this 'sea8cc6beffdb43d7976fbc7da445c639' change cannot be resolved.

The new API bug is listed here: OneDrive/onedrive-api-docs#1891

@abraunegg
Copy link
Owner

To those watching | impacted by this bug(s)

Caution

This maybe a 100% coding fix - however at the moment this needs a workaround to also be implemented by impacted users

Please can you test this updated PR and provide valuable feedback.

To test the PR, first install all the require platform dependencies to build the client on your respective platforms. Please read https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and then follow correctly for your platform.

Important

Currently there is an issue with installing the DMD or LDC compiler using the documentation instructions:
curl -fsS https://dlang.org/install.sh | bash -s dmd or curl -fsS https://dlang.org/install.sh | bash -s ldc

This is not something I can solve and I have emailed the appropriate folk and raised dlang/dmd#20830

Please augment the installation of DMD or LDC with your distribution version if it is available

Once this is done, to clone the PR to resolve your issue, you can use a script like the following:

#!/bin/bash

PR=3116

rm -rf ./onedrive-pr${PR}
git clone https://github.com/abraunegg/onedrive.git onedrive-pr${PR}
cd onedrive-pr${PR}
git fetch origin pull/${PR}/head:pr${PR}
git checkout pr${PR}

# Configure and Build
./configure --enable-debug --enable-notifications; make clean; make;
./onedrive --version

This script will create a local folder called onedrive-pr3116 with the PR version.

Important

Before running this PR please add to your configuration file force_children_scan = "true"

This will bypass the new OneDrive API /delta bug OneDrive/onedrive-api-docs#1891 where OneDrive Personal Folder details are no longer sent in the /delta response when your account has been migrated to the new Microsoft OneDrive platform. You can tell when you are impacted as when you run the application in verbose mode, it will look like this:

The OneDrive API was initialised successfully
Opening the item database ...
Forcing client to use /children API call rather than /delta API to retrieve objects from the OneDrive API
Application Version:   onedrive v2.5.4-29-g5d836ad
Account Type:          personal
Default Drive ID:      66D53BE8A5056ECA
Default Root ID:       66D53BE8A5056ECA!sea8cc6beffdb43d7976fbc7da445c639
Microsoft Data Centre: Australia Southeast

To run the PR, you need to run the client from the PR build directory:

./onedrive <any other options needed>

To install the PR, you will need to perform sudo make install to install the PR version to your system.

When running the PR, your version should be: onedrive v2.5.4-29-g5d836ad or greater.

If you still encounter an issue, please generate a new verbose debug log following this process: https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support

@sebastian-be
Copy link
Author

Output:

onedrive-3116.29 --sync --verbose
Reading configuration file: /home/user/.config/onedrive/config
Configuration file successfully loaded
Using 'user' configuration path for application config and state data: /home/user/.config/onedrive
Disabling GUI notifications as per user configuration
Forcing client to use IPv4 connections only
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...
Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Forcing client to use /children API call rather than /delta API to retrieve objects from the OneDrive API
Application Version:   onedrive v2.5.4-29-g5d836ad
Account Type:          personal
Default Drive ID:      XXXXXXXXXXXXXXXX
Default Root ID:       XXXXXXXXXXXXXXXX!sea8cc6beffdb43d7976fbc7da445c639
Microsoft Data Centre: West Europe
Remaining Free Space:  1000.50 GB (1074278694912 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /homext/user/onedrive
Generating a /delta response from the OneDrive API for this Drive ID: XXXXXXXXXXXXXXXX and Item ID: XXXXXXXXXXXXXXXX!sea8cc6beffdb43d7976fbc7da445c639
Adding OneDrive folder details for processing
Adding 10 OneDrive items for processing from the OneDrive 'root' Folder

...


Skipping path - The Microsoft OneNote Notebook File '/Documents/Sebastian's Notebook/OneNote_RecycleBin/OneNote_DeletedPages.one' is not supported by this client
Skipping path - The Microsoft OneNote Notebook File '/Documents/Sebastian's Notebook/OneNote_RecycleBin/Open Notebook.onetoc2' is not supported by this client
...

Finished processing self generated /delta JSON response from the OneDrive API
Processing 13057 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/27] to ensure consistent local state
Processing OneDrive JSON item batch [2/27] to ensure consistent local state
Processing OneDrive JSON item batch [3/27] to ensure consistent local state
Processing OneDrive JSON item batch [4/27] to ensure consistent local state
Processing OneDrive JSON item batch [5/27] to ensure consistent local state
Processing OneDrive JSON item batch [6/27] to ensure consistent local state
Processing OneDrive JSON item batch [7/27] to ensure consistent local state
Processing OneDrive JSON item batch [8/27] to ensure consistent local state
Processing OneDrive JSON item batch [9/27] to ensure consistent local state
Processing OneDrive JSON item batch [10/27] to ensure consistent local state
Processing OneDrive JSON item batch [11/27] to ensure consistent local state
Processing OneDrive JSON item batch [12/27] to ensure consistent local state
Processing OneDrive JSON item batch [13/27] to ensure consistent local state
Processing OneDrive JSON item batch [14/27] to ensure consistent local state
Processing OneDrive JSON item batch [15/27] to ensure consistent local state
Processing OneDrive JSON item batch [16/27] to ensure consistent local state
Processing OneDrive JSON item batch [17/27] to ensure consistent local state
Processing OneDrive JSON item batch [18/27] to ensure consistent local state
Processing OneDrive JSON item batch [19/27] to ensure consistent local state
Processing OneDrive JSON item batch [20/27] to ensure consistent local state
Processing OneDrive JSON item batch [21/27] to ensure consistent local state
Processing OneDrive JSON item batch [22/27] to ensure consistent local state
Processing OneDrive JSON item batch [23/27] to ensure consistent local state
Processing OneDrive JSON item batch [24/27] to ensure consistent local state
Processing OneDrive JSON item batch [25/27] to ensure consistent local state
Processing OneDrive JSON item batch [26/27] to ensure consistent local state
Processing OneDrive JSON item batch [27/27] to ensure consistent local state
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: XXXXXXXXXXXXXXXX


Processing: /homext/user/onedrive
The directory has not changed
...

Processing: Attachments
The directory has not changed

Scanning the local file system '/homext/user/onedrive' for new data to upload

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete

@abraunegg
Copy link
Owner

@sebastian-be
Thanks for your feedback. Please monitor closely.

@sebastian-be
Copy link
Author

That was one-off run. The process was quite slow, given the number of files / directories involved.
Is that manual delta to be executed on each sync time?
Config option 'monitor_interval' = 1800 <- that one?

Given I use webhooks I've set it high, but default is 300, and my sync is now taking about that much.

Thank you, for info and effort. Much appreciated.

@abraunegg abraunegg reopened this Mar 2, 2025
@abraunegg
Copy link
Owner

@sebastian-be

That was one-off run. The process was quite slow, given the number of files / directories involved.

This is because the client, when using the 'force children scan' developer option, it is having to manually build your tree - because Microsoft broke the /delta API query when they have moved everyone's account to a new backend platform. The details for this API bug can be found here: OneDrive/onedrive-api-docs#1891

Please also rebuild your client to onedrive v2.5.4-30-g43ba76c as a further issue with UPPERCASE / lowercase API responses has been uncovered.

Whilst forcing to use /children is a way for users to start using Microsoft OneDrive again, ideally Microsoft should fix the /delta bug so that some performance speed can be brought back.

@sebastian-be
Copy link
Author

Thx for update.

Would you mind clarifying: is the sync process a "background" task, meaning other stuff, like for example treating webhook, still happen concurrently?

@abraunegg
Copy link
Owner

Thx for update.

Would you mind clarifying: is the sync process a "background" task, meaning other stuff, like for example treating webhook, still happen concurrently?

Webhooks and everything else is impacted by these API bugs. The PR works around these bugs that Microsoft introduced.

If you use --sync or --monitor you are impacted - it is all the same code that calls the same API endpoints that these Microsoft API bugs affect. The differenve between the two is that 'monitor' supports inofify file system monitoring and webhooks. The 'monitor' process will loop every 5 mins by default pulling down online changes.

There should be no real impact to using webhooks except you must use this PR to work around the API bugs and implement the child scan method due to the /delta bug that Microsoft introduced.

Net effect - you have 2 choices:

  • a working client that operates slowly due to children scanning and using onedrive personal shared folders
  • not using onedrive personal shared folders

@cyb3rko
Copy link

cyb3rko commented Mar 4, 2025

The fix works for me as well

@abraunegg
Copy link
Owner

abraunegg commented Mar 7, 2025

To those watching | impacted by this bug(s)

Please rebuild your PR client version to onedrive v2.5.4-33-gd45ca81

It potentially appears that Microsoft has resolved the /delta API query bug that failed to send OneDrive Personal Shared Folder details, thus potentially you may be able to stop the use of the force_children_scan = "true" temporary workaround.

If you get this sort of error or similar without force_children_scan = "true" ..

ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    HTTP request returned status code 404 (Not Found)
  Error Reason:     Item not found
  Error Code:       itemNotFound
  Error Timestamp:  2025-03-07T04:17:05
  API Request ID:   65c928ec-97b5-4c63-9379-d905dedd9706
  Calling Function: syncEngine.performNewFileUpload()

You need to re-enable force_children_scan = "true"

When using this client version, please use --resync --resync-auth to ensure that your local database is cleaned up to remove any of the old database entries.

Please can you test this client version and advise.

@sebastian-be
Copy link
Author

Thx for 'ping'!
No issues here, first run

onedrive-3116.33 --sync
Reading configuration file: /home/user/.config/onedrive/config
Configuration file successfully loaded
Disabling GUI notifications as per user configuration
Forcing client to use IPv4 connections only
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Configuring Global Azure AD Endpoints
The item database is incompatible, re-creating database table structures
Fetching items from the OneDrive API for Drive ID: xxxxxxxxxxxxxxxx ................................... 
Processing 14289 applicable JSON items received from Microsoft OneDrive ............................. 
Performing a database consistency and integrity check on locally stored data ..... 
Scanning the local file system '/homext/user/onedrive' for new data to upload ... 
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching items from the OneDrive API for Drive ID: xxxxxxxxxxxxxxxx . 
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete

Second with verbose

onedrive-3116.33 --sync --verbose
Reading configuration file: /home/user/.config/onedrive/config
Configuration file successfully loaded
Using 'user' configuration path for application config and state data: /home/user/.config/onedrive
Disabling GUI notifications as per user configuration
Forcing client to use IPv4 connections only
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...
Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Application Version:   onedrive v2.5.4-33-gd45ca81
Account Type:          personal
Default Drive ID:      xxxxxxxxxxxxxxxx
Default Root ID:       xxxxxxxxxxxxxxxx!sea8cc6beffdb43d7976fbc7da445c639
Microsoft Data Centre: Germany West Central
Remaining Free Space:  1000.50 GB (1074278694912 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /homext/user/onedrive
Fetching /delta response from the OneDrive API for Drive ID: xxxxxxxxxxxxxxxx
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 0
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: xxxxxxxxxxxxxxxx
Processing: /homext/user/onedrive
...
Processing: Attachments
Scanning the local file system '/homext/user/onedrive' for new data to upload
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching /delta response from the OneDrive API for Drive ID: xxxxxxxxxxxxxxxx
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 0
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete```

@abraunegg abraunegg added the Fixed label Mar 7, 2025
@ulbi
Copy link

ulbi commented Mar 8, 2025

Thanks for working so hard to get this fixed and deal with Microsoft on this! @abraunegg

@vikingtiger
Copy link

Tried a manual resync with onedrive v2.5.4-37-g53656b3, without "force_children_scan". It worked fine! It took a few minutes to complete. I used tee to write stdout to a log file while also displaying it. With -vv debug output, this resulted in a 774 MiB log file. No errors!

I noticed the lack of response in the onedrive-api-docs repo. It still seems like @abraunegg 's persistent efforts to make MS aware of the issues gave results. This is a very well-maintained project, even though there is only a single major contributor. That is admirable. The project deserves more helping hands and contributions (work or donations) going forward, in my opinion.

@abraunegg
Copy link
Owner

To those watching | impacted by these bug(s)

Many thanks for your patience and feedback whilst these issues were being resolved. It is greatly appreciated.

@abraunegg
Copy link
Owner

To those watching | impacted by this bug(s)

As all 4 issue tickets are now marked as fixed, PR #3116 will be merged into 'master'.

Please rebuild your client from 'master' when possible, and please keep an eye out for v2.5.5 when that is released.

@abraunegg abraunegg added this to the v2.5.5 milestone Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants